Elmo Motor Controller¶
The CPF buoyancy engine uses an Elmo Twitter servo drive to control the hydraulic pump motor. The firmware communicates with it over COM2 at 115200 baud, 8N1 (power channel 2). All commands are ASCII strings terminated with a semicolon.
The ElmoTwitter class in libHWModules/ElmoTwitter.cs wraps all Elmo communication.
Command Sequences¶
Initialization¶
Called once by BuoyancyEngine on startup via initPumpMotor() → ElmoTwitter.init().
| Step | Command | Description |
|---|---|---|
| 1 | ST; |
Stop any motion in progress |
| 2 | EO=0; |
Disable echo |
| 3 | SN; |
Read serial number (logged) |
| 4 | AC[1]=1e9; |
Set acceleration limit |
| 5 | DC=1e9; |
Set deceleration limit |
| 6 | CL[1]=4.76; |
Set continuous current limit (A) |
| 7 | PL[1]=13.5; |
Set peak current limit (A) |
| 8 | PL[2]=2; |
Set peak current duration limit |
| 9 | VX; |
Read velocity (logged) |
| 10 | ID; |
Read active current (logged) |
| 11 | IQ; |
Read reactive current (logged) |
| 12 | SR; |
Read status register (logged) |
| 13 | CL[1]; |
Read back current limit (logged) |
| 14 | PL[1]; |
Read back peak limit 1 (logged) |
| 15 | PL[2]; |
Read back peak limit 2 (logged) |
| 16 | AC; |
Read back acceleration (logged) |
| 17 | DC; |
Read back deceleration (logged) |
Run Motor (sendJV)¶
Called by BuoyancyEngine.increaseBuoyancy() and decreaseBuoyancy(). The jog velocity (JV) is signed: positive extends the bellows (increases buoyancy), negative retracts them.
| Step | Command | Description |
|---|---|---|
| 1 | MO=1; |
Enable motor |
| 2 | JV=<value>; |
Set jog velocity (counts/sec) |
| 3 | BG; |
Begin motion |
Typical operational range is ±200,000 counts/sec. The configured limits are set during initialization.
Stop Motor (stopMotor)¶
| Step | Command | Description |
|---|---|---|
| 1 | MO=1; |
Ensure motor is enabled |
| 2 | JV=0; |
Set velocity to zero |
| 3 | BG; |
Begin (coast to stop) |
| 4 | ST; |
Stop |
| 5 | MO=0; |
Disable motor |
Command Reference¶
| Command | Description |
|---|---|
MO=1; |
Motor on (enable drive) |
MO=0; |
Motor off (disable drive) |
JV=<n>; |
Set jog velocity in counts/sec |
JV=0; |
Set jog velocity to zero |
BG; |
Begin motion with current JV setting |
ST; |
Stop motion |
EO=0; |
Echo off |
EO=1; |
Echo on |
UM=2; |
Set unit mode to velocity (speed control) |
UM; |
Query current unit mode |
AC[1]=<n>; |
Set acceleration limit |
DC=<n>; |
Set deceleration limit |
AC; |
Query acceleration limit |
DC; |
Query deceleration limit |
CL[1]=<n>; |
Set continuous current limit (A) |
PL[1]=<n>; |
Set peak current limit (A) |
PL[2]=<n>; |
Set peak current duration limit |
CL[1]; |
Query continuous current limit |
PL[1]; |
Query peak current limit 1 |
PL[2]; |
Query peak current limit 2 |
VX; |
Query main encoder velocity |
ID; |
Query active (direct) current |
IQ; |
Query reactive (quadrature) current |
SR; |
Query status register |
SN; |
Query drive serial number |
Notes¶
- The Elmo drive sits behind power channel 2 (
PumpMotorControllerElexChannel). The LHE board also has a separate pump motor power switch (channel 20) that must be enabled before running the motor. Thepumpfactory mode command handles both automatically. - Responses from the Elmo are logged to the engineering log under the
pumpMotorcolumn. - The acceleration limit is currently hardcoded to
1e9inElmoTwitter.cswith a TODO to move it intoMissionConfig.