Brainstorm: oXs as wing level indication system
Moderator: rainer
Brainstorm: oXs as wing level indication system
Hi
I am learning to fly precision aerobatic in F3A competitions
One of the critical issues if I like to be perfectly precise, is that the wing mast be completely leveled before each maneuver.
I am wondering if it possible to build a system that will help identify if the wing are really(!) leveled using the oXs
I understand that the oXs already support gyros.
However I will need some kind of beeping (like a variometer?) to know if the wing bank to the right or left and in what level.
Any suggestion how to build such a system?
Offer
I am learning to fly precision aerobatic in F3A competitions
One of the critical issues if I like to be perfectly precise, is that the wing mast be completely leveled before each maneuver.
I am wondering if it possible to build a system that will help identify if the wing are really(!) leveled using the oXs
I understand that the oXs already support gyros.
However I will need some kind of beeping (like a variometer?) to know if the wing bank to the right or left and in what level.
Any suggestion how to build such a system?
Offer
Re: Brainstorm: oXs as wing level indication system
Acc for level, not gyro is needed for that task.
KH
KH
Re: Brainstorm: oXs as wing level indication system
Combination of both is needed (well, ideally a full IMU) in dynamic flight.
Better start from a multicopter flight controller if you want to do that, actually it would most likely be plug and play if you get an FC with telemetry output.
Better start from a multicopter flight controller if you want to do that, actually it would most likely be plug and play if you get an FC with telemetry output.
Re: Brainstorm: oXs as wing level indication system
When a IMU (6050) is connected to oXs, oXs can transmit the Roll angle.
I presume this is exactly what you are asking.
Playing some sound should be configured (or programmed) on Tx side
I presume this is exactly what you are asking.
Playing some sound should be configured (or programmed) on Tx side
Re: Brainstorm: oXs as wing level indication system
oXs transmitting roll angels sound like a good start!
Now how do I translate this to an efficient sound indicator?
Calling the angel each second would be annoying,
I thought about something similar to the beeping of variometer that change the beep in relation to the acceleration rate.
But start only when I am in +/- 5 degrees
Should I write something like this in a lua script?
Now how do I translate this to an efficient sound indicator?
Calling the angel each second would be annoying,
I thought about something similar to the beeping of variometer that change the beep in relation to the acceleration rate.
But start only when I am in +/- 5 degrees
Should I write something like this in a lua script?
Re: Brainstorm: oXs as wing level indication system
OpenTX allows to select any sensor as vario source. Vario sound is perfect configurable in radio settings setup (pitch at zero, pitch at max) and in the telemetry page (range and behaviour near zero). IMO it should work out of the box as desired.
Re: Brainstorm: oXs as wing level indication system
Or just set up a logical switch on the value and use that to trigger playback of whatever you want to play.
Re: Brainstorm: oXs as wing level indication system
Both ways can be tested in no time. IMO the vario solution offers a nearly analog feedback. BTW the OpenTX vario implementation is far the best integrated vario available. bsongis did a great job, i am always grateful, when i hear other brands
Re: Brainstorm: oXs as wing level indication system
I will try it.
Thank for the useful suggestions
As someone said, "other tx are good only for basic flying"
Thank for the useful suggestions
As someone said, "other tx are good only for basic flying"
Re: Brainstorm: oXs as wing level indication system
It possible to see the accelerometer values in the serial monitor?
Without connecting a receiver, just to verify the mpu connected ok
Without connecting a receiver, just to verify the mpu connected ok
Re: Brainstorm: oXs as wing level indication system
Yes,
just uncomment the following line in the file oXs_config.h
//#define DISPLAY_ACC_OFFSET // used ONLY in order to display the acceleration offset on pc terminal; KEEP AS COMMENT once offsets have been setup
You will get the raw values given by accelerometers
Re: Brainstorm: oXs as wing level indication system
Tried it, but no display is written to the serial monitor apart from initialization logs .
No other debugging method found
No other debugging method found
Re: Brainstorm: oXs as wing level indication system
Just did a short test here, works, no problem
Did you
- un-commet this line? #define USE_6050 // uncomment this line if a IMU 6050 is connected
- connect INT? Interrupt from 6050 has to be connected to Arduino pin 2 or pin 3
Did you
- un-commet this line? #define USE_6050 // uncomment this line if a IMU 6050 is connected
- connect INT? Interrupt from 6050 has to be connected to Arduino pin 2 or pin 3
Re: Brainstorm: oXs as wing level indication system
Thanks,
It found out that I had issue with the interrupt electrical connection.
Now I can see the data running on the serial monitor.
Connecting the sport of the X8R, cause the serial monitor to stop showing the data (is it normal?), and the transmitter does not show the additional telemetry.
I connected the sport to pin 4, vcc,gnd
Any way to debug it?
It found out that I had issue with the interrupt electrical connection.
Now I can see the data running on the serial monitor.
Connecting the sport of the X8R, cause the serial monitor to stop showing the data (is it normal?), and the transmitter does not show the additional telemetry.
I connected the sport to pin 4, vcc,gnd
Any way to debug it?
Re: Brainstorm: oXs as wing level indication system
When you activate the debug function, oXs should send some data to the PC terminal and in most cases (could depend on the debug options that are activated) still handle the telemetry protocol with the Rx. If there are to many messages sent to the PC terminal, it could be that the telemetry flow is perturbed.
Can you put here (or in a private message) the oXs_config.h file that you use.
In order to check your config file, please confirm that you use the latest version on Github (version 8) and that you are have only connected a Gy-86 to the pro mini.
Can you put here (or in a private message) the oXs_config.h file that you use.
In order to check your config file, please confirm that you use the latest version on Github (version 8) and that you are have only connected a Gy-86 to the pro mini.
Re: Brainstorm: oXs as wing level indication system
I use am using:
Arduino Uno
MPU-6050 board (the only sensor connected)
X8R FrSky receiver
Taranis Plus with openTx 2.1.8
Attach the config file
Re: Brainstorm: oXs as wing level indication system
Can you try with the config file here.
I modified some lines:
There was a pin defined for PPM signal. It was the same pin number as the pin defined for IMU6050 interrupt. I can't be. I put the line as comment because you do not use PPM function.
The line with vario was commented. Probably this is not allowed because initially IMU6050 support had been added in order to get faster reaction on the vario. So even if you do not use the vario keep it in the config.
I activated next lines in order to ask oXS to send pitch, roll and yaw (otherwise, oXs does not send those data)
#define ACCX_SOURCE PITCH // select between TEST_1, TEST_2, TEST_3, GLIDER_RATIO , SECONDS_SINCE_T0 ,AVERAGE_VSPEED_SINCE_TO , VOLT_1, VOLT_2, VOLT_3, VOLT_4, VOLT_5, VOLT_6, PITCH, ROLL , YAW, ADS_VOLT_1, ADS_VOLT_2, ADS_VOLT_3, ADS_VOLT_4
#define ACCY_SOURCE ROLL // select between TEST_1, TEST_2, TEST_3, GLIDER_RATIO , SECONDS_SINCE_T0 ,AVERAGE_VSPEED_SINCE_TO , VOLT_1, VOLT_2, VOLT_3, VOLT_4, VOLT_5, VOLT_6, PITCH, ROLL , YAW, ADS_VOLT_1, ADS_VOLT_2, ADS_VOLT_3, ADS_VOLT_4
#define ACCZ_SOURCE YAW // select between TEST_1, TEST_2, TEST_3, GLIDER_RATIO , SECONDS_SINCE_T0 ,AVERAGE_VSPEED_SINCE_TO , VOLT_1, VOLT_2, VOLT_3, VOLT_4, VOLT_5, VOLT_6, PITCH, ROLL , YAW, ADS_VOLT_1, ADS_VOLT_2, ADS_VOLT_3, ADS_VOLT_4
I put next line as comment because it is used only to get the offsets.
#define DISPLAY_ACC_OFFSET // used ONLY in order to display the acceleration offset on pc terminal; KEEP AS COMMENT once offsets have been setup
I put DEBUG line as comment.
This config expect that the pin INTA from gy-86 is connected to arduino pin 3.
Try this config and I expect it should just work fine.
I modified some lines:
There was a pin defined for PPM signal. It was the same pin number as the pin defined for IMU6050 interrupt. I can't be. I put the line as comment because you do not use PPM function.
The line with vario was commented. Probably this is not allowed because initially IMU6050 support had been added in order to get faster reaction on the vario. So even if you do not use the vario keep it in the config.
I activated next lines in order to ask oXS to send pitch, roll and yaw (otherwise, oXs does not send those data)
#define ACCX_SOURCE PITCH // select between TEST_1, TEST_2, TEST_3, GLIDER_RATIO , SECONDS_SINCE_T0 ,AVERAGE_VSPEED_SINCE_TO , VOLT_1, VOLT_2, VOLT_3, VOLT_4, VOLT_5, VOLT_6, PITCH, ROLL , YAW, ADS_VOLT_1, ADS_VOLT_2, ADS_VOLT_3, ADS_VOLT_4
#define ACCY_SOURCE ROLL // select between TEST_1, TEST_2, TEST_3, GLIDER_RATIO , SECONDS_SINCE_T0 ,AVERAGE_VSPEED_SINCE_TO , VOLT_1, VOLT_2, VOLT_3, VOLT_4, VOLT_5, VOLT_6, PITCH, ROLL , YAW, ADS_VOLT_1, ADS_VOLT_2, ADS_VOLT_3, ADS_VOLT_4
#define ACCZ_SOURCE YAW // select between TEST_1, TEST_2, TEST_3, GLIDER_RATIO , SECONDS_SINCE_T0 ,AVERAGE_VSPEED_SINCE_TO , VOLT_1, VOLT_2, VOLT_3, VOLT_4, VOLT_5, VOLT_6, PITCH, ROLL , YAW, ADS_VOLT_1, ADS_VOLT_2, ADS_VOLT_3, ADS_VOLT_4
I put next line as comment because it is used only to get the offsets.
#define DISPLAY_ACC_OFFSET // used ONLY in order to display the acceleration offset on pc terminal; KEEP AS COMMENT once offsets have been setup
I put DEBUG line as comment.
This config expect that the pin INTA from gy-86 is connected to arduino pin 3.
Try this config and I expect it should just work fine.
- Attachments
-
- oXs_config.h
- (15.62 KiB) Downloaded 274 times
Re: Brainstorm: oXs as wing level indication system
Hi msterns
The updated config file indeed help to get the data into the Taranis telemetry! thanks!!!!
If I can suggest some improvement for next versions
> The line with vario was commented.
> Probably this is not allowed because initially IMU6050 support had been added in order to get
> faster reaction on the vario. So even if you do not use the vario keep it in the config.
So can it be changed to:
#define VARIO_OR_GYRO // set as comment if there is no vario **and no Gyro**
#define VSPEED_SOURCE FIRST_BARO_OR_FIRST_GYRO
It is not clear that you need to change the PPM pin if you don't care about it
my suggestion is to have a main section that will globally enable/disable feature, and later, if the feature enable change specific setting
// --------- Enable / Disable features ---------
#define ENABLE_SPORT TRUE/FALSE
#define ENABLE_PPM TRUE/FALSE
#define ENABLE_VARIO TRUE/FALSE
#define ENABLE_VOLTAGE TRUE/FALSE
...
// --------- 1 - Telemetry protocol ---------
... specific setting here
// --------- 2 - Serial data pin choice ---------
... specific setting here
// --------- 3 - PPM settings ---------
... specific setting here
// --------- 4 - Vario settings ---------
... specific setting here
// --------- 6 - Voltages & Current sensor settings ---------
... specific setting here
The updated config file indeed help to get the data into the Taranis telemetry! thanks!!!!
If I can suggest some improvement for next versions
> The line with vario was commented.
> Probably this is not allowed because initially IMU6050 support had been added in order to get
> faster reaction on the vario. So even if you do not use the vario keep it in the config.
So can it be changed to:
#define VARIO_OR_GYRO // set as comment if there is no vario **and no Gyro**
#define VSPEED_SOURCE FIRST_BARO_OR_FIRST_GYRO
It is not clear that you need to change the PPM pin if you don't care about it
my suggestion is to have a main section that will globally enable/disable feature, and later, if the feature enable change specific setting
// --------- Enable / Disable features ---------
#define ENABLE_SPORT TRUE/FALSE
#define ENABLE_PPM TRUE/FALSE
#define ENABLE_VARIO TRUE/FALSE
#define ENABLE_VOLTAGE TRUE/FALSE
...
// --------- 1 - Telemetry protocol ---------
... specific setting here
// --------- 2 - Serial data pin choice ---------
... specific setting here
// --------- 3 - PPM settings ---------
... specific setting here
// --------- 4 - Vario settings ---------
... specific setting here
// --------- 6 - Voltages & Current sensor settings ---------
... specific setting here
Re: Brainstorm: oXs as wing level indication system
Fine that it works.
I will see what I can easily do.
I also think about splitting the config file in 2 parts (basic and advanced).
Did you had a look at the file oXs_config_description.h because normally every thing is explained there.
I will see what I can easily do.
I also think about splitting the config file in 2 parts (basic and advanced).
Did you had a look at the file oXs_config_description.h because normally every thing is explained there.
Re: Brainstorm: oXs as wing level indication system
This how the test setup looks like...
Re: Brainstorm: oXs as wing level indication system
Hi
what is the units that I get?
Is it possible to get them degree?
I did found a comment said: "Can calculate Roll and Pitch for attitude indicator (using a Lua script on OpenTx)"
but could note find any referece
what is the units that I get?
Is it possible to get them degree?
I did found a comment said: "Can calculate Roll and Pitch for attitude indicator (using a Lua script on OpenTx)"
but could note find any referece
Re: Brainstorm: oXs as wing level indication system
Internally (in oXs) roll and pitch are calculated in 1/10 of degree.
oXs send them currently in 1/10 of degree too but as they are put in the fields Acc, I expect that openTx divides the value by 100.
So could it be that you get the values in 10 of degree?
If so I could make a change in order to multiply the value by 10 before sending it.
About Lua script, did you search on google.
Here a link I found.
https://gist.github.com/xdandys/67612d119be6e0b4841e
oXs send them currently in 1/10 of degree too but as they are put in the fields Acc, I expect that openTx divides the value by 100.
So could it be that you get the values in 10 of degree?
If so I could make a change in order to multiply the value by 10 before sending it.
About Lua script, did you search on google.
Here a link I found.
https://gist.github.com/xdandys/67612d119be6e0b4841e
Re: Brainstorm: oXs as wing level indication system
Hi
Where will be a good place in the code to put the x10 multiplayer?
I also like to add a button that calibrate the x & y to zero degree, what of the program arguments do I need to play with?
Thanks,
Offer
Where will be a good place in the code to put the x10 multiplayer?
I also like to add a button that calibrate the x & y to zero degree, what of the program arguments do I need to play with?
Thanks,
Offer
Re: Brainstorm: oXs as wing level indication system
In file oXs_imu.cpp you have
pitch.value = 10*atan(gravity.x / sqrt(gravity.y*gravity.y + gravity.z*gravity.z)) * radians_to_degrees; // Pitch in 1/10 of degree
roll.value = 10*atan(gravity.y / sqrt(gravity.x*gravity.x + gravity.z*gravity.z)) * radians_to_degrees; // Roll in 1/10 of degree
If you replace 10 by 100, roll and pitch will be in 1/100 of degree and so I expect that openTx will display them in degree.
I presume that if you calibrate once the offsets of the accelerometers, than results should be OK. You have for sure then to take care the the IMU device is fixed in the proper position in the airplane.
To calibrate the offsets, please follow the process given in file oXs_config_description.h
pitch.value = 10*atan(gravity.x / sqrt(gravity.y*gravity.y + gravity.z*gravity.z)) * radians_to_degrees; // Pitch in 1/10 of degree
roll.value = 10*atan(gravity.y / sqrt(gravity.x*gravity.x + gravity.z*gravity.z)) * radians_to_degrees; // Roll in 1/10 of degree
If you replace 10 by 100, roll and pitch will be in 1/100 of degree and so I expect that openTx will display them in degree.
I presume that if you calibrate once the offsets of the accelerometers, than results should be OK. You have for sure then to take care the the IMU device is fixed in the proper position in the airplane.
To calibrate the offsets, please follow the process given in file oXs_config_description.h
Re: Brainstorm: oXs as wing level indication system
Hi
I installed the system on a small f3a plane (sebart wind s 50)
And here are the conclusion,
The barometer system that connected now to the gyro, gives very identify able sound
I can config it to fine tune the level of warning i like to get when the wings are not level
With different sound when they bank to the right or to the left
However the oxs work only on level flight!
When starting a loop (large one) it looks like the additional G force affect the measurements
Any idea why??
Offer
I installed the system on a small f3a plane (sebart wind s 50)
And here are the conclusion,
The barometer system that connected now to the gyro, gives very identify able sound
I can config it to fine tune the level of warning i like to get when the wings are not level
With different sound when they bank to the right or to the left
However the oxs work only on level flight!
When starting a loop (large one) it looks like the additional G force affect the measurements
Any idea why??
Offer
Re: Brainstorm: oXs as wing level indication system
Any Idea if this can be fixed?
Re: Brainstorm: oXs as wing level indication system
the 6050 is running his own code in order to provide the 3D orientation of the sensor.
This code uses as well the gyro as the accelerometer informations.
Gyros are good for quick changes but are known to drift over time.
Accelerometers data are then used to realign the position. In order to achieve this, it assumes that over a long term (some seconds?) the sum of all accelerations is just equal to gravity. Probably that when you make a large loop, this assumption is false due to centrifugal force.
I do not have access to the internal code of the mpu 6050 so I can't change it.
Note: I am still surprised of your issue because I do not understand why a loop would have an impact on the roll. I would expect an impact on pitch and yaw.
Just to be sure: did you calibrate the Acc offsets as explained in the description of oXs? If not, try to do it; this could perhaps help.
This code uses as well the gyro as the accelerometer informations.
Gyros are good for quick changes but are known to drift over time.
Accelerometers data are then used to realign the position. In order to achieve this, it assumes that over a long term (some seconds?) the sum of all accelerations is just equal to gravity. Probably that when you make a large loop, this assumption is false due to centrifugal force.
I do not have access to the internal code of the mpu 6050 so I can't change it.
Note: I am still surprised of your issue because I do not understand why a loop would have an impact on the roll. I would expect an impact on pitch and yaw.
Just to be sure: did you calibrate the Acc offsets as explained in the description of oXs? If not, try to do it; this could perhaps help.
Re: Brainstorm: oXs as wing level indication system
I will try to re-calibrate an see what happen.
Next week I have competition, so I will not have the time, I will test it the week after.
Thanks
Next week I have competition, so I will not have the time, I will test it the week after.
Thanks