I’ve made some excellent progress over the last week! The Robot is now independant, and it moves freely. I’ve written a simple shell script to take the following characters as control:
a - left
s - stop
d - right
w - forward
x - back
q - hard stop
k - turn anticlockwise
l - turn clockwise
This sends a single byte to the serial port. I am using 2xUSB to TTL converters which show up as
/dev/ttyUSB0 and /dev/ttyUSB. Each serial port controls two motors through the sabertooth controller. As we control two motors with only a byte, each motor has a 7 bit resolution from full reverse to full forward. For motor 1, 0 is stop, 1 is full forward, 64 is stop, 127 is full reverse. Motor 2 starts at 128 for full forward, 192 for stop, and 255 as full reverse. Although 7 bits of accuracy, speed changes only seem to occur at roughly 4 intervals, so we technically have about 32 different speeds, 14 forward, 2 stop, 14 reverse. We’re only using 3 speeds though as I can’t see the benefit in programming for any more right now.
The movement now seems to be working well. Smooth, controlled and straight which is something of a miracle
The battery is a 12V/7.2Ah sealed lead acid battery. With USB devices active, the board running and the processor 100% active, as well as peripheral fancy LEDs, digital outputs high, wifi active, etc, it uses 12v/800mA.
With all four motors moving at full speed, it uses 12v/6A. Seeing as the motors will be in action for short periods only, I would expect 6h+ battery life.
I have tested the sensors, and they are all working and reporting data except for the top back one which I’m going to have to investigate. Here are some more pictures:
I had an issue where the Phidget Interface Board driver was using too much USB bandwidth. When I had one of those boards plugged in, other devices stopped functioning or couldn’t get the necessary bandwidth for certain operations. I suspect the driver may not be perfect. An upgrade from 2.6.18 to 2.6.24 didn’t help. I had to remove the miniPCI USB device from the APNIC Box and add that to this board. I now have another USB controller and two more busses, so everything now seems to work fine.
The robot speaks with ‘espeak’ pretty well as long as you remember to spell the words fo-net-ik-ally. I’m also investigating an avenue for voice to text using the USB sound and the mic. Not had much success with the various F/OSS out there already.
All hardware purchased so far has been used which is encouraging, and the only damage has been to a £15 ($25 at the time of writing) USB Hub which I had to replace as I damaged the tracks underneath it. I’ve got a 4×20 picoLCD on order which has an IR input as well which could open up some more possibilities.
The battery does not need to be removed to be charged, and the device will function with the battery disconnected and being powered by a 14.4V charger. The device will also function whilst the charger is connected and the battery is actively charged. I prefer to trickle charge the battery at about 14.4V/200mA .
P.S. it’s 100% open source (except for the atheros HAL, not enough confidence in ath5k.)
P.P.S. Next update will be a video
Tags: digital output, espeak, Linux, Linux robot, motors, sensors, serial port, the robot, usb devices, usb sound, usb to serial, usb to ttl