Results 1 to 13 of 13

Thread: Active Roll Stabilization Build Thread

  1. #1
    Join Date
    17th June 2012
    Location
    Durham, NH
    Posts
    531

    Active Roll Stabilization Build Thread

    Not sure if this should go here, but It's electronic.

    So before attempting active stability in all 3 axes, I figured I would start with just roll. On hand, I had an arduino chip, supporting hardware, a cheap servo, and a 2-axis magnemometer (compass, essentially).

    Click image for larger version. 

Name:	IMG_0617.jpg 
Views:	35 
Size:	182.9 KB 
ID:	90864

    And here's a test of the magnemometer controlling the position of my servo. It's a bit jumpy, but as far as I see, jumpy is better than slow-to-react. Plus, this is stabilizing roll, so if it goes totally nuts, not much bad will come of it.



    This will all be housed in a hunk of 2.6" BT on top of my Aerotech Initiator. This rocket is quite stable, and thus the decrease in stability from a single fin sticking out the side *shouldn't* cause giant problems. Not to mention I'm shoving a ton of weight up front and launching on an F.

    Still to do is putting the whole thing in a rocket... Aka the hard part
    Level 1 - CTI H133 in an Estes Partizon

    Blog:
    http://awseiger.wordpress.com/

  2. #2
    Join Date
    13th February 2012
    Posts
    2,679
    What orientation will the magnetometer be in? Remember that magnetic fields in the US are typically around 60 degrees from horizontal, so the magnetometer will be more sensitive to weathercocking than roll. Also, a slow-to-react controller is better than a jumpy controller. You may get wild oscillations from the oversensitivity.
    2013 impulse burned: 5205.1 Ns
    2013 impulse lined up to burn: ~56,445 Ns

  3. #3
    Join Date
    17th June 2012
    Location
    Durham, NH
    Posts
    531
    I was thinking about just keeping it vertical. I'll do some experiments tonight to see if tilt of the rocket would cause a large problem.

    if not, I have a 3-axis rate Gyro/accelerometer coming in the mail. That should do it :-D

    I'll also do some work tonight to figure out corrections. I forgot that this system could become an un-damped harmonic oscillator...
    Level 1 - CTI H133 in an Estes Partizon

    Blog:
    http://awseiger.wordpress.com/

  4. #4
    Join Date
    17th June 2012
    Location
    Durham, NH
    Posts
    531

    It looks like a rocket part now!

    Some new developments...

    Mounted the stabilizer fin to the rocket, mounted the motor, batteries, etc. Batteries are 4v NICAD cells from old, trashed laptop batteries from work. The fin is just epoxied to the servo horn.

    Click image for larger version. 

Name:	IMG_0620.jpg 
Views:	25 
Size:	82.4 KB 
ID:	91016 Click image for larger version. 

Name:	IMG_0623.jpg 
Views:	21 
Size:	116.8 KB 
ID:	91018

    Also, here's it working. I have refined the code past this point to read in the position when it is switched on, and to maintain that heading. Also, when the rocket tilts, it simply changes the heading a bit, but the roll controller still works. If the rocket weathercocks, it will just roll a little bit along with it. I am not worried about this...



    And I do realize the fin is going the wrong way... This has also been fixed. There is also alot less movement in the fin. I did the math out, and I shouldn't need any more than 10 degrees or so to make the rocket spin wildly.

    The only problem I have now is when the angle "rolls over" from -180 back to zero, it causes a giant flip in the servo arm. In flight, this would cause a catastrophic failure and some crazy oscillations. Any ideas on this would be appreciated.
    Level 1 - CTI H133 in an Estes Partizon

    Blog:
    http://awseiger.wordpress.com/

  5. #5
    Join Date
    18th January 2009
    Posts
    308

  6. #6
    Join Date
    18th January 2009
    Location
    Austria
    Posts
    297
    Quote Originally Posted by awseiger View Post
    The only problem I have now is when the angle "rolls over" from -180 back to zero, it causes a giant flip in the servo arm. In flight, this would cause a catastrophic failure and some crazy oscillations. Any ideas on this would be appreciated.
    It should jump from ~ -180° to ~ +180°. If it jumps to zero, check your calculations.

    You can't prevent the jump to happen in the beginning, but you can detect it and compensate it. This could look similar to this:
    Code:
    #define FLIP_OVER_THRESHOLD 90.0	//in degrees
    
    double GetRollAngle(double mag_x, double mag_y)
    {
    	double roll_angle;
    	static double last_roll_angle = 0;
    	static double roll_angle_offset = 0;
    	
    	// Convert readings and do the trigonometry
    	// roll_angle = ...
    	
    	if(roll_angle < -FLIP_OVER_THRESHOLD && last_roll_angle > FLIP_OVER_THRESHOLD)
    	{
    		roll_angle_offset += 360.0;
    	}
    	else if(roll_angle > FLIP_OVER_THRESHOLD && last_roll_angle < -FLIP_OVER_THRESHOLD)
    	{
    		roll_angle_offset -= 360.0;
    	}
    	
    	last_roll_angle = roll_angle;
    	
    	return (roll_angle + roll_angle_offset);
    }
    Some notes:
    This is just an example to illustrate the idea, it should work but it is unlikely that it is the ideal implementation for your system.

    As long as your rocket doesn't rotate further than 90° between two readings, this algorithm will catch the transition, from 90° to 180° it might catch it - above that, it will fail. Your sampling rate should ensure that you don't come even remotely close to that, not just for this reason.

    This algorithm can wind up. If you rotate the rocket 10 times clock wise while on the ground, it will rotate 10 times counter clock wise in the air. This is not necessarily ideal. For certain controller types it should be no problem to limit the offset to +/- 720° for example, but you have to be careful. PD and PID controllers for example won't like the resulting jumps. You can, of course, use a more elaborate scheme to address this issue.

    If your memory size supports it, record raw measurement data during the flight. This can help a lot to understand what happened during the flight.


    Reinhard
    Last edited by Reinhard; 22nd July 2012 at 03:58 PM. Reason: fixed sign error and explanation

  7. #7
    Join Date
    17th June 2012
    Location
    Durham, NH
    Posts
    531
    This makes complete sense... I'll have to throw this algorithm in tomorrow and see if it works.

    I wish I had a wind tunnel to test this thing out in...
    Level 1 - CTI H133 in an Estes Partizon

    Blog:
    http://awseiger.wordpress.com/

  8. #8
    Join Date
    21st January 2011
    Location
    Midwest/Great Lakes
    Posts
    149
    PSAS may have the most advanced active stabilization system in non-Pro land. I have no affiliation other than interested obsever.

    Their web site is full of great ideas, photos, and video:
    http://psas.pdx.edu/news/2010-10-17-2


    -->MCS


    .

  9. #9
    Join Date
    17th June 2012
    Location
    Durham, NH
    Posts
    531
    UPDATE: It Flew!!!

    It seems as if I need to make my stabilizing fin angle itself a little more, or be a bit bigger. My cameras caused enough roll force that I couldn't counteract it. Also, the magnemometer seems to drift a bit. It was dead straight when I left it, but then it sat on the pad and at takeoff it was at a bit of an angle, causing the rocket to spin wildly one direction. As you can see in the video, however, my system corrected for it

    Level 1 - CTI H133 in an Estes Partizon

    Blog:
    http://awseiger.wordpress.com/

  10. #10
    Join Date
    18th January 2009
    Location
    Austria
    Posts
    297
    Interesting Video. Did you log any data?

    Reinhard

  11. #11
    Join Date
    17th June 2012
    Location
    Durham, NH
    Posts
    531
    No, depressingly I didn't add that functionality into my design. There isn't much room in my payload bay to do anything like that, unless I had a custom board spun.
    Level 1 - CTI H133 in an Estes Partizon

    Blog:
    http://awseiger.wordpress.com/

  12. #12
    Join Date
    18th January 2009
    Location
    Austria
    Posts
    297
    A little serial memory chip, for example in a SOIC-8 package, and some thin wires can be fit almost everywhere. The result may look cobbled together, but it will still do its job.

    Reinhard

  13. #13
    Join Date
    17th June 2012
    Location
    Durham, NH
    Posts
    531
    I'll have to see if I have one of those in my box of parts. At the moment, it doesn't look like I do... Logged data would be quite nice.
    Level 1 - CTI H133 in an Estes Partizon

    Blog:
    http://awseiger.wordpress.com/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •