Skip to content

Configuration

neoxic edited this page Feb 13, 2023 · 11 revisions

CLI

The firmware features a UNIX-style console (no echo, LF as EOL) on the signal wire at 38400 baud 8N1 using a generic USB-TTL adapter. Although not strictly required (see below), the following simple circuit is needed to convert two RX/TX pins on the USB-TTL adapter into one wire for a two-way communication with the ESC:

In case of a simplified one-way communication when the ESC is connected to the TX and GND pins, type play to make sure the connection is working. You should hear a beep in return. Please note that you will not receive responses to commands in this case obviously.

Connecting via socat

Examples depending on socat's flavour:

$ socat - /dev/ttyUSB0,rawer,b38400
$ socat - /dev/cu.SLAB_USBtoUART,rawer,ispeed=38400,ospeed=38400

Connecting via PuTTY

Since standard PuTTY uses CR as EOL for serial connections, download modified PuTTY.

Open a serial connection, turn on echo, and enable CR/LF:

Commands

help

Print basic usage help.

info

Print ESC information.

show

Print settings.

get <param>

Print the value of <param>.

set <param> <value>

Set <param> to <value> and print the resulting (possibly trimmed) value.

play [<music>] [<volume>]

Play <music> (or startup music if omitted) with <volume> (or startup music volume if omitted).

save

Save settings.

Settings

arm = 1

Enable arming (wait for zero throttle on startup):

  • 0: off
  • 1: on

damp = 1

Enable damped mode (regenerative braking):

  • 0: off
  • 1: on

reverse = 0

Reverse motor direction:

  • 0: off
  • 1: on

timing = 4

Motor timing (3.75*X degrees) [0..7].

freq_min = 24

Minimum PWM frequency (kHz) [16..96].

freq_max = 48

Maximum PWM frequency (kHz) [16..96].

duty_min = 0

Minimum duty cycle (%) [0..100].

duty_max = 100

Maximum duty cycle (%) [0..100].

duty_lim = 6

Acceleration/deceleration speed limit (0.5*X %/ms) [1..200]. Higher values bring more agility to fast throttle changes, yet might increase the chance of sync loss.

duty_drag = 0

Drag brake amount when the motor is stopped (%) [0..100]. This value is also a starting brake amount in proportional brake mode.

throt_mode = 0

Throttle mode:

  • 0: forward
  • 1: forward/reverse
  • 2: forward/brake/reverse (proportional brake mode)

throt_cal = 1 (servo PWM only)

Automatic throttle calibration using pulse period as a reference:

  • 0: off
  • 1: on

throt_min = 1000 (servo PWM only)

Minimum throttle (µs).

throt_mid = 1500 (servo PWM only)

Middle throttle (µs).

throt_max = 2000 (servo PWM only)

Maximum throttle (µs).

serial_mode = 0 (PA2 input only)

Serial input mode:

  • 0: off
  • 1: on (*)
  • 2: iBUS
  • 3: S.BUS

(*) Throttle value is transmitted at 115200 baud 8N1 as two bytes - first low byte, then high byte. Lower 12 bits of the 16-bit value are the throttle value from -2000 (full reverse) to 2000 (full forward), higher 4 bits are the CRC (XOR'ed nibbles).

serial_chid = 0 (PA2 input only)

iBUS/S.BUS channel ID.

music1, music2, music3

Music #1 (startup), #2, and #3.

volume1, volume2, volume3

Music volume #1 (startup), #2, and #3.

last_error

Last error code.

Music format

A sequence of characters is translated into music in the following way:

  • _ (underscore) is a pause;
  • cdefgab are low notes;
  • CDEFGAB are high notes;
  • # (pound) after a note makes it a sharp note;
  • 12345678 after a note or pause is a duration: 1 - 1/16 (default), 2 - 1/8, 3 - 3/16, 4 - 1/4, etc.

Examples:

play cdefg_g_a2Cag_g
play a2D_D3EF#2D_D3C#b2E_E3DC#2a_a3
Clone this wiki locally