element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi Projects
  • Products
  • Raspberry Pi
  • Raspberry Pi Projects
  • More
  • Cancel
Raspberry Pi Projects
Blog Building an XMOS and Raspberry Pi Robot XMP-2
  • Blog
  • Documents
  • Events
  • Polls
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Raspberry Pi Projects requires membership for participation - click to join
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: shabaz
  • Date Created: 9 Mar 2015 10:16 PM Date Created
  • Views 3214 views
  • Likes 11 likes
  • Comments 17 comments
  • startkit
  • raspberry
  • infineon
  • xmos_startkit
  • rpiintermediate
  • industrial
  • robotics
  • robot
  • robotwheelsch
  • raspberry-pi
  • raspberrypi
  • automotive
  • raspberry_pi_projects
  • xcore
  • dcmotorcontrbtn8982tobo1
  • xmos
Related
Recommended

Building an XMOS and Raspberry Pi Robot XMP-2

shabaz
shabaz
9 Mar 2015
image

Robots with Wheels

Enter Your Electronics & Design Project for Your Chance to Win a $100 Shopping Cart!

Back to The Project14 homepage image

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):

image

 

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.

image

 

Circuit Overview

The diagram below shows the main components used; click to enlarge.

image

 

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).

image

 

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

image

Assembling the block: The motor can be seen inserted at the right

image

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

image

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

image

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.

image

 

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

image

Motor/Gearbox Block: Poor diagram but it gets the point across hopefully; dimensions from the rear of the block

image

Motor/Gearbox Block: View from side

image

Motor/Gearbox Block Assembly: How the bits fit together

image

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.

image

 

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:

image

 

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

image

Front View: Laser powered up

image

Front View Closeup: Stormtrooper keeping watch

image

Rear View: The XMOS startKIT can be seen here. It has a 3x3 matrix of LEDs which could be used for status/notifications

image

Side View: 'Micromouse' style wheels were used

image

Front View: Headlights lit up!

The XMOS board can be seen close-up below:

image

 

The Raspberry Pi can be seen installed in the photo below:

image

 

Another photo of the power supply board:

image

 

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!

image

 

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).

image

 

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.

image

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.

image

 

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):

image

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:

image

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.

image

 

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!

 

image

  • Sign in to reply

Top Comments

  • Problemchild
    Problemchild over 10 years ago in reply to Problemchild +4
    I really like the use of the Aluminum extrusion for the mainbody frame it seems to have given it a good square shape with out too much bother. What fixings did you use and what extrusion I think I will…
  • Problemchild
    Problemchild over 10 years ago +3
    How many pins does it take to control the infinion motor control from the XMOS device and how easy is it to use other boards such as the BBB and Odroid C1 as main processing boards and still communicate…
  • shabaz
    shabaz over 10 years ago in reply to Problemchild +3
    The aluminium really helped to create the rigid frame! It was purchased from e-bay, I *think* it is 20mm but I'm waiting for the robot to arrive back and then I can measure it! Plastic extrusion could…
  • shabaz
    shabaz over 9 years ago

    Updated - Added a Laser Ranging section!

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • shabaz
    shabaz over 9 years ago

    Updated - Added a Detail Photos section.

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Problemchild
    Problemchild over 10 years ago in reply to shabaz

    I would suspect 12.5mm but obviously the Rubber is designed to accommodate and give to allow for awkward cables. A real nice way of doing it Mark!

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • shabaz
    shabaz over 10 years ago in reply to mcb1

    Hi Mark,

     

    That is an excellent idea. There is plenty of room on the rear, so a rubber compression seal and a flat plate with a hole for the laser enclosure to pass through (and two holes for bolts to secure to the chassis) would work extremely well. Thank you for this idea!!! I am sure I can find a suitable sized rubber seal somewhere (the laser is 12mm diameter) - I might inspect the inside of one of those compression glands if I have one of the right size. Anyway I have some rubber sheet I could cut if needed.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • shabaz
    shabaz over 10 years ago in reply to Problemchild

    There are so many RPI robots out there, it's probably hard to be the first with anything : )

    But maybe it is the first one attached to the Dark Side, in preparation for Star Wars 7 : )

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube