Nick, roll and yaw oXs sensor as input for Taranis

Development & General Chat for the superb openxvario project.

Moderator: rainer

Post Reply
Carbo
Posts: 241
Joined: Fri Aug 02, 2013 6:55 pm
Country: -

Nick, roll and yaw oXs sensor as input for Taranis

Post by Carbo » Fri Nov 18, 2016 9:27 pm

FrSky uses a 6DOF Sensor in the Horus. Presumably we will see some applications for this sensor. An oXs with a GY-521 can do the same for Taranis, using mstrens IMU functions, he made for the IMU-Vario. It is an easy build:
GY-521_1.jpg
A 3.3V Z-diode in VCC is presumably not necessary, but it does not hurt. The oXs is connected to the S.Port pin, GND and VCC in the module bay. oXs transmits nick, roll and yaw in Accx, Accy and Accz fields. Nick and Roll give -9.81 to +9.81 and yaw -18.0 to + 18.0 (=-180° to +180°).
Mstrens showed me a way to prevent oXs from sending the (unnecessary) Alt and VSpeed fields: In oXs_out_frsky.cpp "VARIO" must be renamed ("VARIOxxx" for example), and oXs will not find the routines for Alt and VSpeed anymore:

// pointer to VSpeed
#if defined(VARIO)
p_measurements[1] = &mainVspeed ;
#else
p_measurements[1] = &no_data ;
#endif

To find the new sensors we need a bound RX with telemetry online.
If the scale field in the Input mask in OpenTX is set to 10 for nick and roll and 18 for yaw, we have 100% range for the 3 axis as inputs.
Scale.png
Scale.png (8.99 KiB) Viewed 1819 times
A bad short movie shows the channels 10-12 moving with the TX, my wrist did not allow more here, but the 3 channels move indeed from -100 to +100.

The oXs_config.h file works with oXs 7.0:
oXs_config.zip
(3.83 KiB) Downloaded 18 times

User avatar
jhsa
Posts: 16453
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Nick, roll and yaw oXs sensor as input for Taranis

Post by jhsa » Fri Nov 18, 2016 11:03 pm

Hmmm, ok, But what is that supposed to do? Is it supposed to connect to the taranis? How?
Or am I missing something? ;)

João

EDIT: Just watched the video, sorry..
But still, how does it connect to the Taranis? I2C? Trainer?
EDIT 2: Ahh, ok, it looks like it is S.Port, and then the values used as input..
It might have some delay though.. :(
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW

Carbo
Posts: 241
Joined: Fri Aug 02, 2013 6:55 pm
Country: -

Re: Nick, roll and yaw oXs sensor as input for Taranis

Post by Carbo » Sat Nov 19, 2016 10:16 am

jhsa wrote:It might have some delay though.. :(
The delay is surprisingly low and the resolution is really good. You can use it as an additional 3D input device for Taranis. E.g. control a camera gimbal or control 3 different GVars in flight by tilting and rotating the TX. Maybe there are a lot of other possibilities, maybe not, we will see.

If one uses the Acc fields already in openXsensor for transmitting data from the RX, this change gives another sensor ID for the ACC TX sensor:

In oXs_out_frsky.h:
#define DATA_ID_ACC 0xBA // (it was 0x1B)

User avatar
jhsa
Posts: 16453
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Nick, roll and yaw oXs sensor as input for Taranis

Post by jhsa » Sat Nov 19, 2016 10:37 am

Thank you.
Could this be also sent with the D protocol?
I'm interested in this but on other platforms, like the Ar9x board, 9xtreme and 9XR-PRO. But with Ersky9x of course.

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW

Carbo
Posts: 241
Joined: Fri Aug 02, 2013 6:55 pm
Country: -

Re: Nick, roll and yaw oXs sensor as input for Taranis

Post by Carbo » Sat Nov 19, 2016 11:05 am

jhsa wrote:Could this be also sent with the D protocol?
Presumably yes, but i am not sure, because i have no experience with Hub-protocol. Mstrens is the dev and knows exactly.


User avatar
jhsa
Posts: 16453
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Nick, roll and yaw oXs sensor as input for Taranis

Post by jhsa » Sat Nov 19, 2016 11:26 am

Thank you. Waiting for his answer then :)

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW

mstrens
Posts: 1056
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: Nick, roll and yaw oXs sensor as input for Taranis

Post by mstrens » Sat Nov 19, 2016 11:59 am

Yes, normally oXs can send fields Acc X, Y and Z for Hub protocol too
In the config file you just have to specify which oXs data are used to fill Acc X,Y and Z.
You can select pitch, roll and yaw if you have a IMU.

User avatar
jhsa
Posts: 16453
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Nick, roll and yaw oXs sensor as input for Taranis

Post by jhsa » Sat Nov 19, 2016 2:33 pm

Thanks Guys

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW

User avatar
MikeB
9x Developer
Posts: 14282
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset

Re: Nick, roll and yaw oXs sensor as input for Taranis

Post by MikeB » Sat Nov 19, 2016 7:04 pm

Note that if you use this on the SPort of the XJT, so the radio sees the data, the SPort packets will also be sent by the XJT to the receiver and output on the SPort of the receiver.

Mike.
ersky9x/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

Carbo
Posts: 241
Joined: Fri Aug 02, 2013 6:55 pm
Country: -

Re: Nick, roll and yaw oXs sensor as input for Taranis

Post by Carbo » Sat Nov 19, 2016 8:00 pm

Tomorrow i will do some more tests with an additional GPS inside the TX. I expected, that the sensors answer the polls from the S.Port master. I did not expect, that the polled sensor data is sent to RX, but i will look at it, when i continue testing.

User avatar
MikeB
9x Developer
Posts: 14282
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset

Re: Nick, roll and yaw oXs sensor as input for Taranis

Post by MikeB » Sat Nov 19, 2016 9:12 pm

The SPort is a bus. The XJT polls for data to send to the Rx and the Rx polls for data to be sent to the XJT. Both relay data from the other. This is how the UART devices work, one at each end, and also how the configuration for the S6R receiver works over the air.

Mike.
ersky9x/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

Carbo
Posts: 241
Joined: Fri Aug 02, 2013 6:55 pm
Country: -

Re: Nick, roll and yaw oXs sensor as input for Taranis

Post by Carbo » Sat Nov 19, 2016 10:15 pm

My theory was, that the XJT and the RX are part of the bus infrastructure and the TX firmware polls ultimately the sensors directly. So it would not matter, where on the bus the sensors answer. When i used the LUA-script for the S6R configuration, the datarate seemed to be much lower as the usual S.Port speed. I assumed, this communication is independent from sensor polling. At least the TX onboard sensors worked as expected. I will try tomorrow a fullhouse openxsensor (vario, airspeed, GPS, voltage) together with a TX onboard openxsensor with roll, nick, yaw and GPS (different sensor ID). There will be a lot of stress on the bus.

User avatar
MikeB
9x Developer
Posts: 14282
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset

Re: Nick, roll and yaw oXs sensor as input for Taranis

Post by MikeB » Sat Nov 19, 2016 10:42 pm

The LUA script works by providing SPort packets that are picked up by the XJT and sent to the Rx and then the S6R, and then the S6R responds as though it is on the SPort and sends a packet back to the Tx. This probably is slower as data goes in both directions.
The Tx firmware does no polling of its own, the SPort is completely driven by the XJT and receiver.

Mike.
ersky9x/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

Carbo
Posts: 241
Joined: Fri Aug 02, 2013 6:55 pm
Country: -

Re: Nick, roll and yaw oXs sensor as input for Taranis

Post by Carbo » Sun Nov 20, 2016 2:38 pm

Here is the fullhouse test with 5Hz GPS, vario, airspeed, battsensor, glider performance measurement airborne
1Hz GPS and tracker inside TX.

The performance of VSpeed is still maximum (most important for me), and the other sensors run also at their foreseen data rate. There seems to be no slow down, neither on airborne part of the sensors, nor on TX side. I had to allow "multiple instances" in sensor search, to find the additional sensors (despite different sensor IDs). Presumably everybody knew, but me;) Overall the performance of S.Port telemetry is incredible.
https://youtu.be/p-cMhuEyLfk

Here is the raw sensor list, the sensornames need to be changed, to be assignable.
2oXs_raw.png

Carbo
Posts: 241
Joined: Fri Aug 02, 2013 6:55 pm
Country: -

Re: Nick, roll and yaw oXs sensor as input for Taranis

Post by Carbo » Tue Jan 24, 2017 9:32 pm

Here is a capture of RX and TX SPort. TX-SPort sensors do not show up at the RX-SPort. So i do not see a problem, to use sensors at the TX SPort (with different sensor IDs). There seems to be no disadvantage, beside the lower polling rate with increasing number of sensors. I wonder, if a special sensor ID is used for the UART communication.
Attachments
RX_TX.png

User avatar
MikeB
9x Developer
Posts: 14282
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset

Re: Nick, roll and yaw oXs sensor as input for Taranis

Post by MikeB » Tue Jan 24, 2017 10:37 pm

Carbo wrote:TX-SPort sensors do not show up at the RX-SPort.
Are you sure? We have the Tx acting as a SPort sensor to send configuration data to the S6R.

Mike.
ersky9x/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

Carbo
Posts: 241
Joined: Fri Aug 02, 2013 6:55 pm
Country: -

Re: Nick, roll and yaw oXs sensor as input for Taranis

Post by Carbo » Wed Jan 25, 2017 6:59 am

To be sure, i will repeat with S6R, RX and TX sensors and LUA configuration script running. Hopefully i will fathom that SPort thing one day.

Carbo
Posts: 241
Joined: Fri Aug 02, 2013 6:55 pm
Country: -

Re: Nick, roll and yaw oXs sensor as input for Taranis

Post by Carbo » Thu Jan 26, 2017 8:04 pm

MikeB wrote:
Carbo wrote:TX-SPort sensors do not show up at the RX-SPort.
Are you sure? We have the Tx acting as a SPort sensor to send configuration data to the S6R.
You are right, of course. When i tried with a S6R neither my sensor nor the LUA-script worked. When i changed the sensor ID from 0x1B (28) to 0x67 (8) everything worked. But as you predicted, my ACC x/y/z sensor connected to the TX SPort showed up also on the RX SPort. 0.06 s later :D

The LUA-S6R script in the TX asks the RX with sensor ID 0x1B and the RX answers with sensor ID 0xBA (27). There is also the sensor ID 0x98 (25) with RSSI, RxBt (and SWR?), that appears only on the TX SPort although it transmits RX-data (RxBt). I do not know if sensor ID 0x39 (26) is also foreseen for something special, but i decided to stay away from IDs >24 with my oXs sensors. I still do not see a disadvantage in this procedure, although the uplink has some additional traffic to handle. What do you think, Mike?

Attached is a log with 15 s RX / TX SPort data
S6R_ACC_LUA_RX_TX15s.zip
(129.26 KiB) Downloaded 12 times
.

User avatar
MikeB
9x Developer
Posts: 14282
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset

Re: Nick, roll and yaw oXs sensor as input for Taranis

Post by MikeB » Thu Jan 26, 2017 8:14 pm

At present avoid IDs 0x00 to 0x0A and 0x17 to 0x1B (I haven't included the check bits).
0x19 is used by the PowerBox.

Mike.
ersky9x/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

Carbo
Posts: 241
Joined: Fri Aug 02, 2013 6:55 pm
Country: -

Re: Nick, roll and yaw oXs sensor as input for Taranis

Post by Carbo » Sun Mar 26, 2017 11:19 am

With a 5V regulator (+fuse) the oXs GPS can be plugged in with a 3,5mm phone jack. Because there is a risk of shorts plugging it, Tip is VCC, Ring is SPort and sleeve is GND. Sensor ID 17 (not 0x17) is used in my case and OpenTX does now log 2 GPS, pilot and plane. Everything connected to the modul port and switched on/off with external modul in
TX_GPS.jpg
The tracks can be transmitted over GPS-Visualiser to google earth, after copying them from the log-csv and change the blank between latitude and longitude into a comma. The first line needs to be 'latitude,longitude,elevation' for the plane track (with GAlt) and 'latitude,longitude' for the pilot track (usually no altitude needed, pilot and track clamped to ground ;)) GPS-Visualiser has an input for the track colour.
2GPS.png
http://rcdiy.ca/ is actually working on his GPS LUA script to enable the use of a second GPS. The features will be:

-- Reads coordinates from up to 2 GPS sensors
-- One GPS on the aircraft and an optional GPS on the Tx (Home position)

-- Displays "Flying" / "Heading" direction of aircraft
-- Displays "Find" direction from home location to aircraft location
-- Displays "Home" direction from aircraft location to home location
-- Displays "Turn" turn angle to come home

-- Displays distance "Home" from aircraft along the ground
-- Displays "Trip", distance flown ground track, altitude not accounted for
-- "Trip" is the accumulated ground track distance between GPS coordinates

-- Speaks "Flying" direction of movement, only when moving
-- Speaks "Turn" turn direction to come home, up to 90 degrees

This will allow cross country tasks without additional hardware, but additional safety bringing the plane home in case of lost sight.
Last edited by Carbo on Sun Mar 26, 2017 3:13 pm, edited 1 time in total.

User avatar
jhsa
Posts: 16453
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Nick, roll and yaw oXs sensor as input for Taranis

Post by jhsa » Sun Mar 26, 2017 12:22 pm

Cross country? Using satellite RF for controlling the aircraft, or in a very small country?? :mrgreen:

The phrase "Cross Country" together with the phrase "model aircraft" worries me a bit.. :o :)

João

My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW

User avatar
Kilrah
Posts: 9021
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: Nick, roll and yaw oXs sensor as input for Taranis

Post by Kilrah » Sun Mar 26, 2017 2:20 pm

In full scale aviation cross country = going/landing somewhere else than you started from (as opposed to local flight)...

As seen above, the pilot follows in a car or something.

Carbo
Posts: 241
Joined: Fri Aug 02, 2013 6:55 pm
Country: -

Re: Nick, roll and yaw oXs sensor as input for Taranis

Post by Carbo » Sun Mar 26, 2017 2:53 pm

Yep, it is a new challenge. Not only the plane moves, the pilot moves also. It can be a straight line or also something else (triangle, square). The pilot himself should be the only one emitting CO2, so no cars or trucks should be used. The most challenging thing is to cover places where you cannot land, in my case there are wineyards. If you do not find thermals, you have a problem (or you have start the enginge ;)).

Here is a walking test with rcdiy's script:
GPSt.jpg
GPSt.jpg (8.37 KiB) Viewed 484 times
Another thing is the fact, that the plane knows, where the pilot is. But there is no application right now, but ............

User avatar
jhsa
Posts: 16453
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Nick, roll and yaw oXs sensor as input for Taranis

Post by jhsa » Sun Mar 26, 2017 3:44 pm

Ahh, ok.. Missed that part, apologies :)

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW

Post Reply

Return to “OpenXVario - an open source vario supported by the open source firmwares!!”

Who is online

Users browsing this forum: No registered users and 2 guests