dgatf / msrc Goto Github PK
View Code? Open in Web Editor NEWMulti Sensor for RC with RP2040 - FrSky D, SmartPort, XBUS, SRXL, IBUS, SBUS, Multiplex Sensor Bus, Jeti Ex Bus, Hitec
License: GNU General Public License v3.0
Multi Sensor for RC with RP2040 - FrSky D, SmartPort, XBUS, SRXL, IBUS, SBUS, Multiplex Sensor Bus, Jeti Ex Bus, Hitec
License: GNU General Public License v3.0
I have made a telemetry log with my heli on the bench.
RPM=0, lipo voltage 23.0V all the time.
The telemetry values look strange.
Here is the log:
https://drive.google.com/file/d/1Tes9JJHe6Kpq8qTiYFw9zbXp99co7ER8/view?usp=sharing
Talon 90
Radiomaster TX16S
OpenTX 2.3.10
Hi Daniel - any chance that you could add in the number of satelites fixed onto into the data stream either transmitted as SATS or as TMP2 please. The GPS widget that I was hoping to try using uses the number of satelites to start GPS logging etc.
Cheers,
Mike
I don't know if the esc sends a value since I don't have an official telemetry documentation.
According to Spirit it should.
http://manual.spirit-system.com/index.php?title=Castle_Telemetry
Castle Creations Talon 90
Pololu ATmega328PB
Hello, please do you plan to add also a BST (TBS Crossfire) telemetry protocol? It would be very helpful for me and probably also for other FPV fans not using FC.
Found a small bug in Xbus.cpp.
Airspeed should look like this, speed written in lower case and a semicolon was missing at the end.
#if CONFIG_AIRSPEED
static uint16_t maxAirspeed = 0;
airspeed.update();
uint16_t airSpeed = round(*airspeed.valueP());
xbusAirspeed.airspeed = __builtin_bswap16(airSpeed);
if (airSpeed > maxAirspeed)
{
maxAirspeed = airSpeed;
xbusAirspeed.maxAirspeed = __builtin_bswap16(airSpeed);
}
Hello,
Is it possible to add CRSF telemetry for use with ExpressLRS and TBS devices ?
Thanks,
Pierre
Can the GPS speed be converted from KTS to KM/H, and what is the current GPS refresh rate? Is it possible to increase the refresh rate to 10HZ per second!
Greetings from eastern countries, best wishes!
Thanks !
I am trying to use it on a Talon 90, Horus X12 Express, I have some issues with the sensors not reading correctly, using with a 6s setup Voltage varies between 24,23,22v. When the motor is running i get values jumping all over the place like, 13, 18, 16 ,25,23, all at the same throttle input. I am somewhat new to Opentx so i dont know what i can do to fix this issue.Also i am using an arduino nano is what i had on hand for this project. I can try to help solve this issue
Arduino: 1.8.13 (Windows Store 1.8.42.0) (Windows 10), Board: "Pololu A-Star 328PB, 5V, 16MHz"
sketch\srxl.cpp: In member function 'void Srxl::send()':
srxl.cpp:78:40: error: 'xbusEsc' was not declared in this scope
memcpy(buffer + 3, (uint8_t *)&xbusEsc, sizeof(xbusEsc));
^~~~~~~
sketch\srxl.cpp:78:40: note: suggested alternative: 'Xbus_Esc'
memcpy(buffer + 3, (uint8_t *)&xbusEsc, sizeof(xbusEsc));
^~~~~~~
Xbus_Esc
xbus.cpp:4:16: error: 'Xbus_Esc Xbus::xbusEsc' is not a static data member of 'class Xbus'
Xbus_Esc Xbus::xbusEsc;
^~~~~~~
sketch\xbus.cpp: In static member function 'static void Xbus::i2c_request_handler()':
xbus.cpp:56:36: error: 'xbusEsc' was not declared in this scope
memcpy(buffer, (uint8_t *)&xbusEsc, sizeof(xbusEsc));
^~~~~~~
sketch\xbus.cpp:56:36: note: suggested alternative: 'Xbus_Esc'
memcpy(buffer, (uint8_t *)&xbusEsc, sizeof(xbusEsc));
^~~~~~~
Xbus_Esc
sketch\xbus.cpp: In member function 'void Xbus::update()':
xbus.cpp:128:5: error: 'xbusEsc' was not declared in this scope
xbusEsc.RPM = __builtin_bswap16(esc.read(CASTLE_RPM));
^~~~~~~
sketch\xbus.cpp:128:5: note: suggested alternative: 'Xbus_Esc'
xbusEsc.RPM = __builtin_bswap16(esc.read(CASTLE_RPM));
^~~~~~~
Xbus_Esc
exit status 1
'xbusEsc' was not declared in this scope
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Hi, I need to convert an analog signal from a temperature sensor to the xbus port of my spektrum receiver. I will use a little Trinket 3v as arduino board.
Do you have an example code in order to understand how to use functions from xbus.h?
I'm a liitle bit lost at the moment ^^
Thank you
Heli spooled up on the ground.
EscA shows around 133A.
Current clamp shows around 10A.
EscA is completely off.
Hobbywing Platinum V4 80A
Arduino Mini 3.3V/8MHz
RadioMaster TX16S
OpenTX 2.3.14
Hello,
I uploaded the firmware and the arduino is pafaitement recognized in the telemetry in "auto-config".
In config.h I have activated "#define CONFIG_ESC_PROTOCOL PROTOCOL_HW_V4_HV".
however, when I plug the "hobbywing rpm" wire into my Arduino, I have no data going back.
cordially
In xbus.h etc use i2c_t3.h in place of wire.h tested with Teensy LC and 3.2 and AR8020T
#if defined(__MKL26Z64__) || defined(__MK20DX128__) || defined(__MK20DX256__) || defined(__MK64FX512__) || defined(__MK66FX1M0__)
#include <i2c_t3.h>
#else
#include <Wire.h>
#endif
In xbus.cpp line 125 change to this
#if defined(__MKL26Z64__) || defined(__MK20DX128__) || defined(__MK20DX256__) || defined(__MK64FX512__) || defined(__MK66FX1M0__)
#if CONFIG_ESC_PROTOCOL != PROTOCOL_NONE && CONFIG_ESC_PROTOCOL != PROTOCOL_PWM && CONFIG_ESC_PROTOCOL != PROTOCOL_CASTLE
ESC_SERIAL.begin(19200);
ESC_SERIAL.setTimeout(ESCSERIAL_TIMEOUT);
#endif
Wire.begin(I2C_SLAVE, XBUS_AIRSPEED, XBUS_BATTERY,I2C_PINS_18_19, I2C_PULLUP_EXT, 400000);//Begin mask XBUS_AIRSPEED end mask XBUS_BATTERY
Wire.onRequest(i2c_request_handler);
I2C0_RA = XBUS_RPM_VOLT_TEMP << 1;
#endif
I am on NANO 328p in USB, GPS BN220 and flysky receiver.
I noticed 2 problems with the GPS.
As soon as I define "GPS true" in config.h, all the sensors are at zero in my telemetry. (In ibus.cpp, when I put // in front of the LAT, LON and ALT lines, the other sensors work again) Could the problem come from the "IBUS_TYPE_S32" format?
Moreover when I connect the Tx GPS on the PIND7, my card is blocked. Do you think of a solution?
Merci
ESC voltage is sent as Esc amperage.
Castle Creations Talon 90
Pololu ATmega328PB
Hi,
On OpenTx 2.3.7 the lua script bring the Jumper T16 to freeze.
I am using an Arduino Pro Mini 3.3V/8Mhz with voltage1 and rpm sensors configured.
Rpm signal goes from a HW phase sensor to pin 8.
Rpm telemertry works up to about 2000 rpm, above 2000 rpm it drops to zero.
The signal on pin 8 is still there (about 1700 Hz).
I am running the same configuration with an 5V/16Mhz Arduino Pro Mini without problems.
Is the 3.3V/8Mhz too slow (I cannot believe that) ?
Any chance to get FPort2 protocol supported ? That being bidirectional would allow to use a single board both for telemetry and ppm demux (obviously with limitations related to available pins)
Hi,
I tried to compile your project and arduino says, that project won't fit... it's 106% of capacity. Arduino Mini Pro here 5V 16MHz 328P. I don't need so many fancy features (specific temperature sensors), so can I shrink it down easily without heavy modifications?
Thanks in advance,
Vit
I saw that for Hobbywing there is a start-up sequence of the data being sent for my HW v4 130A
I get the following sequence: 9B 3 E8 1 B 41 1E 92 0 21 21 B9
Is it possible to determine the ESC version based on the initial package load being send?
Hello,
I tried to read the signal from the tachometer socket of the CDI of an RC petrol engine.
On the oscilloscope, It is normal square wave signal with 35% duty cycle and 5vpp signal.
The useful frequency range goes from 7 hz to 370 hz approximately (420 rpm to 22,200 rpm).
From 250hz upwards msrc sends the right value in telemetry, below 250hz (15.000rpm) approximately the value always drop to 0 rpm.
Why?
Settings: Multipl: 1, Blade: 1
Is the system set up for a higher frequency range produced by the ESCs?
Is a hw fequency multiplier necessary?
Thank you
Rosario
I have connected a BN220 to an Arduino Pro Mini (3.3V).
The TX pin of the BN220 is connected to pin RX0 of the arduino. VCC is connected to VCC and GND to GND.
I enabled debug in MSRC.
My output is continuously:
14:17:26.886 -> 14:17:26.886 -> 3 RMC: 14:17:26.886 -> 4 VTG: 14:17:26.886 -> 1 GGA: 7(6)00, 14:17:26.886 -> 2 GLL: 14:17:26.886 -> 3 RMC: 14:17:26.886 -> 4 VTG: 14:17:26.886 -> 1 GGA: 14:17:27.123 -> 3 RMC: 14:17:27.161 -> 4 VTG: 14:17:27.198 -> 1 GGA: 7(6)00, 14:17:27.375 -> 2 GLL: 14:17:28.128 -> 3 RMC: 14:17:28.166 -> 4 VTG: 14:17:28.204 -> 1 GGA: 7(6)00, 14:17:28.349 -> 2 GLL: 14:17:29.166 -> 3 RMC: 14:17:29.166 -> 4 VTG:
Watching the GPS leds, I do not notice a GPS fix.
Can I troubleshoot somehow the Arduino Pro Mini has the correct code and whether GPS to Arduino connectivity is all ok?
Hi,
I've got back into the hobby after letting it sit for 10 years.
I've got old frsky receivers with the pre-sbus telemetry protocol.
Any chance to get support for that?
BR,
Markus
Hi,
I want use 3 voltage sensor.
May I add a new sensor (how) on A4 or A5 or A6 input on Arduino Pro Mini with a resistive partitor?
if it is not possible in the current configuration, is it possible to replace it in place of T2?
I hope this is the right place to ask the question
Thank for your attention
Rosario
Hello Daniel,
came across a link to your sensor on RC Network.
Since I fly Jeti, I wanted to build a sensor with 2 voltage measurements as a start.
So Arduino Pro Mini 3.3V, 8MHz flashed with the configured SW and plugged into the RX.
The sensor does not appear in the telemetry selection of the transmitter.
To exclude a defect on the Arduino board, I have then aud the board a sketch of RCT
which works. Do you have a tip that the sensor works?
Actually I wanted to use the sensor with an ESC. But I am not yet so far.
I am still relatively inexperienced in Arduino history.
Jürgen
Just thought I'd mention that you can get MSRC's S-port working over a single GPIO if you set PIN_SMARTPORT_RX and PIN_SMARTPORT_TX to the same pin. Works great and simplifies the circuit just a bit.
Hope this helps.
Screen is flickering, script not useable.
Radiomaster TX16S
OpenTX 2.3.10
line 6 in file "sensor.h":
#include "formatData.h"
but this .h file cannot be found in the source code
I have following V/C-sensor http://www.rctimer.com/rctimer-voltage-amp-current-sensor-90a-w-xt60-kit-p0476.html
It has a INA169 that provides the measured output. Can I just connect the V to the Voltage1 pin, the A to the Current pin and GND to GND on the Mega2560?
Does it work out of the box with the V and C measuring code?
Next test:
Voltage and current values can be trimmed to a usable accuracy by adjusting the divisor and ampGain in escHW4.h useful accuracy by adjusting the divisor or ampGain. Remaining measurement deviations probably come from the ESC.
I can't measure RPM at the moment, but it could be correct. After further fine tuning of the coefficients
I will test the combination in flight.
Attached is a short LOG file.
Issue: No telemetry data Kontronik Jive.
TX: Frsky X10S Express
RX: X4R (Smartport)
I have Smartport running, configured it with the lua script to use the Kontronik Protocol.
That works.. got all sensors discovered.
Connected the Jive to RX0 of my Nano.
I see there is data coming in.. but not passed thru to smartport..
I know the telemetry port works, because I use a Jlog S32 logger to read out it's telemetry.
Am I missing something?
I also tried a Pro Mini 328 @ 3.3v 8Mhz as suggested but nothing..
Smartport YES - Kontronik readings NO
When using msrc_gui_win.exe to select the altimeter to generate Config, the "I2C_" field is missing, which will cause a compilation error.
English is not good, hope you can understand
HI,
My radio is Radiomaster, receiver X8R Fr sky.
Board Arduino Pro Mini Atmega 328P
I have problem. I run lua script and all time is connecting on screen.
What I do wrong?
Robert
I have a feature request which might be useful when considering creation of an all-in-one sensor board.
SoftSerial library is available for the Arduino Pro Mini, so maybe it might be possible to integrate softserial to unused pins to allow both GPS and ESC via a serial connection?
Any thoughts?
I quickly tested the "BMP280 module 3.3V (6 pins, I2C/SPI)" with GPS and voltage.
I have 3 additional sensors which appear TEMP1, 00Gp and Vspd).
Temp1 displays 40° and the others are at 0.
GPS and voltage are OK.
I connected the BMP280 to the arduino nano at 3.3v, GND, A4 and A5. Did I forget something?
You are right, only when the motor is is running the ESC is transferring data.
That is not right, but the format is different when the motor is stopped.
I took your sniffer and as you can see in the logfile there are two different data lines if the motor is not runnig and only one if the motor is running.
Maybe you could optimize the data processing?
Fails on line 307 "lcd.drawText(410, 220, config.i2c1Address, getFlags(17))" with error "bad argument #3 to 'drawText' (string expected)" (and other couple of lines)...
In your table I notice:
ESC serial RX1
GPS RX2
PWM out 7
S.port/SRXL 4/12
XBUS/sensor SDA20
XBUS/sensor SCL21
What pins do you mean on a Mega2560 Pro Mini board because I do not find these pin references on my board
https://pg-cdn-a2.datacaciques.com/00/NDAy/19/01/02/r4tvb3u808096tbn/ab2ddc6ef3b8ad95.jpg
I want to connect a current sensor to A6.
The current scale of the sensor is 19.1A/V.
I have entered a scale of 19.1 in OpenTX.
Then I tested msrc by applying voltage to pin A6.
These were the measurements:
1V 0.7A (expected 19.1A)
2V 1.4A (expected 38.2A)
I had to enter a scale of 484 to get the correct current displayed.
Arduino Pro Mini 3,3V/8MHz
Sensors HW3, current
Radiomaster TX16S
OpenTX 2.3.11
Hello,
on teensy 3.2 (master branch) after enabling Castle Smartport isn't working anymore, and for example the current sensor activated before is also lost.. So you also can't change it back via lua script.
Thanks
Christian
The final goal is to use a HW V4 120A LV with the AR8020T, everything with the latest firmware.
I use an ATmega328P Arduino Pro Mini 3.3V.
#define RX_PROTOCOL RX_XBUS
/* Sensors */
#define CONFIG_ESC_PROTOCOL PROTOCOL_HW_V4_LV
I tried with
/* Use library I2C_T3 for Teensy LC/3.X */
//#define I2C_T3_TEENSY
or without, but nothing works.
So I tried without the ESC connected and
#define SIM_SENSORS
but I still receive no ESC data at my transmitter. The AR8020T internal altitude, BEC voltage and Flight Log are working.
Hi, when i try to use "Curr" with an analog signal on ADC pin20 (on my TeensyLC) i get really bad quantization setps, like only a few steps for 0-100%..
BUT when i simply swap the pins in the MSRC code at constants.h (pin20 and 26 in my case) to use the current sensor on the Airspeed-input instead of the Current-input it is quantisizing fine like it should.
I mean without any hardware change.
any idea if that could be a bug beside the hardware which is working good with [email protected] Smartport, HobbyWing ESCv4, BMP280, 2xTemp analog.
For the current - since the Hobbywing 40A ESC has no built in shunt - I now use 1mOhm shunt resisor with a LM358N as diff-amp placed in the GND Cable, 0-40A equals 0-1.6V and it is working good, no bad noise with 1u and 220n caps, nice level shifing on a scope. Shunt is ok i guess.
btw: my ACS711EX hall current sensor was not usable because of far to heavy noise on the signal line on my try
AND: Great project!! everything is working superb after dealing with many many issues but that was perhaps all my fault and mainly Pololu 5V related
regards
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.