Motor setup WIP
Set up an AIM-series motor (57AIM, 60AIM) for an OpenValence build from your browser. The page finds the motor at one of four baud rates and at any address from 1 to 247, reads its registers, and writes the preset.
On a barnacle build (a P4 Stamp on the OSSM R+D board) the firmware has no RS485 link to the motor, so set the motor up here before you build. The main job is the input mode: the firmware sends A/B quadrature, and a motor left on another mode will not follow it.
Work in progress. Every write here follows a sequence proven on the bench from the command line; this page has not yet been tested against a motor.
What you need
- Chrome or Edge on a desktop computer. The page uses Web Serial; Firefox, Safari and phones have none.
- A USB to RS485 adapter with A, B and GND terminals.
- The motor on its power supply. Its logic runs from that supply: nothing answers until it has had power for about a second.
- The motor free to move: belt off, or the carriage clear of both ends. A change of input mode or gains can move it.
Wiring
The motor's RS485 side is opto-isolated and takes its own 5 V from the communication connector. Connect four wires from that connector:
- 485A to the adapter's A (sometimes D+).
- 485B to the adapter's B (sometimes D-).
- COM to the adapter's GND.
- 485_5V to 5 V: the adapter's 5 V terminal if it has one, or any 5 V supply sharing that GND.
The motor's manual has the pin numbers. Adapters label A and B both ways: if nothing answers at any rate, swap them.
Find the motor
Pick the adapter's port. The page tries address 1 at 19200 (the factory rate), 115200, 38400 and 9600 baud, 8 data bits, no parity, 1 stop bit. If nothing answers, it tries addresses 2 to 247 at each rate, which takes about a minute. A reply with a valid CRC to a read of register 0x15, the motor's own address, identifies it.
Settings
The page reads every register in the motor's map, one at a time. Register pairs are 32-bit, low word first. The map has no model or firmware register.
| Reg | Name | Raw | Meaning |
|---|
Release Modbus control writes 0x00 = 506, then 0x00 = 0: the only way out once 0x00 is on.
Baud rate
Optional, and before the preset if you do it. The barnacle build never talks to the motor over RS485. Nucleus on the Flagship finds the motor at any of the four rates; 115200 gives the fastest reads.
The change is a four-write sequence the motor stores and switches to at its next power cycle: 0x00 = 1, 0x03 = 803, 0x04 = 129, 0x00 = 506. The page then has nothing to check until you power-cycle the motor.
OpenValence preset
What the firmware's A/B output needs: input mode 0x19 = 2 (A/B quadrature), position loop gain 0x07 even (alarm output normally open; your gain is kept, an odd ones digit becomes 0), output on (0x01 not 0) and Modbus control off (0x00 = 0). It also writes gear 4/1 (0x0A, 0x0B): 8192 counts per motor turn, the scale the firmware's 208.6 steps per millimeter assumes, so any other ratio moves the carriage the wrong distance. Only registers that differ are written.
| Reg | Name | Now | New | Why |
|---|
Find the motor first.
The write order: Modbus control on (0x00 = 1), output off (0x01 = 0; the motor refuses writes with its output live), then three passes of each register and the save command (0x14 = 1), the first pass with a read-back check, then output on (0x01 = 1). Modbus control stays on until you power-cycle the motor; the power cycle turns it off. If any read-back fails, the page stops, puts the output back and releases Modbus control. The page refuses to start while the motor turns.
Power cycle and check
The motor reads its input mode only at power-on, and a save is proven only by a power cycle. Switch the motor supply off, wait five seconds, switch it on, wait two seconds, then check. Leave the adapter plugged in.
The check finds the motor again (the last rate first), reads every register and runs the check the Flagship firmware runs on the motor. Ready means every line passes and the preset held through the power cycle.
Log
Every frame sent and received, in hex, with the time since the page loaded. During the address scan only replies are kept. Paste it into a support request.