Swarm Bot
Back to Pete's Robo-Page

 

Swarm Bot

Test platform for Burning Man Project.

Combine basic functional elements into structured system.

First used with R/C to proto-type rolling ball drive and steering system.
Now being used as platform to test modular sensor/control system.


By breaking up the mechanical functions, I came up with this Org Chart :

So I decided to build a set of modular blocks that would relieve me of dealing with sensors, so I could concentrate on behavior. The robot could concentrate on higher level issues, and not sensor A2D and 20ms interupt timing. The individual modules would take care of the hardware tasks, and present a hi-level interface via the I2c bus to the CPU. The higher level controller can send commands to this module like: Accelerate Smoothly to 5mph and maintain the current heading, or Turn Left 90 degrees. Or Goto Lat/Lon 36.345/103.554 at 4mph, then look for other Orbs. The low level module takes care of the mechanics of those commands, and deals with the electrical motors and analogue sensors.

The first block combines all the mechanics of motion control for the Loco Block:

• Set Speed : Forward 100% <-> Stop <-> Reverse 100%

• Steer: 100% Left <-> Straight <-> 100%Right

• Odometry : Track Actual wheel motion using Quad decoders.

Module 1 combines:

an IMU to track the tilt of the inner pendulum and platform,
a Quad Wheel Encoder to track orb rotation and speed,
a PWM speed controller conected to an H-Bride motor control.
a 1.5ms Servo Pulse train to control an R/C servo for steering.
an I2c interface so the unit can be used as a digital slave to higher systems.


The Locomotion Module uses a PIC16F877A, a uM FPU, a Spark Fun 5DOF IMU, and has both 5volt and 3.3volt regulated supplies.

 


Here's the module mounted on the Hamster Ball Chassis with the speed control and Quad Wheel Encoders.

This is the H-Bridge / Speed Control module. It's feed a 1.25Khz PWM signal to control the speed and direction of the motor. The software uses a ramp function to smoothly change speeds.

This is the Quad Encoder board. It's got 2 IR reflective sensors (the little black squares) mounted 90 degrees to each other to read the black and white encoder wheel. (see below)

Here's the Encoder wheel mounted on the drive shaft, and the sensor board mounted on the chassis. The wheel spins with the ball, and the sensors stay still and count the revolutions. The wheel has 30 segments, so the Quad system gives me 60 'clicks' per revolution.

Note: I've since switched to a wheel with only 18 segments, 36 clicks per rev, 'cause the distance between sensor and wheel was too critical with the smaller segments. Now it's much more robust & less prone to drop-outs.

Now I've added a MiRF transceiver system, so I can send commands to the Loco-module and start testing the Orb and it's systems.

I added a PIC16F88 to interface between the MiRF unit, and to act as the Master Controller for the Orb. All it really does is pass commands from the Orb Transmitter to the Loco module via I2c - It works great.

Here's the Transmitter unit I built for testing. It's a PIC 16F876 28 pin MPU sitting on a Olimex dev board along with the MiRF Transceiver and antenna. The box houses the serial LCD, a 10K pot, and 5 push switches.

The transmitter is very versatile, I can set up the buttons to send any kind of commands. I use the pot to send various values to PID functions while tuning.

I added a Spark Fun Data Logger so I could record the status of the IMUs, track data, and make cool charts like the one below, while the Orb is in motion. Works great. Attached to the hardware UART port of the Loco-module, spits out serial debug data, saved to ASCII TEXT files on the little SD data card. Too cool.

 

 


 

 

Orb-Eye


Source Code:

Transmitter Module:

Handles button de-bounce, reading pot, setting up MiRF unit to be Txmitter, sends commands.

Orb_Transmitter.pbp
MiRF.inc

 

MiRF Receiver / I2c Master:

Handle interface with MiRF unit. Receive commands from Tx, sends commands down to Loco Module via I2c

Orb_Rx_v1.pbp
MiRF.inc

 

Loco Module I2c Slave:

Creates 1.5ms pulse for steering servo every 20ms.
Creates 1.25 khz PWM signal for Speed Controller.
Tracks Quadrature Encoder Sensors for Orb Speed Rotation at 1.25khz sample rate.
Samples IMU measurement unit every 20ms. (5 sensors)
Integrate Gyro & Accel measurements into Swing Angle & Steering Tilt data.
Process commands comming down I2c bus so module becomes controllable slave.

LocoMotion_v12.pbp
I2c_Slave_Asm.inc

 


Back to Pete's Robo-Page