-
Notifications
You must be signed in to change notification settings - Fork 1
Dome Drive RoboClaw
The RoboClaw encoder drive gives you full closed-loop dome control. The dome always knows where it is, can go to a specific angle on command, and will wander randomly between configurable limits. It is highly recommended that you use a dome gear with this setup, as a friction drive can slip and will cause offsets to the homing.
- Pololu encoder gearmotor (mounted to dome)
- BasicMicro RoboClaw motor controller
- Hall-effect sensor (mounted to the body, triggered by a magnet on the dome)
The hall sensor establishes position zero (home). All position tracking is encoder-derived after that.
The recommended motor for this is the 19:1 Metal Gearmotor 37Dx68L mm 24V with 64 CPR Encoder. There is also a 12 volt version.
There are multiple RoboClaw motor controller variants, and all of them should work similarly. The 2x7 amp controller is the least expensive, has enough amperage overhead and works great. You just end up using only one of the two motor channels. You can also go with the Solo 30A, but it's way overkill for this purpose.
The hall sensor is tiny and inexpensive. The recommended option is the Adafruit US5881LUA. Note: this will require soldering wires to the 3 pins so they can be connected to Digital 2 on the Amidala board. These are 5V sensors, and while they are rated for 3.7v, they do work fine at 3.3v.
All you need to do is put a strong enough magnet to trigger the sensor somewhere on your dome bearing, and then place the hall sensor where you are comfortable. You can configure the offset position from the front of the dome in the settings.
Connect the RoboClaw to the Amidala PCB via Serial 1 (GPIO17 TX / GPIO18 RX) at 38400 baud.
In the web UI under Dome Drive Configuration, set:
| Setting | Description |
|---|---|
| RoboClaw Address | Packet-serial address (default 128) |
| Motor Channel | M1 or M2 — whichever channel your dome motor is wired to |
| QPPS | Encoder pulses per second at full motor speed. Tune this in BasicMicro's Motion Studio. |
The hall sensor plugs into the Digital 2 header (GPIO40). It fires when a magnet on the dome rim passes it, telling the firmware where position zero is.
Mount the magnet so it triggers the sensor when the dome is at your desired "front" position, or set Front Offset in the Dome Drive Configuration page to compensate for a physical offset.
Calibration only needs to be done once per mechanical assembly. The result is saved to EEPROM.
-
Home the dome — send
dome=homefrom the serial console, or tap the Home button in the Droid Control page. The dome will slowly rotate until the hall sensor fires. Once found, position is set to zero. -
Run calibration — send
dome=calibrate. The dome makes 10 full revolutions while counting encoder ticks. The computed ticks-per-revolution ratio is saved automatically.
After calibration, all autonomous modes (random wander, absolute positioning) are available.
If your magnet isn't exactly at the dome's front, use the Front Offset setting (0–359°) to shift what the firmware considers "front." The dome will go to Front Offset degrees when you command dome=front.
On every boot, the dome is in Manual state — the joystick works but no auto modes are available until the dome homes itself.
If Auto-Home on Boot is enabled in the Dome Drive Configuration, the dome will automatically run the homing sweep at startup. Otherwise, trigger homing manually via the Droid Control page or a button action.
Default state after boot (before homing). Joystick control only.
The dome picks random angles within configurable left/right bounds and moves to them with short pauses in between. Toggle via button action, the dome=rand command, or the Droid Control page.
The dome joystick angle maps directly to a dome heading — push the stick left 45° and the dome goes to 45° left of front. Release the stick and the dome holds position. Toggle via a button action configured with the Alt modifier.
If the dome stops moving for longer than the configured stall timeout while a move is in progress, the motor is cut and the dome enters Obstructed state. Moving the joystick manually clears the obstruction and returns to Manual state.
These are set via the Dome Drive Configuration page in the web UI.
| Setting | Description |
|---|---|
| Front Offset | Degrees from the hall sensor to the dome's actual front (0–359) |
| Stall Timeout | Milliseconds of no movement before obstruction is declared |
| Decel Zone | Degrees before target where deceleration begins (5–90°) |
| Fudge | Dead zone around target in degrees; prevents hunting |
| Homing Speed | Motor speed during the homing sweep (1–100) |
| Seek Speed | Motor speed during random seek moves (1–100) |
| Min Speed | Minimum speed during deceleration approach (0–30) |