Hi all,

I just bought an FrSky Taranis for my quad copter and needed to get the Mavlink data up on the Taranis LCD telemetry display. So here is my solution using a Teensy3.1 as a converter between MavLink and the S.Port on FrSky X8R.

See attached file below...

Views: 307015

Attachments:

Reply to This

Replies to This Discussion

doh, I thought/hoped it would be something very simple like this.

Just been reading:

http://forums.gpsreview.net/discussion/13651/how-to-convert-gps-coo...

I guess the info was already mentioned somewhere on ardupilot this blog or maybe in the readme files, but me being over eager to to get it runnning

At the moment LogAnalyzer in Mission Planner is reporting a Vcc problem.....

Log File C:/Program Files/Mission Planner/logs/2014-10-05 13-01-19.log
Size (kb) 1994.859375
No of lines 27919
Duration 0:15:02
Vehicletype ArduCopter
Firmware Version V3.1.5
Firmware Hash 3c57e771
Hardware Type APM 2
Free Mem 1091
Skipped Lines 0

Test: Autotune = UNKNOWN - No ATUN log data
Test: Balance/Twist = GOOD -
Test: Brownout = GOOD -
Test: Compass = GOOD - No MAG data, unable to test mag_field interference

Test: Dupe Log Data = GOOD -
Test: Empty = GOOD -
Test: Event/Failsafe = GOOD -
Test: GPS = GOOD -
Test: Parameters = GOOD -
Test: PM = FAIL - 1 slow loop lines found, max 126.77% on line 27919
Test: Pitch/Roll = GOOD -
Test: Thrust = GOOD -
Test: VCC = FAIL - VCC below minimum of 4.6v (4.434v)

and in a different log.

Test: VCC = WARN - VCC min/max diff 0.335v, should be <0.3v

could this be cause by the teensy taking some of the power ?

I am using the power module that came with my ardupilot 2.6 kit.

Hi all

Here goes the version 0.1 of my telemetry script for Taranis X9D for APM/PixHawk Flight Controllers.

The interface between the APM/PixHawk and the FrSky X series receiver is a small Teensy 3.1 board running a custom protocol translator from Mavlink to SPort telemetry.

Almost all the parameters on the normal telemetry screens of the Taranis X9D are correct, with some exceptions (RPM and T2), that combine multiple values on a single field.

Cell ( Voltage of Cell=Cells/(Number of cells). [V]) 
Cells ( Voltage from LiPo [V] )
A2 ( HDOP value * 25 - 8 bit resolution)
A3 ( Roll angle from -Pi to +Pi radians, converted to a value between 0 and 1024)
A4 ( Pitch angle from -Pi/2 to +Pi/2 radians, converted to a value between 0 and 1024)
Alt ( Altitude from baro. [m] )
GAlt ( Altitude from GPS [m])
HDG ( Compass heading [deg]) v
Rpm ( Throttle when ARMED [%] *100 + % battery remaining as reported by Mavlink)
VSpd ( Vertical speed [m/s] )
Speed ( Ground speed from GPS, [km/h] )
T1 ( GPS status = ap_sat_visible*10) + ap_fixtype )
T2 ( Armed Status and Mavlink Messages :- 16 bit value: bit 1: armed - bit 2-5: severity +1 (0 means no message - bit 6-15: number representing a specific text)
Vfas ( same as Cells )
Longitud ( Longitud )
Latitud ( Latitud )
Dist ( Will be calculated by FrSky Taranis as the distance from first received lat/long = Home Position )
Fuel ( Current Flight Mode reported by Mavlink )
AccX ( X Axis average vibration m/s?)
AccY ( Y Axis average vibration m/s?)
AccZ ( Z Axis average vibration m/s?)

This telemetry screen tries to report the data received in a easy way. 

Due to the restricted screen space I didn't make descriptive labels on the values but tried to group them on a logical (to me) way.

Also, this script relies heavily on voice alerts and prompts.

I use a two switch combination (SWE and SWF) to change flight modes, that gives me the 6 flight modes. The combination of the 2 switches activate six Logical Switches on the Taranis - The Logical Switches MUST be L1 to L6.

I could not find a way to have the Flight Controller report the settings for some parameters, like which 6 Flight Modes are defined so the script must be updated with the Flight Mode Numbers that correspond to each Logical Switch.


But the screen deserves some explanation, so here goes:

A-Current Flight Mode Active as reported by the Flight Controller. If blinking the vehicle is not Armed.
B-Current Flight Mode Timer. Each Flight Mode has its own timer. The timer stops if the vehicle is not Armed.
C-Radio Transmitter Battery Voltage.
D-RSSI value
E-Estimated Flight Time. 
F-Available Vehicle battery capacity. 
E and F are inter related. When the vehicle is armed, the script checks the voltage and calculates the number of cells and estimates the status of the vehicle battery. This is then combined with the available capacity reported by the flight controller.
E is calculated based on the rate of decay of reported capacity.
These are highly experimental and not to be considered real, but simple estimates.
G-Actual consumed power in mAh
H-Actual power output in Watts (VxA)
I-Reported Flight Battery Voltage
J-Reported Flight Battery Current
K-Vertical Gauge that shows the actual Throttle output (not the Throttle stick position but the actual output reported by the Flight Controller)
L-Vehicle Height
M-Max Height
N-Vertical speed
O-Vertical Speed Indicator (up or down)
P-Heading
Q-Roll angle
R-Armed Time Timer - Starts and stops when the Vehicle is armed/disarmed
S-Speed
T-Pitch Indicator. When over 45 degrees the indicator is replaced by 3 up or 3 down indicators
U-GPS Indicator. Three different graphics dependent on GPS status, 3D, 2D or no status
V-HDop indicator. Blinks when over 2
W-Number of reported satellites
X-Distance to home (Distance to the point the Taranis received a good satellite fix)
Y-Heading to home (Heading to the point the Taranis received a good satellite fix)


When changing flight modes the radio says Flight Mode X engaged when the switch is moved and Flight Mode X active when the Flight Controller reports it. If there is a mismatch or the Flight Controller doesn't not report the Flight Mode as set by the switches you'll be notified.



Any questions, please feel free to ask.

There are some minor issues that I must check.

It will be available later on my github

https://github.com/lvale/MavLink_FrS...ion/Model_Name

and the entire project:

https://github.com/lvale/MavLink_FrSkySPort

Thanks to all that are involved in this project, specially Rolf that started it and Christian that picked up and got things rolling :) 

Did you solved the GPS issue ???

Hi

No GPS issues. Reported Position on the Taranis is absolutely the same on APM Planner/Mission Planner. after converting from degrees, minutes, seconds, thousands of a second to decimal degrees.

GPS coordinates N and W

Are you using the Teensy 3.1 ??

One question about the 2 Timer in your Script.

Do the Function "setTimer" overwrite the T1 and T2 Timer on the Taranis ?

Actually i set the 2 Timer in Companion with TH% and L8. Must i clear this values or on which value i have to set it ?

Christian

Hi Christian

Both timers are fully controlled by the script, and throw away what you might have set on the menus.

Timer 0  is the Started when Arm is active and stopped when disarmed.

Timer 1 is used by each Flight Mode. So when Armed is Active, and Stabilize is active Timer 1 represents Stabilize Time, if you switch to Alt Hold Timer 1 shows time in Alt Hold. If you revert to Stabilize mode the timer gets back to stabilize mode timer with the previous accumulated value. 

This is valid for any flight mode, so in practice there are 17 timers which are represented by timer1 :)

Logically if DISARMED they are stopped but show their previous value.

settimer = { mode, start, value, countdownBeep, minuteBeep, persistent }

settimer.mode = 54

settimer.start = 480

settimer.value = 0

settimer.countdownBeep = 2

settimer.minuteBeep = 1

settimer.persistent = 0

model.setTimer(1,settimer)

 

The code for the read

datastring = { mode, start, value, countdownBeep, minuteBeep, persistent }

datastring = model.getTimer(1)

lcd.drawText(30, 7, datastring.mode, 0 )

lcd.drawText(42, 7, datastring.start, 0 )

lcd.drawText(60, 7, datastring.value, 0 )

lcd.drawText(85, 7, datastring.countdownBeep, 0 )

The settings for the model on the Taranis are very simple:

Thanks for the fast reply.

I use the Timer 1 exactly with the same function in your script but realized that with a Logical Switch which gets the status from the APM.

When the Timer are fully conntrolled by the Script i will set both Timer in Companion to "OFF" .

Thanks a lot

Christian

There is no need to have the timers at any setting, because the script disregards completely what has been set by the user.

I could save that state on init, but didn't see the need for that.

Come on guys !!!

This also works with a ATmega 328P

There is absolutely no need to waste a MK20DX256VLH7 !!!

Reply to Discussion

RSS

© 2019   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service