Skip to content

BLDC_Test_Bench command line

The narrative of how the tool was found and read is at /story/firmware-adventure/. Sibling references: /reference/firmware-images/, /reference/boxinit-services/, /reference/colibry-config/.

Word Meaning
Verified The value was checked against the file or bytes named in the Source column.
Agent-cited The value was taken from a project note and not re-checked.
Open Not established.
Item Value Source Status
Path (image root) usr/bin/BLDC_Test_Bench firmware 4.7.1 rootfs Verified
Banner “Motor Test Bench For Mykonos3 project (MTB). Usage is:” strings of the binary, usage block Verified
Option parsing getopt string hqxPWID:SHCOAR:G:M:X:Efr:w:aV:d:t:s:m:b:i:c:o:FK:Z:T: strings of the binary Verified
Letters taking an argument in the getopt string D, R, G, M, X, r, w, V, d, t, s, m, b, i, c, o, K, Z, T same string, letters followed by a colon Verified
Long option names stored as separate strings help, no_verbose, quit, scicos, Power_supply, Weight_captor, and the long names in the table below strings of the binary Verified
Long option names --I2C_bridge, --interactive Present as strings; not printed in the usage block strings of the binary Verified
Help-text origin Printed by the tool itself; the usage block is grouped under the headings MTB firmware, MTB external peripherals, Basic unitary commands to BLDC, Remote control, Motor settings, Speed steps, Computation, Unitary tests strings of the binary Verified
Label Meaning in this table
Read only Prints information; sends no motor, setting or GPIO change.
Clears error flag only Clears the controller error flag; the help text does not say motors stop.
Stops motors Stops spinning the motors.
Starts or spins motors Starts motors, or sets, builds or launches a speed reference.
Writes persistent settings Writes a motor setting.
Clears EEPROM Clears the controller EEPROM.
Changes GPIO or sound Changes controller GPIO logic or plays sound.
Other test mode Concerns bench peripherals or the host link, not the motors directly. -P and -V act on a bench power supply and change its output.
Unknown (treat as spinning motors) The help text does not establish the effect.

Classification is conservative. Any option that sets a speed profile, launches a wave, runs a unit test, computes feedforward or Kv, orders motors or starts motors is labelled as starting or spinning motors.

The Effect column paraphrases the help text. Four lines that carry a warning are quoted exactly (-H, -C, -E, -N). Arguments are as shown in the help text.

Flag Long name Arguments Effect (paraphrased from the help text) Risk Status
-h --help none Prints the help. Read only Verified
-n --no-verbose none Suppresses displayed messages. Read only Verified
-q --quit none Exits the tool. Read only Verified
-x --scicos none Sets the log format for use with scicos. Read only Verified
Flag Long name Arguments Effect (paraphrased from the help text) Risk Status
-P --Power_supply none Controls a HAMEG HMP2020 bench power supply. Other test mode Verified
-W --Weight-captor none Reads a weight measurement from a KERN440 balance. Other test mode Verified
-todo none none Listed entry for reading propeller speed from an optical sensor; no option letter matches it. Unknown (treat as spinning motors) Verified

The -todo line is printed in the usage block, but the getopt string has no t option that matches it as printed. -t is a separate option (see Speed steps).

Flag Long name Arguments Effect (paraphrased from the help text) Risk Status
-I --get_info none Reads information from the BLDC board. Read only Verified
-D --direction_start_motors direction value Starts the motors with a given direction; clears an error automatically first. Starts or spins motors Verified
-S --secure_start_motors none Starts the motors; clears an error automatically first. Starts or spins motors Verified
-H --stop_motors none “Stop spinning the motors” Stops motors Verified
-C --clear_error none “Clear BLDC error flag” Clears error flag only Verified
-O --get_obs_speed none Reads the observed speed. Read only Verified
-R --set_ref_speed RPM1 RPM2 RPM3 RPM4 Sets a reference speed for each of the four motors. Starts or spins motors Verified
-A --rev_spin_dir none Reverses the spin direction of all propellers. Unknown (treat as spinning motors) Verified
-G --GPIO r g p s Changes the logic level of the board GPIO lines (two LEDs, a reset line for the main SoC and a switch line, as the help text names them). Changes GPIO or sound Verified
-M --Musique m Plays a sound: a negative value loops it, zero stops it, a positive value plays it once. Unknown (treat as spinning motors) Verified
-E --EEPROM_clear none “Clear the content of EEPROM” Clears EEPROM Verified
-X --set_i2c_timeout ms Sets the I2C timeout in milliseconds, up to 30000. Unknown (treat as spinning motors) Verified

The help text for -M does not say how the board produces sound, so it is labelled Unknown. A project note (firmware-4.7.1.md) reports that it moves the motors briefly (the boot chirp); that was not verified. The factory script carries the comment ### Stop motors to produce sound (if error detecetd) above its -C call.

Flag Long name Arguments Effect (paraphrased from the help text) Risk Status
-f --Futuba none Selects a Futaba remote control using the S.bus protocol. Other test mode Verified
Flag Long name Arguments Effect (paraphrased from the help text) Risk Status
-r --read_set ID Reads one motor setting by ID. Read only Verified
-w --write_set ID VAL Writes a value to one motor setting by ID. Writes persistent settings Verified
-a --read_all_set none Reads all motor settings. Read only Verified

The help text does not use the word persistent for -w. The label is applied because a setting write is a stored change.

Flag Long name Arguments Effect (paraphrased from the help text) Risk Status
-i --inverse_sens decimal bit field Selects propeller spin direction with a decimal bit field. Unknown (treat as spinning motors) Verified
-V --voltage VOLT Sets the voltage of channel 1 of the bench power supply. Other test mode Verified
-d --duration DUR Sets the duration of each step. Starts or spins motors Verified
-t --times NTH Sets the number of step iterations. Starts or spins motors Verified
-s --steps MIN INCR MAX Builds an ascending series of speed steps. Unit per the help text: RPM if the BLDC is open loop, otherwise PWM. Starts or spins motors Verified
-s --steps MAX -INCR MIN Builds a descending series of speed steps. Same unit rule. Starts or spins motors Verified
-s --steps MIN MAX Builds a pulse between two speeds. Same unit rule. Starts or spins motors Verified
-s --steps SPEED Builds a single step. Same unit rule. Starts or spins motors Verified
-m --multisinus X Builds a multisinus speed wave centred on a given value. Starts or spins motors Verified
-b --chirp f1 f2 X A Builds a chirp speed wave between two frequencies, centred on a value with a given amplitude. Starts or spins motors Verified
-l --launch none Launches the prepared speed wave. Starts or spins motors Verified
-L --Launch none Launches the prepared speed wave, then its reverse. Starts or spins motors Verified
-N --No_halt_on_error none “Even if BLDC detects an error keep turning motors” Starts or spins motors Verified
-p --pid none Like -l for steps, and also observes the speed regulator states at the BLDC rate. Starts or spins motors Verified
-c --csv_file none printed (getopt requires one) Reads a CSV file as the speed reference. Starts or spins motors Verified
-o --order_motor_position none printed (getopt requires one) Sends a minimal speed difference to all motors to identify which motor is which. Starts or spins motors Verified
Flag Long name Arguments Effect (paraphrased from the help text) Risk Status
-Z none VOLT Logs motor consumption and speed against PWM at a given voltage, with the BLDC in open loop. Starts or spins motors Verified
-F --feedforward none Computes the static feedforward polynomial used in the BLDC, with the BLDC in open loop. Starts or spins motors Verified
-K --kv R Computes the motor Kv with no load, given the motor resistance in deciohms, with the BLDC in open loop. Starts or spins motors Verified
Flag Long name Arguments Effect (paraphrased from the help text) Risk Status
-T --unitary_tests FI LA Runs unit tests from the first to the last given number. Starts or spins motors Verified

Related strings in the same binary: “Usage for MTB unitary tests: -T f [l]”, and a prompt in French asking that the propeller be blocked before a start.

Item Value Source Status
Spin-direction field The direction value is an 8-bit field for up to 8 motors; the error text states the accepted range as 0 to 31 error text in the binary Verified
Voltage limit message Setting a supply voltage above a built-in limit is rejected with an error error text in the binary Verified
Test-bench-mode warning “the BLDC firmware has not been compiled in test bench mode this will disable some options !” strings of the binary Verified
Settings warning The tool warns when the BLDC firmware was built without motor-settings support strings of the binary Verified
Steps usage -s min inc max, -s max -inc min, -s speed1 speed2, -s speed strings of the binary Verified
Multisinus usage -m speed strings of the binary Verified
Chirp usage MTB -b <form> <2^f1> <2^f2> <speed> <amplitude> strings of the binary Verified

Options the 4.7.1 motor-board firmware does not serve

Section titled “Options the 4.7.1 motor-board firmware does not serve”

The dispatch table of the motor-board firmware image (BLDC.cyacd) was read by a project note. It lists handlers for commands 0x02, 0x20, 0x40, 0x4D, 0x60, 0x80, 0x82, 0x8D, 0xA0 and 0xFA. It has no entry for 0x06, 0x2B, 0xC0 or 0xE0. The host tool contains code that sends all four. The table was re-read from the image bytes for this page: it holds entries for exactly those ten command bytes and none for 0x06, 0x2B, 0xC0 or 0xE0. The flag-to-command links in the table below were not re-derived.

Command Host function name Flags that depend on it Basis Status
0x06 MTB_BLDC_reverse_spin_direction -A Function name and help text match; the decompile note does not print the flag-to-function link Agent-cited
0xC0 settings access, read form C0 52 id 00 00, write form C0 57 id hi lo -r, -w, -a The project notes state the mapping from the “Motor settings” group; the decompile note names the read and write functions without naming flags Agent-cited
0x2B MTB_BLDC_get_assert none The decompile note says it is called only when the reported errno is 13, not from an option Agent-cited
0xE0 observed-data log dump, 75 pages not established The decompile note names the dumping function and not the option that reaches it Open

The notes state that commands without a table entry fall to an unknown-command default on 4.7.1. That behaviour was not observed on hardware.

The script is lib/firmware/BLDC_Factory_Tests.sh. It contains three invocations of the tool.

Line Invocation Option strings used Status
23 BLDC_Test_Bench -n -O -n, -O Verified
24 BLDC_Test_Bench -O (output filtered with sed) -O Verified
31 BLDC_Test_Bench -C -C Verified

No other option string of the tool appears in the script.

Comments

Spotted a mistake, or tried this on your own Bebop? Leave a note. Comments are kept on this site's own server.