their proper headers, we need to find the null (centerpoint)
of each servo. Ideally, the command SERVO n,150 would be
the centerpoint for our Sharp sensor servo and the stopping
point for our two continuous rotation servos. After you test,
however, you may find that each servo requires a slightly
different number to null due to servo variations, and the
fixed resistors which replaced the pot:
My continuous rotation servos hit full speed at ± 20
units of their null position, with proportional speed in
between. There's no point in using numbers outside
that range.
#picaxe 20m2 servo 5,150 ' send command to center IR sensor servo, may be ' 130-170 do:loop ' do it forever
Carefully test your IR sensor servo. You want to achieve
the full mechnical range (approximately 180 degrees)
without jamming it against its mechanical stops. The
headtrack program provided here oscillates the servo from
one extreme to the other. (Yep. Got a video of that too:
www.youtube.com/watch?v=O18ZHHfJrN0). Use that
code to tweak your servo limits, which may be slightly
different than mine.
Then, find the effective useful range for each servo.
Here’s how my servos responded:
left servo: 122 full reverse 142 null/stop 162 full forward
right servo: 165 full forward 145 null/stop 125 full reverse
IR sensor servo: 70 full ccw 130 center 230 full cw
IR drive is a remote control program which allows you
to steer SpiderBot with a Sony TV remote (or universal
remote set up as one) with the number keys as follows:
2 = fwd; 5 = stop, 8 = reverse; 4 = left; and 6 = right. The
handcontrol program lets you control SpiderBot by moving
your hand in proximity to the Sharp IR sensor (www.you
tube.com/watch?v=08YB5BOLzgU). That code shows
two different ways to use the sensor's analog output using
a proper ADC to get a relative distance measurement, or
using the input pin’s comparator-like ability to digitally
Top view.
72 SERVO 03.2014