web analytics

Servo Widgets

Wireless Servo Widgets are small, postage stamp sized wireless transceivers based on the Pololu Wixel. The servo widget software allows you to use one Wixel as a master to control up to 64 slave Wixels. Each slave wixel can control up to 6 standard R/C servos and also read three analog inputs which are returned to the master. Here is a basic diagram:

widgets

This design uses the addressable packet mode found in the radio modem chip used on the Wixel. (Study the data sheet if you want more info on this, it’s a pretty neat feature of this chip). This mode is not directly supported in the wixel SDK provided by Pololu so I’ve had to modify some of the libraries and include files to make this work. But for the most part I’ve used the stock Pololu radio and servo libraries and tried to stay minimalistic with any changes.

In this mode there is an address byte in the Special Function Registers that you can set to anything between 0 and 255 to uniquely identify each Wixel. In this implementation I have dedicated address 254 (0xfe) to be the master, and then used addresses 0-63 for the individual slaves. There are several modes available including setting address 0 and 255 to broadcast, you can research this in the data sheet if you are interested.

This mode removes all of the software overhead from examining packets to see if they came from a specific wixel or if the packet is intended for a specific destination. Any packet that does not match the destination address is discarded by the h/w in the radio modem. Only valid packets, with good CRCs and the proper address are accepted by the chip, which then informs the software that a packet has come in. This makes the s/w rather simple, and even better, fast.

The master connects to the host computer via USB. A python class is used to communicate with the master and provide the API to set the position of each servo and read the 3 analog input values. I’ve included it in the download, it assumes you are running a Raspberry Pi as the controller. It’s also available on this site under software if you want to have a look.

Each of the slaves and master have both a radio channel and an address. The master and all slaves that it controls must have the same radio channel. On that channel, the master is set to address 254 and the slaves are set starting at address 0. If slaves are set to the same address, they will mimic each other. Generally however, the first slave is set to zero, the second to 1, etc. Note that the limit of 64 slaves is only because of limitation in the master to have static tables (transmit and receive) of 64 slaves with 16 bytes each. You could possibly adjust this to send and receive less bytes, but that would be a code change, it’s not configurable. I would think 64 slaves is more than enough for any application, that works out to 384 servos!

While the master will control up to 64 slaves, the more slaves you add, the slower the update. Thus a parameter is available on the master to allow you to specify how many slaves are used. Slaves are expected to be numbered in order starting from 0. The algorithm in the master is very simple, it starts a scan at address zero by sending the servo data to that slave. If the slave responds, it uses the data returned to populate the analog input table and quickly moves to the next slave. If the slave does not respond, the master waits a timeout (several ms) for a response and then moves on to the next slave. A very simple low overhead protocol. Just round robin forever.

For a complete application using the Raspberry Pi as a web controller sourcing an HTML5 user interface with web sockets to communicate with the master Wixel, take a look at the software page on this site.

Master Widget Slave Widget
master slaveback

Note that the download is a complete zip of the Pololu wixel SDK with the apps directory stripped down to just my master and slave apps. The executables are in there, you can use them as is, but it’s up to you to rebuild everything if you want to make code changes.

Master and Slave Widget Software
Widget Software FREE
DOWNLOAD

The software is free but if you do find it useful and would like to contribute to the development of more open source widgets, I would certainly appreciate a contribution. Thanks.

Contribute

Slave Widget Breakout Board
Also available is a breakout board. This allows you to solder your Wixel to a small board that provides standard R/C connector access to the servo and analog inputs.
breakout Wixel Breakout $3
**IN STOCK**