
30th January 2018, 02:33 AM
#121
Originally Posted by SparkyVTFlyer
Radians on roll.
That's the important one.
While your plot looks wild, it is hard to tell anything from just pitch and yaw. When I plot that for my data it also looks odd but the tilt tracks the quaternion version perfectly till ejection. (I computed tilt from pitch and yaw by squaring them and taking the square root of the sum.)

2nd February 2018, 04:28 AM
#122
I was out for a few days on vacation. I got back and tried your formula with interesting results. I combined pitch and yaw a few different ways and they showed the same thing.
I'm thinking there might be a speed limit to your method. I tried it for one flight that only rolled twice on the way to apogee and your equations were spot on. However, when I tried it with a flight that spun like a top on the way up, then it quickly got out of control. See the plots below.
I'm not sure what to make of it.
Sparky
NAR #85720, L3
Tripoli #12111, L3
2017 Impulse: 86,532 Ns
2017 Flights: 26

3rd February 2018, 02:09 AM
#123
When you say "spun like a top" it makes me wonder about the roll and sample rates. The simplified algorithm I presented (not mine, found in another thread here) uses the small angle approximation.

3rd February 2018, 06:49 AM
#124
Peak roll rate was about 1400 degrees per second. Average roll rate through most of the flight was about 700 dps. Datarate at about 800 samples per second through the flight.
Small angle approximation should be fine within 10 degrees for sine and 14 degrees for tangent, and none of the individual cycle rotations violated either. So I'm not totally sure why it isn't working.
I also take advantage of small angle approximation. Combined with fixedpoint math I got around 400450 cycles per second written to an SD card on an ATMega328. I double that now with the Teensy3.5, which pretty much pegs the output data rate of my sensor package (even over I2C).
Sparky
NAR #85720, L3
Tripoli #12111, L3
2017 Impulse: 86,532 Ns
2017 Flights: 26

3rd February 2018, 03:53 PM
#125
While that is good enough to keep the small angle approximation error below 1%, there is still some error. I have no idea what the limitations of this algorithm are as I haven't found any description of its derivation.

5th February 2018, 09:41 PM
#126
Originally Posted by SparkyVTFlyer
Peak roll rate was about 1400 degrees per second. Average roll rate through most of the flight was about 700 dps. Datarate at about 800 samples per second through the flight.
Small angle approximation should be fine within 10 degrees for sine and 14 degrees for tangent, and none of the individual cycle rotations violated either. So I'm not totally sure why it isn't working.
I also take advantage of small angle approximation. Combined with fixedpoint math I got around 400450 cycles per second written to an SD card on an ATMega328. I double that now with the Teensy3.5, which pretty much pegs the output data rate of my sensor package (even over I2C).
Here is an example of using your Arduino code with my Arduino Nano, MPU6050 (16G) , ADXL78 (70G) and BMP180 for recording data.
I also had a 70cm GPS transmitter using Lora SX1278 with Adafruit Feather M0+ Cortex processor.
John

12th February 2018, 09:59 PM
#127
Originally Posted by UhClem
While that is good enough to keep the small angle approximation error below 1%, there is still some error. I have no idea what the limitations of this algorithm are as I haven't found any description of its derivation.
As far as I know it basically assumes that the "arc" of the angle is the same length as the opposite side of the right triangle, so the length of the arc (also known as the angle in radians) is equal to the sine of the angle. As the name would suggest, it's good for small angles but not large ones 0.4% error at 9 degrees or 1.6% at 18 (unless my math is wrong, which is totally possible).
In other news I was able to get a bit done on the ArdIU code this weekend more specifics when I have a few minutes. Basically, I have the basic groundwork set up for datalogging, including a handy template function that should be able to write any datatype to the SD. I still have a while to go, but I'm making progress!
<shamelessadvertising>Speaking of progress, there are still 3 unclaimed beta boards...</shamelessadvertising>
NAR #104043
crmrc.org
Similar Threads

By mitokondri in forum Rocketry Electronics and Software
Replies: 0
Last Post: 4th February 2016, 12:20 AM

By thobin in forum Yard Sale / Wanted
Replies: 4
Last Post: 2nd June 2014, 08:50 PM

By conman13 in forum Yard Sale / Wanted
Replies: 0
Last Post: 8th May 2014, 02:30 AM

By goose_in_co in forum Rocketry Electronics and Software
Replies: 18
Last Post: 20th July 2011, 11:01 PM

By konkers in forum Recovery
Replies: 37
Last Post: 12th June 2007, 06:13 PM
Posting Permissions
 You may not post new threads
 You may not post replies
 You may not post attachments
 You may not edit your posts

Forum Rules
 
