Enter Your Electronics & Design Project for Your Chance to Win a $100 Shopping Cart! | Project14 Home | |
Monthly Themes | ||
Monthly Theme Poll |
Note: XMP-2 also has a virtual simulation, check it out by clicking here.
Introduction
The ground-breaking XMOS startKITXMOS startKIT is an ultra-low cost near-credit-card sized board designed for real time operations. It was launched about a year ago at a very low cost (£12 including VAT) as a processor board intended to connect to the Raspberry Pi and XMOS went on to distribute thousands of startKITs for free.
Together with the Raspberry Pi one of the boards was used to create a robot called XMP (XMOS Mobile Platform). Version 1 of the robot was quite primitive and really just a proof-of-concept type of project.
The brand new XMP-2 robot was made possible thanks to another startKIT from john_xmos at XMOS and a Raspberry Pi courtesy of doctorcdf at Element14. Here it is at the Element14 stand at Embedded World 2015 in Germany, manned by an Imperial Stormtrooper (click here to see a video of it in motion – 1:40 into the video):
XMP-2 is not complete yet (it is a 1-month old baby yet has already turned to the dark side) and is currently missing sensors and will eventually have a custom PCB too. Distance measurement will be based on a camera and laser arrangement.
It was built in a few evenings due to needing to be shipped to Germany quickly. It relies heavily on Lego for the electronics attachments. However the chassis, wheels, ball rollers and axles are constructed from aluminium and steel for a rigid and reusable base for experiments.
Circuit Overview
The diagram below shows the main components used; click to enlarge.
XMP-1 relied on continuous rotation hobby servos which are fairly inaccurate. XMP-2 uses brushed DC motors and Infineon H-bridges to power them. All motor control occurs using the XMOS xCORE processor. For closed loop feedback encoders are used. These are connected to the XMOS board so that the xCORE processor can count pulses (tens of thousands of pulses per second - around 60k pulses per wheel revolution in this design) as the motor turns, calculate appropriate pulse width modulation (PWM) which then drives the motors through the Infineon H-bridgesInfineon H-bridges. The closed loop feedback means that the robot can make movements with accuracy and allows for motion even at slow speeds where open-loop PWM in ineffective as soon as the motor encounters a load. For more detail on closed-loop PWM and control of brushed motors, check out this post which used a BeagleBone Black for controlling motors. To get a basic understanding of different motor types click here. There is also a post on the Infineon DC motor control H-bridge boards which were used.
Click here for a video showing a practice run of just the motor control portion (before the robot was complete).
XMP-1 required two power sources. This time round a single battery source (initially non-rechargeable batteries) is used to power everything. To further simplify things, a custom PCB will be created at some point to replace the mass of wires and also provide a rechargeable battery solution.
The entire robot (including motors, XMOS board and Raspberry Pi) is powered using six AAA batteries.
The XMOS board was used to control the motors while relying on feedback from the encoders. Another aim is to eventually implement a vision system to be able to navigate around objects autonomously.
Mechanical Overview
A classic differentially steered design was created with two wheels that are driven by the motors and the speed and motor direction can be controlled. The third wheel (unpowered) was actually a ‘ball transfer unit’ (from Alwayse Engineering, model 7101) which is a bit like an old computer mouse ball but usually operated in the inverted position for conveyer type systems. Another ball transfer unit was used for stability and becomes the fourth wheel.
The motor unit has built-in gearing and a built-in encoder – it is available new from Faulhaber (Series 1524..SR) and is also available in used/repaired condition via eBay from several sellers. It is further geared down using a gear from motionco – primarily to decouple the motor unit from the output shaft for reliability but also to reduce the motor speed and increase the torque. Everything is held together using a motor/gear assembly block made from plastic. To build something similar schools/colleges may have a machine shop or a 3D printer and accurate drill press could be used (sub-millimeter accuracy is needed to mesh the gears properly). Don’t forget to wear eye protection.
The slide show below shows the motor/gear assembly block construction and how it was fitted to the chassis. The wheel shaft and bearings were from motionco too. It was decided to have a 4mm diameter output shaft to the wheels. The chassis is built using aluminium extrusions (available from eBay) with rounded edges – far safer than the XMP-1 design.
{gallery:autoplay=false} Motor/Gear Assembly Block Construction |
---|
Assembling the block: The motor can be seen inserted at the right |
Mounting the motor: The motor fits into a part-bored hole and is secured with two small bolts. There is a small recess for fitting a bearing for the axle |
Attachment to chassis: The center hole shown here is bored to two diameters, one for passing the axle through, and the larger diameter is for fitting another bearing |
Axle and Gear: The gear is glued to the shaft |
The photo below shows the assembled chassis with the motor/gearbox blocks mounted, a ball transfer unit and lenseslenses and laser.
Engineering Drawings
If you’re building a replica and intend to closely follow the design, then the slideshow below contains the detail on how to construct the motor/gearbox mount and chassis:
{gallery:autoplay=false} Engineering Drawings |
---|
Motor/Gearbox Block: Poor diagram but it gets the point across hopefully; dimensions from the rear of the block |
Motor/Gearbox Block: View from side |
Motor/Gearbox Block Assembly: How the bits fit together |
Assembly: This photo shows how the motor/gearbox block, axle and chassis fit together |
Lego Integration
Lego was instrumental to mounting most of the electronics. It allowed the design to be implemented quicker without needing to worry upfront where precisely all the boards would be mounted. The photo below shows how the XMOS startKIT was mounted. Two white 4x1 blocks were drilled and screws were used to secure the XMOS board to them. In the photo below, the stripboard on the left contains all the power supply circuitry.
The stripboard and the Infineon boards were also mounted using Lego; they were glued into notches cut in Lego as shown in the photo below:
Putting it all Together
The slideshow below shows what the robot looks like from various angles (laser and headlights powered up in some of the photos):
{gallery:autoplay=false} XMP-2 |
---|
Front View: Laser powered up |
Front View Closeup: Stormtrooper keeping watch |
Rear View: The XMOS startKIT can be seen here. It has a 3x3 matrix of LEDs which could be used for status/notifications |
Side View: 'Micromouse' style wheels were used |
Front View: Headlights lit up! |
The XMOS board can be seen close-up below:
The Raspberry Pi can be seen installed in the photo below:
Another photo of the power supply board:
Schematics and Source Code
There really isn’t a lot to the schematic currently that cannot be deciphered from the circuit overview shown earlier in this post. As soon as a schematic is created, it will be published here. Meanwhile, for any technical questions regarding the circuit, please ask in the comments section below. No schematic was created because of the very rapid prototyping that occurred for this project (any parts used were just thrown onto the stripboard!).
The source code will be published once tidied up (this might not happen for a while – please ask if you need the raw code, I’ll be happy to share it). A similar scheme was followed as for XMP-1, where the Raspberry Pi implements a web server and the XMOS board implements all motor control.
There is a three-part guide to the XMOS startKIT that hopefully helps understand how to use it. Part 1 is a general guide to the startKIT for newcomers. Part 2 covers the serial peripheral interface (SPI) communication between the Raspberry Pi and startKIT. Part 3 provides another SPI example amongst other things.
Update January 2016 - Detail Photos
Here are some more photos of the circuitry. A DC-DC converter DC-DC converter was used to provide 5V for the processor boards. It is the box-shaped component in the photos. A small 3.3V LDO regulator3.3V LDO regulator was used to power some logic gates for the rotary encoders. The power switch can also be seen soldered onto the stripboard above the DC-DC converter. Red dot indicates powered on position!
Another view. A few electrolytic capacitors are used as recommended by the DC-DC converter and LDO datasheets. A few ceramic caps are on the underside (not shown).
The wiring may look messy but it was mostly color-co-ordinated and easy to follow. Notice the XMOS StartKit has had header pins soldered on the rear of the PCB, not the front side, for ease of assembly (and I wanted the LED array on the XMOS StartKit to face the other side).
The red Infineon boards can be seen glued into notches cut in the white Lego pieces. The StartKit was bolted using holes drilled in Lego, so it is easily removable.
Side view. The large electrolytic capacitor that is present on the Infineon boards by default was reduced in value due to the low current requirement of the motors that were used.
Laser Ranging
The photos below show the principle that could be used for laser ranging.
The first photo here shows the default view against an example (cardboard) wall. The laser beams a line pattern (it has a special lens to do this):
This next photo shows what occurs when a Stormtrooper is positioned between the laser and the wall. Notice the horizontal laser projected line has been cut, and is reflecting off the Stormtrooper:
From the height difference between the horizontal line off the background wall and the reflected line off the Stormtrooper, it is possible to deduce that an obstacle (the stormtrooper) exists, and the deduction can be done with very little image processing needed.
What’s Next?
XMP-3 will be next. It will reuse the same base as XMP-2, but will have increased functionality – primarily a robot arm – and will use a PCB to replace the stripboard (and will therefore have a schematic).
Summary
XMP-2 is a completely new robot, very different from the XMP-1 prototype. It has fairly accurate motion thanks to closed loop control and is therefore a suitable platform for attaching sensors and vision. The XMOS startKIT was key to monitoring thousands of pulses per second from both motors and using them to control the motor motion. The Infineon H-bridges, although overkill for this particular robot, were selected so that the robot could be scaled to larger sizes easily without needing many schematic modifications.
The base will serve as a suitable platform for XMP-3 - stay tuned!
Top Comments