Carambola powered robot v2
If you were interested in first Carambola based rover, you will love this one. First one was just how to connect and setup everything. This one is actualy usable and fun to use. Purpose of this rover is to replace crappy toy cars and to have more fun. Not fogetting ability to learn and build something new! It even has an Android application.
Goals set for this rover
- Easy to control
- Controllable from Android phone or tablet
- Video streaming
Lets start from fun part
Video and couple of pictures.
- Motors: from ebay (Torque: 130 N*cm, 12V DC, 60RPM, Diameter: 25mm, Length: 72mm, Shaft diameter: 4mm, Weight: 96g)
- Camera: 720p Webcam Microsoft LifeCam Cinema
- Motor controller: Pololu Qik 2s12v10 Dual Serial Motor Controller
- Battery: 3SP1 3Ah LiPo
- Wheels: Dagu Wild Thumper Wheel 120x60mm Pair with 4mm Shaft Adapters
- Chasis: I have chosen to use custom chasis, because it is easier to accomodate all parts the way I like.
3D (STEP) file of this rover can be found here.
Here is quick sketch how everything is connected.
Select all if unsure
scp email@example.com:/home/test/carambola/bin/ramips/openwrt-ramips-rt305x-carambola-squashfs-sysupgrade.bin /tmp
sysupgrade -v -n /tmp/openwrt-ramips-rt305x-carambola-squashfs-sysupgrade.bin
Setup wireless in AP mode
wifi detect > /etc/config/wireless
config wifi-device radio0
# option disabled 1
option txpower 20
option device radio0
option network wwan
option mode ap
option ssid ‘rover’
option encryption psk2
option key ‘rover’
config interface ‘lan’
option ifname ‘eth0.1′
option type ‘bridge’
option proto ‘static’
option ipaddr ‘192.168.0.110’
option netmask ‘255.255.255.0’
config interface ‘wwan’
option proto dhcp
Connect to carambola
Enable connection from ssh
Install necessary packages
opkg install mjpg-streamer
opkg install io
opkg install ser2net
opkg install http://pkg.8devices.com/v2.2/carambola/packages/gpioctl_1.0-1_ramips.ipk
io 0x10000060 0x15
root@OpenWrt:/# cat /etc/inittab
::sysinit:/etc/init.d/rcS S boot
::shutdown:/etc/init.d/rcS K shutdown
#ttyS0::askfirst:/bin/ash –login #<————- comment this line to disable console on ttyS0
config mjpg-streamer core
option device “/dev/video0″
option resolution “400×200″
option fps “25”
option port “8080”
option enabled “true”
Video streaming test
Run from computer (browser or vlc) – you should see video or picture, depending on URL you picked.
Start on boot
Start mjpg-streamer right now
Motor controller setup
I am not really sure what settings I am using (setup was trial and error method). In general you should:
- Enable security timeout for serial comunications (if there are no data more than 0.2s motors will stop)
- Set baud 115200 baud rate with jumpers
- Set acceleration / deceleration and other parameters as you like (chose best settings for your platform)
- More details can be fond here
There are lots of things I stil don’t know about Android. I have been toying with it for a week. This is also my first encounter with coding java. There are key notes about this software.
- Application has no UI customization properties. It just hopes that rover will respond on 192.168.0.110 ip address.
- Program is configured for fixed LCD resolution (1024×768)
- It displays video stream of 200px wide (for better video perfomance)
- To drive forward touch upper LCD part (the higher, the faster). To drive backwards do the opposite.
- To turn, lean tablet or phone left or right.
- Manoeuvrability becomes less responsive the faster you go.
- Exit must be performed hard way – by killing it from task manager.
Android application (and sources) can be found on githuib. (it is derived from some mjpeg streaming software, so beware – name is still the same). Also I should credit authors, but unfortunately I don’t remember where I got this example.
Some ideas for future
- Bigger/faster motors (which ones)
- Wider front camera lens (to be able to see wheels)
- Custom panoramic lens for second camera
- Custom controller
- Integrated charger
- New protocol with discovery
- Current/voltage monitoring
- Head lamps with control
- Arduino for custom functions?
- Switch (debug port) selectable wifi AP/STA mode
- Camera up/down control
- Autonomic navigation?
- Kinect terain mapping
- Video keeps refocusing. In low light it is confusing. There is utility called uvcdynctrl to control camera parameters. At this moment it is unclear how shoult I port it to Carambola, but it should do the trick.