summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/CM1-C_ASCII_Command_Cheatsheet.md189
1 files changed, 189 insertions, 0 deletions
diff --git a/docs/CM1-C_ASCII_Command_Cheatsheet.md b/docs/CM1-C_ASCII_Command_Cheatsheet.md
new file mode 100644
index 0000000..9fdd695
--- /dev/null
+++ b/docs/CM1-C_ASCII_Command_Cheatsheet.md
@@ -0,0 +1,189 @@
+# Cool Muscle CM1-C ASCII / CML Serial Control Cheat Sheet
+
+**Applies to:** CM1-C, with RT3.14-focused commands
+**Serial default:** 38400 baud, 8-N-1, no flow control
+**Terminator:** carriage return (`\r`, ASCII 13) after every command
+**Motor ID:** append `.1`, `.2`, etc. Always include it explicitly.
+
+> Use low speed and low torque during commissioning. Software commands are not a safety-rated E-stop.
+
+## Quick direct move
+
+```text
+M0.1=20
+A0.1=10
+S0.1=20
+P0.1=1000
+^.1
+```
+
+- `P0` target position in pulses
+- `S0` speed; actual unit is selected by `K37`
+- `A0` acceleration in thousands of pulses/s^2
+- `M0` torque limit, 0-100% of peak torque
+- `^` execute
+
+## Continuous rotation until stopped
+
+```text
+A0.1=10
+M0.1=30
+P0.1=1000000000
+S0.1=20
+^.1
+```
+
+Use negative speed for the opposite direction:
+
+```text
+S0.1=-20
+^.1
+```
+
+Stop:
+
+```text
+].1
+```
+
+`S0.1=0` also stops indefinite-position motion. Exact CW/CCW depends on `K45`.
+
+## Safety and enable commands
+
+| Command | Action |
+|---|---|
+| `].1` | Immediate normal software stop of motor 1; pauses a bank |
+| `*` | Emergency stop all motors on the chain |
+| `*1` | Clear emergency-stop state |
+| `).1` | Disable motor; shaft becomes free |
+| `(.1` | Enable motor |
+
+## Queries
+
+| Command | Information |
+|---|---|
+| `?.1` | Dynamic P0/A0/S0 |
+| `?85.1` | Firmware and motor ID |
+| `?90.1` | All K parameters |
+| `?91.1` / `?P.1` | Position registers |
+| `?92.1` / `?S.1` | Speed registers |
+| `?93.1` / `?A.1` | Acceleration registers |
+| `?95.1` | Position error |
+| `?96.1` | Current position |
+| `?97.1` | Current speed |
+| `?98.1` | Averaged current |
+| `?99.1` | Motor status |
+| `?70.1` | Input status |
+| `?71.1` | Temperature |
+| `?74.1` | Analog input |
+| `?1000.1` | All program and logic banks |
+| `K37.1` | Query one specific parameter |
+
+## Status values from `?99`
+
+- `0` moving
+- `1` position-error overflow
+- `2` overspeed/overvoltage
+- `4` overload/overcurrent
+- `8` in position / ready
+- `16` disabled
+- `32` push torque reached
+- `128` overtemperature
+- `256` push target reached before expected resistance
+- `512` emergency stop
+
+Values can be combined as a bit field.
+
+## Zeroing and homing
+
+| Command | Action |
+|---|---|
+| `|.1` | Run configured origin search |
+| `|1.1` | Move to position zero |
+| `|2.1` | Assign current position as zero |
+| `|4.1` | Soft reset |
+| `|11.1` | Clear whole-revolution count |
+
+The character is pipe `|` (ASCII 124), not capital I. Configure `K42`, `K43`, `K45`, `K46`, `K47`, and `K48` before origin search.
+
+## Outputs
+
+- `O1.1`, `O2.1`: output on
+- `F1.1`, `F2.1`: output off
+- `?51.1`, `?52.1`: output status
+- Configure output behavior in `K34`
+
+## Stored registers
+
+- `P1-P25`: positions
+- `S1-S15`: speeds
+- `A1-A8`: accelerations
+- `M1-M8`: torque limits
+- `T1-T8`: millisecond timers
+- `V1-V15`: variables/internal-state mappings
+- `N1-N25`, `R1-R25`: coordinated-motion or general-use data
+
+## Program banks
+
+```text
+B1
+S1,A1,P1
+END
+```
+
+- `[1.1`: execute program bank 1
+- `[L1.1`: execute logic bank 1
+- `].1`: pause immediately; send twice to terminate
+- `}.1`: stop after current motion
+- `>.1`, `<.1`: step through paused program
+- `]L.1`: stop logic bank
+- `B100`, `L100`: clear all banks
+- `$ .1` without the space: save to EEPROM; actual command is `$.1`
+
+## Important K parameters
+
+- `K20`: baud / ASCII versus Modbus
+- `K23`: serial event reporting and echo
+- `K37`: resolution and speed unit; default `K37=3` = 1000 ppr, 100 pps speed unit
+- `K44`: deceleration ratio
+- `K45`: direction and coordinate sign
+- `K55`: in-position tolerance
+- `K56`: position-error fault threshold
+- `K58`, `K59`: software position limits
+- `K70`: CR-only versus CR+LF replies
+
+K/H parameters auto-save by default. On suitable RT3.14 firmware, `_SKH=0` temporarily disables auto-saving to avoid repeated EEPROM writes; `_SKH=1` re-enables it.
+
+## PowerShell
+
+```powershell
+$PortName = "COM3"
+
+$cm = [System.IO.Ports.SerialPort]::new(
+ $PortName, 38400,
+ [System.IO.Ports.Parity]::None,
+ 8,
+ [System.IO.Ports.StopBits]::One
+)
+$cm.Handshake = [System.IO.Ports.Handshake]::None
+$cm.ReadTimeout = 700
+$cm.WriteTimeout = 700
+$cm.NewLine = "`r"
+$cm.Open()
+
+function Send-CM1 {
+ param(
+ [Parameter(Mandatory)][string]$Command,
+ [int]$WaitMs = 150
+ )
+ if (-not $script:cm -or -not $script:cm.IsOpen) {
+ throw "CM1 serial port is not open."
+ }
+ $null = $script:cm.ReadExisting()
+ $script:cm.Write($Command + "`r")
+ Start-Sleep -Milliseconds $WaitMs
+ $script:cm.ReadExisting()
+}
+```
+
+**Source basis:** Myostat CM1-C User Guide v3.00 (2025-12-05) and CM1 RT3.14 Quick Reference Guide v3.14.00.