mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-13 11:29:56 +03:00
* tidy up LTM update schedules
* update CLI and Telemetry documentation
This commit is contained in:
parent
88ed98a7f5
commit
6be27778da
3 changed files with 43 additions and 15 deletions
|
@ -210,7 +210,8 @@ Re-apply any new defaults as desired.
|
|||
| frsky_vfas_cell_voltage | OFF | |
|
||||
| hott_alarm_sound_interval | 5 | Battery alarm delay in seconds for Hott telemetry |
|
||||
| smartport_uart_unidir | OFF | Turn UART into UNIDIR for smartport telemetry for usage on F1 and F4 target. See Telemertry.md for details |
|
||||
| ibus_telemetry_type | 0 | Type compatibility ibus telemetry for transmitters. See Telemertry.md label IBUS for details. |
|
||||
| ibus_telemetry_type | 0 | Type compatibility ibus telemetry for transmitters. See Telemetry.md label IBUS for details. |
|
||||
| ltm_update_rate | NORMAL | Defines the LTM update rate (use of bandwidth [NORMAL/MEDIUM/SLOW]). See Telemetry.md, LTM section for details. |
|
||||
| battery_capacity | 0 | Battery capacity in mAH. This value is used in conjunction with the current meter to determine remaining battery capacity. |
|
||||
| vbat_scale | 110 | Result is Vbatt in 0.1V steps. 3.3V = ADC Vref, 4095 = 12bit adc, 110 = 11:1 voltage divider (10k:1k) x 10 for 0.1V. Adjust this slightly if reported pack voltage is different from multimeter reading. You can get current voltage by typing "status" in cli. |
|
||||
| vbat_max_cell_voltage | 43 | Maximum voltage per cell, used for auto-detecting battery voltage in 0.1V units, default is 43 (4.3V) |
|
||||
|
|
|
@ -98,17 +98,30 @@ The INAV implementation of LTM implements the following frames:
|
|||
suffixed '+' not implemented in INAV.
|
||||
* O-FRAME: Origin (home position, lat, long, altitude, fix)
|
||||
|
||||
In addition, in the inav (navigation-rewrite) fork:
|
||||
In addition, in iNav:
|
||||
|
||||
* N-FRAME: Navigation information (GPS mode, Nav mode, Nav action,
|
||||
Waypoint number, Nav Error, Nav Flags).
|
||||
* X-FRAME: Extra information. Currently HDOP is reported.
|
||||
|
||||
LTM is transmit only, and can work at any supported baud rate. It is
|
||||
designed to operate over 2400 baud (9600 in INAV) and does not
|
||||
benefit from higher rates. It is thus usable on soft serial.
|
||||
|
||||
A CLI variable `ltm-update-rate` may be used to configure the update
|
||||
rate and hence band-width used by LTM, with the following enumerations:
|
||||
|
||||
* NORMAL: Legacy rate, currently 303 bytes/second (requires 4800 bps)
|
||||
* MEDIUM: 164 bytes/second (requires 2400 bps)
|
||||
* SLOW: 105 bytes/second (requires 1200 bps)
|
||||
|
||||
For many telemetry devices, there is direction correlation between the
|
||||
air-speed of the radio link and range; thus a lower value may
|
||||
facilitate longer range links.
|
||||
|
||||
More information about the fields, encoding and enumerations may be
|
||||
found at
|
||||
https://github.com/stronnag/mwptools/blob/master/docs/ltm-definition.txt
|
||||
found at https://github.com/iNavFlight/inav/wiki/Lightweight-Telemetry-(LTM).
|
||||
|
||||
|
||||
## MAVLink telemetry
|
||||
|
||||
|
@ -257,6 +270,3 @@ These receivers are reported to work with i-bus telemetry:
|
|||
- FlySky/Turnigy FS-iA10B 10-Channel Receiver (http://www.flysky-cn.com/products_detail/productId=52.html)
|
||||
|
||||
Note that the FlySky/Turnigy FS-iA4B 4-Channel Receiver (http://www.flysky-cn.com/products_detail/productId=46.html) seems to work but has a bug that might lose the binding, DO NOT FLY the FS-iA4B!
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -80,6 +80,7 @@
|
|||
|
||||
#define TELEMETRY_LTM_INITIAL_PORT_MODE MODE_TX
|
||||
#define LTM_CYCLETIME 100
|
||||
#define LTM_SCHEDULE_SIZE (1000/LTM_CYCLETIME)
|
||||
|
||||
extern uint16_t rssi; // FIXME dependency on mw.c
|
||||
static serialPort_t *ltmPort;
|
||||
|
@ -88,6 +89,7 @@ static bool ltmEnabled;
|
|||
static portSharing_e ltmPortSharing;
|
||||
static uint8_t ltm_crc;
|
||||
static uint8_t ltmPayload[LTM_MAX_MESSAGE_SIZE];
|
||||
static uint8_t ltm_x_counter;
|
||||
|
||||
static void ltm_initialise_packet(sbuf_t *dst)
|
||||
{
|
||||
|
@ -251,9 +253,10 @@ void ltm_xframe(sbuf_t *dst)
|
|||
sbufWriteU8(dst, 'X');
|
||||
ltm_serialise_16(dst, gpsSol.hdop);
|
||||
ltm_serialise_8(dst, sensorStatus);
|
||||
ltm_serialise_8(dst, ltm_x_counter);
|
||||
ltm_serialise_8(dst, 0);
|
||||
ltm_serialise_8(dst, 0);
|
||||
ltm_serialise_8(dst, 0);
|
||||
ltm_x_counter++; // overflow is OK
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -279,7 +282,11 @@ void ltm_nframe(sbuf_t *dst)
|
|||
#define LTM_BIT_NFRAME (1 << 4)
|
||||
#define LTM_BIT_XFRAME (1 << 5)
|
||||
|
||||
static uint8_t ltm_normal_schedule[10] = {
|
||||
/*
|
||||
* This is the normal (default) scheduler, needs c. 4800 baud or faster
|
||||
* Equates to c. 303 bytes / second
|
||||
*/
|
||||
static uint8_t ltm_normal_schedule[LTM_SCHEDULE_SIZE] = {
|
||||
LTM_BIT_AFRAME | LTM_BIT_GFRAME,
|
||||
LTM_BIT_AFRAME | LTM_BIT_SFRAME | LTM_BIT_OFRAME,
|
||||
LTM_BIT_AFRAME | LTM_BIT_GFRAME,
|
||||
|
@ -292,7 +299,11 @@ static uint8_t ltm_normal_schedule[10] = {
|
|||
LTM_BIT_AFRAME | LTM_BIT_SFRAME | LTM_BIT_NFRAME
|
||||
};
|
||||
|
||||
static uint8_t ltm_medium_schedule[] = {
|
||||
/*
|
||||
* This is the medium scheduler, needs c. 2400 baud or faster
|
||||
* Equates to c. 164 bytes / second
|
||||
*/
|
||||
static uint8_t ltm_medium_schedule[LTM_SCHEDULE_SIZE] = {
|
||||
LTM_BIT_AFRAME,
|
||||
LTM_BIT_GFRAME,
|
||||
LTM_BIT_AFRAME | LTM_BIT_SFRAME,
|
||||
|
@ -305,21 +316,25 @@ static uint8_t ltm_medium_schedule[] = {
|
|||
LTM_BIT_NFRAME
|
||||
};
|
||||
|
||||
static uint8_t ltm_slow_schedule[] = {
|
||||
/*
|
||||
* This is the slow scheduler, needs c. 1200 baud or faster
|
||||
* Equates to c. 105 bytes / second (91 b/s if the second GFRAME is zeroed)
|
||||
*/
|
||||
static uint8_t ltm_slow_schedule[LTM_SCHEDULE_SIZE] = {
|
||||
LTM_BIT_GFRAME,
|
||||
LTM_BIT_SFRAME,
|
||||
LTM_BIT_AFRAME,
|
||||
0,
|
||||
LTM_BIT_OFRAME,
|
||||
LTM_BIT_XFRAME,
|
||||
LTM_BIT_GFRAME,
|
||||
LTM_BIT_GFRAME, // consider zeroing this for even lower bytes/sec
|
||||
0,
|
||||
LTM_BIT_AFRAME,
|
||||
LTM_BIT_NFRAME,
|
||||
};
|
||||
|
||||
/* This is the default scheduler, needs c. 4800 baud or faster */
|
||||
static uint8_t *ltm_schedule = ltm_normal_schedule;
|
||||
/* Set by initialisation */
|
||||
static uint8_t *ltm_schedule;
|
||||
|
||||
static void process_ltm(void)
|
||||
{
|
||||
|
@ -410,6 +425,7 @@ void configureLtmTelemetryPort(void)
|
|||
baudRateIndex = BAUD_19200;
|
||||
}
|
||||
|
||||
/* setup scheduler, default to 'normal' */
|
||||
if(telemetryConfig()->ltmUpdateRate == LTM_RATE_MEDIUM)
|
||||
ltm_schedule = ltm_medium_schedule;
|
||||
else if (telemetryConfig()->ltmUpdateRate == LTM_RATE_SLOW)
|
||||
|
@ -420,6 +436,7 @@ void configureLtmTelemetryPort(void)
|
|||
ltmPort = openSerialPort(portConfig->identifier, FUNCTION_TELEMETRY_LTM, NULL, baudRates[baudRateIndex], TELEMETRY_LTM_INITIAL_PORT_MODE, SERIAL_NOT_INVERTED);
|
||||
if (!ltmPort)
|
||||
return;
|
||||
ltm_x_counter = 0;
|
||||
ltmEnabled = true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue