Ziege-One / msrc

Multi Sensor Arduino for RC - FrSky D, SmartPort, XBUS, SRXL, IBUS, SBUS, Multiplex Sensor Bus, Jeti Ex Bus, Hitec

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MSRC - Multi Sensor for RC - Smartport, Frsky D, XBUS, SRXL, IBUS, SBUS2, Multiplex Sensor Bus, Jeti Ex Bus, Hitec

Donate

This is a DIY project to send sensors telemetry for a fraction of the weight and cost of the stock sensors. It adds support for several ESC telemetry protocols

Compatible RX protocols: Frsky Smartport, FrSky D, Spektrum XBUS, Spektrum SRXL V5, Flysky IBUS, Futaba SBUS2, Multiplex Sensor Bus, Jeti Ex Bus

Compatible ESCs: Hobbywing V3/V4/V5, Kontronik Kosmic/Kolibri/JivePro, Castle Link, APD F/HV/UHV, phase sensor/PWM signal

Compatible MCUs: ATmega328P, ATmega328PB and ATmega32U4 and Teensy LC/3.x

Implemented sensors:

  • ESC
    • ESCs with serial telemetry (Hobbywing V3/V4/V5(1), Kontronik(2)), APD F/HV/UHV
    • ESC with PWM signal or phase sensor
    • ESC Castle Link
  • GPS serial (NMEA)
  • I2C sensors: BMP280, MS5611
  • Analog sensors: voltage, temperature, current, air speed

All sensors are optional. Make the circuit with the desired sensors and enable them in the configuration. It can be configured from the PC with msrc_gui, or with a lua script if using smartport or manually in config.h

(1) HW V5 = HW FlyFun. If ESC doesn't arm, in config.h enable ESC_INIT_DELAY or connect arduino after the ESC is armed
(2) Supported: Kosmic, Kolibri, JivePro. Not supported: Jive

1. Boards

1.1 MCU

MCU Recommended board Castle telemetry UART(1) Inverted UART(2)
ATmega328P(3) Arduino Pro Mini(5) Innacurate 1
ATmega328PB(3) Pololu ATmega328PB(5) ✔️ 2
ATmega32U4(3) Arduino Micro / Teensy 2 ✔️ 1
MKL26Z (ARM CortexM0+) Teensy LC(4) ✔️ 3 ✔️
MK20DX (ARM CortexM4) Teensy 3.2 ✔️ 3 ✔️

ATmega2560 is deprecated

(1) 2 x UARTS allows to use ESC serial and GPS at the same time
(2) Allows to use hardware serial for Smartport and SBUS without signal inverter. Also is half duplex capable
(3) Arduino boards with 32kb or less and smartport, only the ESC driver defined in config.h is flashed. It can't be changed later with lua script
(4) Teensy LC is not 5v tolerant. If using with Castle is preferred Teensy 3.2, which is 5v tolerant
(5) Arduino Pro Mini and Pololu ATmega328PB requires a USB-TTL programmer for flashing

Which board should I choose?

Board required if using:

  • ESC Castle: Teensy2, Micro, Pololu ATmega328PB or Teensy LC
  • Receiver serial with ESC serial and GPS serial: Pololu ATmega328PB, Teensy LC/3.x

Teensy LC or Pololu 328PB is recommended if using:

  • SBUS or Jeti with another serial (ESC or GPS) and you don't want to loose any serial frame. Though Mini/Micro/Teensy 2 will work as well, but losing few serial frames

For the rest of the cases you can use ATmega328P boards (Pro Mini/Pro Micro/Teensy 2)

ATmega board version 3.3v or 5v: Usually 3.3v can be used and it is recommended as serial ports for receiver, ESC and GPS works at 3.3v. This also allows to power the board from the telemetry port, which is at 3.3v. Though 5v boards will work fine as well.

1.2 Connections

Board Arduino Pro Mini Pololu ATmega328PB Teensy 2 Arduino Pro Micro Teensy LC
Teensy 3.x
MCU ATmega328P ATmega328PB ATmega32U4 ATmega32U4 ARMCortexM0+
ARMCortexM4
NTC 1 A0 A0 F7 A0 14
NTC 2 A1 A1 F6 A1 15
Voltage 1 A2 A2 F5 A2 16
Voltage 2 A3 A3 F4 A3 17
Current A6 A6 B5 A9 20
Airspeed A7 A7 D7 A7 26
ESC serial RX RX0 D2 RX1 9
GPS RX RX1 D2 RX1 7
PWM in 8 8 D4 4 6
PWM out 10 10 B6 10 22
Rx Castle - 8 C7 13(9) 16
ESC Castle(1) - 2 & 22 D4 & B6 4 & 10 2 & 6
Frsky Smartport, SBUS 7 & 12(2) 7 & 9(2) B3 & B4(2) MISO & 8(2)
1
Frsky D 12 9 B4 8 1
SRXL, IBUS, SB, Jeti Ex RX & TX(2)
or(8) 7 & 12(2)
RX1 & TX1(2)
or(6) RX0 & TX0(2)
or(7) 7 & 9(2)
D2 & D3(2)
or(8) B3 & B4(2)
RX1 & TX1(2)
or(8) MISO & 8(2)
1
Hitec, XBUS or sensor SDA A4 A4 D1 2 18(3)
Hitec, XBUS or sensor SCL A5 A5 D0 3 19(3)
XBUS NPN clock stretch(4) 13 13 B5 9 13

(1) with 3.3k pull up resistor
(2) 1k resistor
(3) If using i2c_t3 library connect I2C sensor to pins 23 (SDA1) and 22 (SCL1)
(4) optional. Only if needed. If connected, enable XBUS_CLOCK_STRECH_SWITCH in config.h
(5) If using serial ESC
(6) If using GPS
(7) If using serial ESC and GPS
(8) If using serial ESC or GPS
(9) If using with Castle, use Arduino Micro. Pin 13 not available in Arduino Pro Micro

Status led of the board blinks when sending telemetry. If it doesn't blink check connections and config

2. Receiver protocol

The following Rx protocols are supported:

  • Frsky Smartport: inverted serial, 57600 bps
  • Frsky D: inverted serial, 9200 bps
  • Spektrum SRXL V5: serial, 115200 bps
  • Spektrum XBUS: I2C
  • Flysky IBUS: serial, 115200 bps
  • Futaba SBUS2: inverted serial, 100000 bps
  • Multiplex Sensor Bus: serial, 38400 bps
  • Jeti Ex Bus: serial 125000, 250000 bps
  • Hitec: I2C

Receiver and power source connections

All receivers provide 3.3V at the telemetry port.

  • 5V ATmega boards can be feed with 5v to 12v at RAW pin. In this case you need to connect RAW to a servo Vcc from receiver. Also connect servo GND to arduino GND pin (though board may still work if connected to 3.3v)

  • 3.3V ATmega boards can be feed with 3.3v to 12v at RAW pin. In this case you can choose the telemetry port Vcc or servo Vcc to connect to RAW pin.

  • TeensyLC/3.x. You can connect 3.7v to 5.5v to LC or 3.6v to 6.0v to 3.x at pin Vin. In this case you can choose the telemetry port Vcc or servo Vcc (if BEC is less than 5.5v or 6v) to connect to Vin pin.

Consider the following generic receiver, were Tele is the telemetry port

ATmega boards

1k resistor


ATmega 3.3v board with inverted serial protocol (Smartport, Sbus)
ATmega 3.3v board with non inverted protocol (IBUS, M-Link, Jeti, SRXL) and ESC or GPS serial connected



ATmega 5v board with serial inverted protocol (Smartport, Sbus)
ATmega 5v board with inverted protocol (IBUS, M-Link, Jeti, SRXL) and ESC or GPS serial connected



ATmega 3.3v board with non inverted protocol (IBUS, M-Link, Jeti, SRXL) and without ESC or GPS serial connected


ATmega 5v board with non inverted protocol (IBUS, M-Link, Jeti, SRXL) and without ESC or GPS serial connected

ARM Cortex boards


Teensy LC/3.x board any serial protocol

SBUS 2

Slots sensor mapping for Futaba transmitters:

Slot Sensor
0 RX voltage (reserved)
1 Temperature 1 (SBS-01T/TE)
2 RPM (type magnet)(SBS-01RB/RM/RO)
3-4 Vario-F1672
6-7 Voltage (SBS-01V)
8-15 GPS-F1675 (2)
16 Air speed (SBS-01TAS)
17-23 Unused
24-26 Current 1 (SBS-01C)
27-29(2) Current 2 (SBS-01C)
30(2) Temperature 2 (SBS-01T/TE)
31 Unused

(1) Do not select default GPS
(2) Non default slots

Select protocol: FASSTest 18CH or T-FHSS

Connect to SBUS2 port

XBUS

Auto-config may be used to detect the new sensors.

If using Teensy LC/3.1/3.5/3.6, it is feasible to use i2c_t3 library by enabling I2C_T3_TEENSY in config.h. This allows to use a second I2C port to use I2C sensors together with XBUS. Then I2C sensor to be connected to pins 23 (SDA1) and 22 (SCL1)


XBUS schematic


XBUS

}It is recommended to add pullup resistors to SDA/SCL lines

If no telemetry is shown, may be MSRC is booting too slow and the first poll from the receiver is not answered. There are several ways to fix this:

  1. Power on the receiver after MSRC has started
  2. Flash MSRC without bootloader
  3. I2C clock stretch. Pull down the SCL line until MSRC has started, then open the switch. You can use a manual swith or a NPN transistor (e.g. PN2222ABU). If using a transistor you need to enable XBUS_CLOCK_STRECH_SWITCH in config.h to open the switch after boot. If using manual switch, open the switch after boot, to finish the clock stretch


Clock stretch XBUS with manual switch


Clock stretch XBUS with transistor

Hitec

If Vin is a regulated 5V source (e.g. receiver, BEC), pull ups can be connected to Vin/RAW instead Vcc. Use pull ups resistors 1k to 2.7k


Hitec schematic


Hitec Optima 7


Hitec Optima 9

Jeti Ex Bus

Configure receiver pin (E1 or E2) as Ex Bus

Remark: Only for boards with 2k ram (ATmega328): The maximum number of sensors is 11 (e.g. GPS are already 11 sensors). You can enable the parameter JETIEX_LOW_MEMORY in jeti.h to disable less important sensors for GPS and vario. It disables Time, Date, HDOP and air temperature sensors

Multiplex M-Link


M-Link port

4. Sensors


Sensors with Smartport

4.1. ESC

Serial telemetry

Compatible ESC serial protocols:

  • Hobbywing V3/V4/V5. Serial 19200
  • Kontronik Kosmic/Kolibri/JivePro. Serial 115200, even parity
  • APD F/HV/UHV. Serial 115200

Optionally, for Hobbywing Flyfun (V5) and APD F-series, a PWM signal can be generated from the RPM telemetry value


ESC serial

Hobbywing Platinum V3

Telemetry port is the program port. It is a servo male plug on the ESC

Hobbywing Platinum V4 / FlyFun V5

  • The telemetry port is a wired servo female plug. Don't confuse with RPM PWM signal connector or the program port
  • Check firmware installed is NOT VBAR version
  • Values for current when throttle is low (up to 25%, depending on model) may not be reliable. If getting high or noisy current values when throttle is low, adjust CURRENT_THRESHOLD in config.h. Below this throttle percentage (0-100%), current values will be 0A
  • Set ESCHW4_CURRENT_MAX to the peak current of the ESC (eg: 80A: ESCHW4_CURRENT_MAX 100)
  • Adjust ESCHW4_DIVISOR and ESCHW4_AMPGAIN, depending on model:
Cells range ESCHW4_DIVISOR
3-6S (LV) 11
3-8S (LV v2) 15.75
5-12s (HV) 21
6-14s (HV v2) unknown
Amperage ESCHW4_AMPGAIN
FlyFun 60A 6
FlyFun 80A 12.4
100A 9(1)
Platinum V4 120A 10
130A 11.3(1)
150A 12.9(1)
160A 13.7(1)
Platinum V4 200A 16.9

(1) Extrapolated from confirmed models. If you find discrepancy adjust gain parameter and send gain and ESC model to update the table

APD F series

Telemetry port: pin T

Types of telemetry:

  • RPM output it is a PWM signal with the RPMs. Select PROTOCOL_PWM and connect to pin PWM in as noted in connections table

  • PWM telemetry. For this type of telemetry you need to flash beta firmware. It provides serial telemetry with RPMs, voltage, current and temperature. Select PROTOCOL_APD_F. Connect ESC pin T to pin Rx as defined in connections table

APD UHV/HV series

Serial telemetry with RPMs, voltage, current and temperature. Select PROTOCOL_APD_HV

PWM signal

If the ESC have a PWM signal or a phase sensor is installed, RPMs can be measured. If ESC have both serial and PWM signal, like Hobbywing V4/V5, then PWM signal is not needed for telemetry


PWM signal/phase sensor circuit

Castle link

The telemetry is send over the ESC signal. Castle Link has to be enabled in the ESC config

If using ATmega328P telemetry values are not accurate all the time. Some readings are increased by 5-10%. This is a hardware limitation

Remark: currently not compatible with Teensy3.x


Castle Link 2 and Smartport or SBUS with Teensy


Castle Link and Smartport or SBUS with Arduino Micro


Castle Link with Teensy LC/3.x

Available ESC telemetry

Model RPM Throttle Motor PWM Voltage Current Voltage BEC Current BEC Temperature 1 Temperature 2 Ripple Volt
Hobbywing V3 ✔️ ✔️(1) ✔️(1)
Hobbywing V4/V5(4)(5) ✔️ ✔️(1) ✔️(1) ✔️ ✔️(2) ✔️ FET ✔️ BEC
Castle Link ✔️ ✔️(1) ✔️(1) ✔️ ✔️ ✔️(3) ✔️(3) ✔️ ✔️
Kontronik ✔️ ✔️(1) ✔️(1) ✔️ ✔️ ✔️ ✔️ ✔️ Power amp ✔️ BEC
APD F ✔️ ✔️(1) ✔️(1) ✔️ ✔️ ✔️
APD HV/UHV ✔️ ✔️(1) ✔️(1) ✔️ ✔️ ✔️

(1) Available but not forwarded to smartport
(2) For 80A models and higher
(3) Not available in all models
(4) Sensors varies depending on model and firmware. See annex
(5) Upgrade to latest firmware version. But note VBAR versions of firmware are not compatible. Install a non VBAR version of the ESC firmware

If voltage is available the cell voltage average is calculated for 3S,4S,5S,6S,7S,8S,10S and 12S batteries. 10 seconds after power on the number of cells is autodetected. Average cell voltage to be >3.8v for correct cell count

If current is available, battery consumption is calculated in mAh

RPM multipliers

Adjust RPMs in msrc_gui or config.h:

  • Set the number of pair of poles of the motor, RPM_PAIR_OF_POLES
  • For helis also set the pinion and main gear teeth: RPM_PINION_TEETH, RPM_MAIN_TEETH

Alternatively this can be done in the transmitter

4.2. Serial GPS

Serial GPS (NMEA protocol) is supported

4.3. Analog sensors

The following analog sensors are supported:

2 x voltage divider

Calibrate voltage analog sensors with VOLTAGE1_MULTIPLIER and VOLTAGE2_MULTIPLIER in msrc_gui or in config.h. Or from opentx, but it is recommended in order to increase sensor resolution

Multiplier = (R1+R2)/ R2

2 x temperature sensors (thermistors)

No need to calibrate. For fine tuning adjust in ntc.h: NTC_R_REF, NTC_R1, NTC_BETA

Current sensor

Calibrate current analog sensor from msrc_gui or config.h. Or from opentx, but it is recommended in order to increase sensor resolution

Set sensor type:

  • Hall effect (ACS758, Amploc). Multiplier = 1000 / sensitivity(mV/A). Select auto-offset or set zero current output voltage (Viout), which us the voltage at current 0

  • Shunt resistor sensor. Multiplier = 1000 / (ampgain * resistor(mΩ))

Airspeed sensor (MPXV7002)

No need to calibrate. For fine tuning adjust in pressure.h: TRANSFER_SLOPE,TRANSFER_VCC

4.4. I2C sensors

The following I2C sensors are suported:

  • Barometer: BMP280, MS5611

Remarks:

  • For BMP280 module there are two versions: 3.3V (6 pins, I2C/SPI) and 5V (4 pins, I2C). Note that 3.3V version is not 5V tolerant. Use module version accordingly to your board Vcc
  • If using XBUS, use Teensy LC/3.x to be able to use I2C sensors

5. Configuration

From PC - MSRC gui

Use MSRC to generate config.h. Copy and paste the text to config.h and then flash


Find the Binaries here

Or build msrc_gui:

  • Install QT
  • cd to msrc_gui
  • qmake
  • make

From PC - config.h

Manually change config.h

From transmitter (only Smartport)

The configuration is modified with a lua script (X7, X9, X-lite and Horus with openTx 2.2 or higher)

Copy the file msrc.lua to the SCRIPTS/TOOLS folder. (if using older openTx 2.2 copy to SCRIPTS folder and execute by long press)

If not using lua script comment #define CONFIG_LUA and assign config values in msrc.h

Options:

  • ESC protocol. HobbyWing Platinum V3, HobbyWing Platinum V4/Hobbywing Flyfun V5 or PWM signal
  • Voltage1. Enable/disable analog voltage divider 1
  • Voltage2. Enable/disable analog voltage divider 2
  • Ntc1. Enable/disable analog thermistor 1
  • Ntc2. Enable/disable analog thermistor 2
  • Current. Enable/disable analog current
  • Airspeed. Enable/disable analog airspeed sensor
  • PWM out. Enable/disable analog a PWM signal from RPM values from ESC serial
  • GPS. Enable/disable serial GPS
  • Averaging queue size: 1 to 16
  • Refresh rate (ms): 0 to 1600
  • I2C (x2). Sensor type and address

6. Flash to Arduino

Using Arduino IDE copy folder msrc and open msrc.ino. Select the board and flash

7. OpenTx sensors (Smartport)

The default sensor id is 10. This can be changed with change_id_frsky

Depending on your configuration some the following sensors will be available in Opentx. After configuration go to sensors screen and update with Search new sensors

ESC:

  • ESC RPM: Erpm (0x0b60)
  • ESC voltage: EscV (0x0b50)
  • ESC cell average: VFAS (0x0210)
  • ESC current: EscA (0x0b50)
  • ESC consumption: EscC (0x0b60)
  • ESC temp FET (HW) or ESC temp linear (Castle): EscT (0x0b70)
  • ESC temp BEC (HW) or ESC temp NTC (Castle): EscT (0x0b71)
  • ESC ripple voltage: EscV (0x0b51)
  • ESC BEC voltage: BecV (0x0e50)
  • ESC BEC current: BecC (0x0e50)

Only HW V4: Sensors 5100, 5101 and 5102 contains the ESC signature and raw current. To disable, comment ESC_SIGNATURE in config.h

GPS:

  • GPS Lat/Lon: GPS (0x800)
  • GPS altitude: GAlt (0x820)
  • GPS speed: GSpd (0x820)
  • GPS compass: Hdg (0x840)
  • GPS date/time: Date (0x850)
  • GPS sats: 0x5103
    Calculated:
  • Vario: 0x111
  • Distance to home: 0x5104

Analog:

  • Voltage 1: A3 (0x0900)
  • Voltage 2: A4 (0x0910)
  • Thermistor 1: Tmp1 (0x0400)
  • Thermistor 2: Tmp2 (0x0410)
  • Current: Curr (0x020f)
  • AirSpeed: ASpd (0x0a00)

I2C:

  • Altitude: Alt (0x0820)
  • Temperature: T1 (0x0401, 0x0402)
    Calculated:
  • Vario: 0x110

Some of the sensors have to be adusted in openTx

7.1. Adjust RPM sensor (Erpm)

  • Blades/poles: number of pair of poles * main gear teeth
  • Multiplier: pinion gear teeth

7.2. Adjust voltage sensors (A3, A4)

Remark: Instead of adjusting the sensor in opentx, it is recommended to use VOLTAGE1_MULTIPLIER and VOLTAGE2_MULTIPLIER in config.h to increase the sensor resolution. Though voltage resolution in opentx is 10 times the current resolution, so less critical

Measure the voltage of the battery with a voltmeter and adjust Ratio in A3, A4 sensor

7.3. Adjust analog current sensor (Curr)

Remark: Instead of adjusting the sensor in opentx, it is recommended to use CURRENT_MULTIPLIER in config.h to increase the sensor resolution

If using a hall effect sensor, adjust the ratio: 25.5 x 1000 / output sensitivity (mV/A)

To calculate the battery consumption add a new sensor:

  • Type: Calculated
  • Formula: Consumption
  • Sensor: Curr

7.4 Calculate current consumption

Battery consumption is calculatd since MSRC v0.9

Alternatively can be calculated by adding a calculated sensor in openTx:

  • Type: Calculated
  • Formula: Consumption
  • Sensor: EscA or Curr

8. Images


MSRC on Align 450 connected to Hobbywing V3 Platinum and two thermistors for ESC and motor

9. Video

Video

10. Annex

10.1. ESC protocol specifications Hobbywing

Serial parameters:

  • 19200 bps
  • 1 packet every 20 ms
  • Big endian

Hobbywing V3

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)

Hobbywing V4 V5

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

10.2. ESC protocol specifications Castle Link

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

10.2. ESC protocol specifications Kontronik

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

10.3. Output PWM signal for FBL

For best accuracy PWM signal output for FBL is produced by hardware PWM from serial RPM values. Maximum latency is 40ms

10.4. ADC voltage

To obtain the voltage at the analog pin it is required the ADC bits (b) and the Vref:


10.5. Analog voltage sensors. Voltage divider circuit

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) Arduino can read up to 3.3V/5V and is optimized for signal inputs with 10K impedance

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 Arduino!

10.6. Temperature sensors. Thermistors

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:

10.7. Current

Hall effect

Hall effect sensors. Induced magnetic field is transformed into voltage. They are caracterized by their sensitivity

Shunt resistor

The voltage drop in the shunt resistor is amplified by a differential amplifier to obtain Vo

10.8. Air Speed

Air speed is measured with a differential pressure sensor

Presssure is calculated with the sensor's transfer formula:

And the air speed using the Bernouilli formula:

After 2 seconds the sensor is calibrated to zero

Adjust constants in pressure.h:

  • TRANSFER_SLOPE (B) as per sensor datasheet
  • For fine tuning measure the Vcc on the sensor and adjust TRANSFER_VCC

10.9. Altitude

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

11. Change log

v0.9

  • HW V4/V5. Added throttle threshold and maximum current filters for current sensor. Values for current when throttle is low may not be reliable, depending on model
  • Added consumption calculation. Thanks MJ666
  • Fixed Jeti Ex bug
  • HW V4/V5. Only one HW V4/V5 protocol. Voltage and current sensor parameters to be set manually
  • Added RPM multipliers. Motor poles and gears (for helis)
  • Changed serial drivers timeout to microseconds for fast protocols (e.g. Jeti Ex)
  • Allow additional Rx protocols & boards to be used with serial ESC and GPS. Use software serial only for Rx protocols, not sensors
  • GPS. Added HDOP, sats, vario and distance to home
  • IBUS. Fixed S32 type bug (GPS values)
  • XBUS. Added analog voltage2/ntc2 sensor
  • BMP280 and GPS. Added vertical speed calculation (vario)
  • Current analog. Added consumption
  • Added ESC support for APD F/HV/UHV
  • Added Hitec protocol
  • Fixed Futaba SBUS2
  • Fixed Pololu compilation in Arduino IDE
  • Improved msrc_gui
  • Added support for MS5611

v0.8

  • Added specific drivers for hardware serial and software serial
  • Added msrc_gui to create config.h (not all options are avaiable from gui)
  • Added Rx protocols: Frsky D, Spektrum XBUS, Spektrum SRXL V5, Flysky Ibus, Futaba SBUS2, Multiplex Sensor Bus, Jeti Ex Bus
  • Added support for ATmega328PB, ATmega2560, ATmega32U4, ARM Cortex M0+ and ARM Cortex M4
  • Improved accuracy for PWM input (rpm) measurement
  • Added ESCs support for: Kontronik Kosmic/Kolibri/JivePro
  • Improved current calculation for HW V4/V5

v0.7

  • Added analog airspeed sensor (MPXV7002)
  • Fixed Castle Link bug
  • Removed BMP180
  • Fixed flickering in color lcd displays

v0.6

  • Added GPS serial (BN220, BN880, NEO-M8N,...)

v0.5

  • Added Castle Link Live protocol
  • Hobbywing V4/V5. Improved transformations for voltage and current depending on the model (thanks to Commodore8888)

v0.4.1

  • Fix Horus display

v0.4

  • Changed R3 resistor to 3.3k
  • Support for change_id_frsky to change the sensor id
  • Support for I2C sensors
  • Improved code quality and performance
  • Smartport_library improved performance and abstract from the smartport protocol

v0.3.1

  • Added cell voltage average (HW V4/V5, VFAS sensor)
  • Applied correct transformation for esc voltage, current and temperature (HW V4/V5)
  • Changed averaging type from SMA to EMA
  • Added esc protocol NONE
  • Smartport protocol. Minor improvements

v0.3

  • Esc current sensor (EscA) added (HW V4/V5, 80A or higher)
  • Averaging telemetry added
  • Voltage2 sensor changed from A3 to A4
  • Ntc2 sensor changed from Tmp1 to Tmp2
  • Averaging governor added
  • Refresh rate and averaging added to lua config script

11. Support

For issues use github:

Issues

For questions use the forums:

RCGroups

Helifreak

Openrcforums

If you want to add support for new receiver protocol or new sensor, ask for it

12. Acknowledgements

  • Commodore8888 (Helifreak)
  • MikeJ (Helifreak)

About

Multi Sensor Arduino for RC - FrSky D, SmartPort, XBUS, SRXL, IBUS, SBUS, Multiplex Sensor Bus, Jeti Ex Bus, Hitec

License:GNU General Public License v3.0


Languages

Language:C++ 91.2%Language:Lua 5.9%Language:C 2.8%Language:QMake 0.2%