09. Annex - dgatf/msrc GitHub Wiki
Serial parameters:
- 19200 bps
- 1 packet every 20 ms
- Big endian
Byte | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
---|---|---|---|---|---|---|---|---|---|---|
Value | Package Head (0x9B) | Package Number 1 | Package Number 2 | Package Number 3 | Rx Throttle 1 | Rx Throttle 2 | Output PWM 1 | Output PWM 2 | RPM Cycle 1 | RPM Cycle 2 |
RPM = 60000000 / RPM Cycle
thr, pwm: 0-255 (8bits)
Byte | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Value | Package Head (0x9B) | Package Number 1 | Package Number 2 | Package Number 3 | Rx Throttle 1 | Rx Throttle 2 | Output PWM 1 | Output PWM 2 | RPM 1 | RPM 2 | RPM 3 | Voltage 1 | Voltage 2 | Current 1 | Current 2 | TempFET 1 | TempFET 2 | Temp 1 | Temp 2 |
thr, pwm: 0-1024 (10bits)
Voltage, current and temperature are raw sensor data. Actual values requires transformation. Depending on the model, sensors are different
Before throttle is raised from 0, signature packets are sent between telemetry packets. This is used to identify the hardware and firmware of the ESC
Examples:
Model\Byte | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
V4LV25/60/80A | 0x9B | 0x9B | 0x03 | 0xE8 | 0x01 | 0x08 | 0x5B | 0x00 | 0x01 | 0x00 | 0x21 | 0x21 | 0xB9 |
V4HV200A OPTO | 0x9B | 0x9B | 0x03 | 0xE8 | 0x01 | 0x02 | 0x0D | 0x0A | 0x3D | 0x05 | 0x1E | 0x21 | 0xB9 |
V5HV130A OPTO | 0x9B | 0x9B | 0x03 | 0xE8 | 0x01 | 0x0B | 0x41 | 0x21 | 0x44 | 0xB9 | 0x21 | 0x21 | 0xB9 |
For best accuracy RX pulse input is captured with a timer interrupt and ESC pulse output is produced by hardware PWM. Maximum latency is 20ms
See Castle Link Live
Supported models: Kosmic, Kolibri, JivePro. Protocol specs
Note that there is another protocol used by Kontronik Jive at 9600 that it is not supported. Info here
For best accuracy PWM signal output for FBL is produced by hardware PWM from serial RPM values. Maximum latency is 40ms
To obtain the voltage at the analog pin it is required the ADC bits (b) and the Vref:
Two battery voltages can be measured through the analog pins A2 and A3 Metal resistors are recommended as gives more accurate readings (0.1W or higher) Maximum voltage is 3.3V
To select R values apply formulas:
For 6S battery (or lower) and Pro Mini 3.3v:
- R1 68k
- R2 10k
In this case ratio is 7.8
If more than 6S change R values or you may burn the board!
Two temperature sensors can be installed through the analog pins A0 and A1 Temperature is measured with NTC thermistors (100k). Adjust thermistor Beta in ntc.h if needed (NTC_BETA, default is 4190). Sensor output in Celsius
To obtain the thermistor resistance:
And temperature with Beta formula:
Or with Steinhart and Hart Equation if data is available:
Hall effect sensors. Induced magnetic field is transformed into voltage. They are caracterized by their sensitivity
The voltage drop in the shunt resistor is amplified by a differential amplifier to obtain Vo
Altitude is calculated using the barometric formula:
R = universal gas constant: 8.3144598 J/(mol·K)
g = gravitational acceleration: 9.80665 m/s2
M = molar mass of Earth's air: 0.0289644 kg/mol
L = temperature lapse rate (K/m): 6.5 C/km
T = temperature at h (K)
Po = pressure at ground (Pa)
5 seconds after boot, pressure reference, Po, is set