Active Roll Stabilization Build Thread

The Rocketry Forum

Help Support The Rocketry Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

awseiger

Well-Known Member
Joined
Jun 16, 2012
Messages
649
Reaction score
1
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).

IMG_0617.jpg

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.

[video=youtube;YeeUWyU8e8U]https://www.youtube.com/watch?v=YeeUWyU8e8U&feature=youtu.be[/video]

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 ;)
 
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.
 
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...
 
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.

IMG_0620.jpg IMG_0623.jpg

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...

[video=youtube;BJXNvjblifc]https://www.youtube.com/watch?v=BJXNvjblifc&feature=youtu.be[/video]

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.
 
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:
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...
 
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:
https://psas.pdx.edu/news/2010-10-17-2


-->MCS


.
 
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 :D

[video=youtube;BYK_cVKLp4A]https://www.youtube.com/watch?v=BYK_cVKLp4A&feature=youtu.be[/video]
 
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.
 
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
 
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.
 
Back
Top