2007-Nov-19 Servo wiring
At the start of this session, we had the frame built, and just needed to get the electronics finished.
We built a two servo version of the control wiring from the first, using digital channels 2 and 3 for the two servos.
Then we connected one end to the Arduino, and the other to the servo motors. Originally we had the two three pin headers together as a single 6 pin header, but it turned out that the connector housing on the servo cables wouldn't allow for that, so we cut them apart.
I modified our back-and-forth program from the initial servo test so that it would output opposing signals for the two servos. With the first version of the program, one servo only moved in one direction, so we had to debug it a bit. Putting the signal on the scope showed the problem right away. One signal was varying from 1 to 2 ms, but the other was varying from 0 to 1 ms.
The code was something like this:
setOutput(2, HIGH); delayMicroseconds(n); setOutput(2, LOW); setOutput(3, HIGH); delayMicroseconds(2000-n); setOutput(3, LOW);
The problem was the 2000-n. I changed it to 3000-n, and all was well.
Once we were happy with the servos moving together, we started prep for mounting the Arduino onto the frame.
Unfortunately there are only 3 holes in the board, and they are not placed well for mounting. One has a surface mount LED right next to the hole, so we would not be able to put a nut or standoff in that hole.
It turns out that the easiest way was to re-use one of the frame holes, and then drill a second hole. Two standoffs should be sufficient to hold the board, since we're not going to be stressing it.
We used nylon standoffs just to make sure we wouldn't short any traces. With this done, we have a working robot base. It just needs wheels, a battery pack, and something to stabilize the front end, like a small ball caster or something.
Return to the robot project main page.