20 January 2012

PS3 joystick progress report

Hooking up the PS3 Joystick and getting some meaningful results on the screen was a lot easier than expected.  I purchased a small USB Bluetooth dongle which worked with Ubuntu straight away, and hooking up the software to display the output from the joystick was easy.

Developing a ROS node to convert that output into ROS command messages was also very easy following the tutorial on ros.org; as was my first go at getting a ros launch file setup.  Getting the joystick connected requires root privileges and I haven't worked out how to do that bit from within the launch file yet.

My PC (running ROS on Ubuntu) talks to the robot hardware via an Arduino Mega over a USB serial data link.  Before switching to ROS I had developed my own serial protocol but lately I have been using the rosserial library which makes writing the Arduino end and the PC end pretty simple.  Using this system I was easily able to have the PS3 joystick remotely control the speed and direction of each drive wheel, and the pan and tilt of the head.


The only issue I currently have is that the serial connection keeps on dropping out, and that appears to be a result of the serial link getting swamped with too much data.  I have a ROS throttle node running on the PC to limit the rate at which messages are sent to the Arduino but I still haven't got this running properly.  More investigation is required.  I'll try slowing everything down further, and changing the baud rate. My main worry is that I have so far only implemented a small proportion of the features my Arduino will be handling, so have a lot more data I need to send.

I may need to delve into the rosserial messaging system and see how compact the serial data is - perhaps I'll need to modify the protocol.  This is one of the big advantages of ROS over MRDS which I trialled earlier - the system is open-source, so while my C++ and Python skills are pretty basic I can at least look at the source code and potentially modify it.

18 January 2012

A look at Ernie

As promised last year I have taken an up-to-date photo of Ernie, and I'll provide a brief description of his main features.  In this photo Ernie's panels have been removed so you can see inside.






Ernie is a large robot for a hobby robot.  He is about 0.5m x 0.5m and about 1m tall.  As I said in an earlier post he is heavily influenced by Dave Shinsel's Loki robot.  I guess he would be a similar size to Loki and to the Astromec droids built by members of the R2D2 builders club.

The size of the base is largely determined by the size of the drivewheels (0.3m diameter) and the drivetrain.  Ernie is driven by old cordless drill motors with a chain drive.  The chains are off-the-shelf from minature motorcycles and rather than try and shorten them they are used as-is.  The wheels and chain are under the side "fenders" to protect anyone coming in contact with the chain.  The motors mounted at the rear about halfway up.

The height of the robot is largely determined by the desire to eventually mount arms similar to Loki at the top of the body, and then the height of the head.

The head is a temporary one (made from an old icecream container) with DFRobot LED rings for eyes and an LED VU meter as a mouth (plugged into PC soundcard output).  The mouth works but I don't have the progamming sorted for the eyes yet.  The head is mounted on two servo motors so it can pan and tilt.  The hat was added by one of my sons and I think I'll keep it.

Working down from the head you can see the emergency stop button at the rear of the top panel.  This switch cuts all power to the motors and I consider this essential for a robot of this size and weight.  Ernie currently weighs about 20kg and he doesn't yet have arms.


Just below the top of the robot at the front is a LED matrix I built.  This matrix is 24 x 8 pixels with red and green colours and displays a pattern sent serially from the Arduino.  I haven't got this working again since shifting to ROS - only because I haven't got around to it, but I'm now wondering if this display should have it's own Arduino communicating via I2C with the main micro, or by USB directly with the PC given the amount of data I want to shift and the limits of the rosserial comms (more on that in a later post).

Moving on down there are some PC speakers in the middle of the body.  On the rear shelf you may be able to see the two Robot Power Simple H motor drivers (with fans) that drive the motors with commands coming from the Arduino.


The main shelf has the Arduino Mega mounted in the centre and some data distribution boards I made.  Those boards have 16-way IDC ribbon cables running from near the Arduino to four similar boards elsewhere on the robot.  Each one then breaks out the data lines to headers that can be jumpered to the relevant pin on the Arduino and connected to sensors or actuators at the other end.

Below the main shelf is the PC in a small case.  The blank space below that has the main axle running through it and I plan to mount the Power Management board in that space with charging contacts and also a line-follower.

I have a number of ultrasonic distance measuring sensors distributed around the front and some simple bumpers.

What you can't see are the quadurature encoders driven by small wheels in contact with the chain, some simple infrared presence detectors as "bumpers" at the rear, and the batteries.  I have two fairly large 12v SLA batteries sitting behind the main axle.  On the back I have a panel with a number of switches and sockets for external power and charging.  Once the power management board is in that panel should get simplified significantly.

After working on this robot for about two years now I'd change some things if I was rebuilding.  Firstly I'd like to cut down the weight.  At 20kg this robot is difficult to lift on and off the workbench but more importantly it can be quite dangerous moving around people.  I'd also try and make it more compact, probably by using slightly smaller wheels and a more compact drive system.  Perhaps a couple of wheelchair motors with wheels rather than my current golf-trundler wheels and chain drive.




09 January 2012

Ernie's Christmas

Christmas was kind to Ernie.

He received a new mini-box M3 power supply, a mini-box Y-PWR adapter, and a Playstation PS3 controller.

The M3 power supply is for his on-board PC and is a small unit that fits entirely within the small PC case so less room is required within the body.  It also allows the original case lid to be put back on instead of a custom-made one.  The M3 power supply is superior to the previous 12v ATX power supply I was using as it generates a proper 12v supply rail, even when the battery supply voltage is below 12v.  The CPU is now running significantly cooler - probably due to the perforated case lid, but possibly also due to the cleaner and more accurate voltage supply.

The Y-PWR board is a simple ideal diode that can allow practically instant switching from the battery supply to the external supply for the PC power supply - this is the sort of "switch" that is used in a UPS so that the power can be switched without interupting the operation of the PC.  This will be integrated into a new power-management system I am designing that will look after the charging of the two SLA (sealed-lead-acid) batteries in Ernie as well as monitoring battery voltages and switching various circuit groups on and off.

The PS3 controller is wireless via Bluetooth and with the addition of a small USB Bluetooth dongle Ernie should be able to be remotely controlled.  This will be useful when transporting Ernie, or demonstrating him and using him as an entertainment robot - part of his intended function.  There is a ROS package for the controller and patching it into the ROS system on Ernie is apparently fairly simple.