Background:
I use the PIC16C74 20MHz microcontroller to do a robot
project.
6 analogue signals are received from 6 IR proximity sensors
(Receiver only receive the reflected signal emitted by the
transmitter). The signal received may assume to be inversely
proportional to the square of the distance travelled from the
emitter to the reflected surface and back to the receiver.
The equation is V=k/d2
where V is the reflected signal from the reflected surface
k is a constant
d is the distance travelled from the emitter to the reflected
surface and back to the receiver
The distance value and a direction value (another sensor reading)
are input to a fuzzy logic control strategy with two outputs controlling
both the turning rate (in terms of angle) and linear velocity( in terms
of pulse rate) of the robot.
Questions:
1) How can I write a program to receive these analogue signals and
transform these into distance value and put these
readings into
some addresses in sequence ?
2) How can I write a program to control a stepping motor motion
(assume 2 I/O pins to control the direction and
clock signal)
with input pulse rate from 100Hz to 400Hz ?
Thanks !
Samuel Lau
E-mail : cclau@vtc.edu.hk