Thursday 31 January 2013

Resting after a long trek

Wow, yesterday really took it out of me. I was getting cramp in my feet and legs last night. When I woke up in the morning, I was feeling a lot better, but still a bit broken. So I was taking it a bit easy today.

I did a bit more on the Robotic Arm Two. Where I'd left it, using the relay box over the RS 232 serial port (converted from USB) was crashing the Pi pretty often; maybe one time in a couple of hundred, and that's not reliable enough even for a thing like this. So I decided to change from using the RS 232 relay box, to a relay box that uses USB directly.

I wired up the eight relays so that each robot arm motor could go forward or back, and connected everything up, being careful to connect the relay box to the twelve volt line. Which, of course, is completely wrong, those servos want 5 or 6 volts. I was lucky that I didn't blow any of the motors. Then I connected it up correctly, and it worked. Sort of.

The problem was, switching the motor on and then immediately off, was leaving the motor on for a variable length of time of between 1/10 and 1 second. That's completely useless, of course. And I couldn't see what was causing this variable lag. I tried this, I tried that, and eventually I tried running as root, and for a reason I don't understand, that gave me the desired effect; switching on and immediately off gives a short and pretty stable pulse of electricity which moves the arm a short enough distance for it to be controllable. So I sorted something out using sudo (not a command I'm used to using, when I want to be root, I'm root).

Also, I decided that having to make 20 keystrokes to get the full coords, would start to get tedious. So I've decided to show a few of the numbers after each keystroke.

Also, I've sorted out the problem with the watchdog and I've now got that fully enabled.

No comments:

Post a Comment