PID Tuning Help

The Rocketry Forum

Help Support The Rocketry Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
You may first want to try stabilizing the roll of the rocket about it's own axis. Then later mix in pitch/yaw. This decouples your problem and it is probably safer initially working with a rocket that will likely just spin fast about it's own axis when something goes wrong.
This does in fact simplify the problem greatly. There is an effect that kicks in when the airframe is rotating that effectively provides a phase shift in where the control needs to be applied. In helicopters this can be up to around a 90 degree shift which really complicates the pitch/yaw control (think that controlling the blade pitch when abeam actually works on the pitch axis). Stopping the roll first eliminates that problem. In reality you can just start all controls up at once and the lower inertia about the roll axis means it stabilises quite quickly unless your control system is really badly wrong.
 
Let me add some more detail about what I would do if/when I attempt rocket control.

I was trying to think of the most simple way to control a rocket without requiring super fast actuation or the complexity of a high order state model. Most likely Yukon doesn't have either and if/when I attempt I probably won't.

A rocket with four controllable fin surfaces would be best for trying to decouple the roll from pitch. I can envision two independent controllers for two independent modes: roll and pitch. Each will get two fins to play with.

As an initial step I would forget about pitch and use two fins on opposite sides to control rotation. Configure these fins to work in opposite directions and they will twist the rocket. With proper control gains this should be able to counteract spin without high speed actuation or sampling. This assumes that your rocket naturally spins at < 1 Hz and you can sample and actuate at >= 10 Hz or so.

Assuming that a successful rotation control was implemented, imagine using the other pair of fins to control only pitch. Configure these two fins to steer in the same direction. First control the rotation so that the pitch fins are perpendicular to the direction in which the pitch needs to change. Then use them to slowly push the nose in that direction.

Essentially the goal is to create two different decoupled modes of the rocket that are controllable and observable. Use the roll to make sure that the pitch is in the right direction and yaw isn't needed. With a three fin rocket the actuation and math would get a little more complex because the alpha/tilt of each fin would be the superposition of the needs of the two modes.

If one wanted to allow the rocket to rotate and still control it to a magic empty spot in the sky, then you have the full complexity of changing pitch and yaw actuation as the rocket rotates. Timing (phase shift you mentioned by @OverTheTop) and actuation bandwidth becomes critical. Start thinking about a 6 degree of freedom controller.

Does anyone know how to insert the official @reference to someone else?

Maybe someday.
 
This does in fact simplify the problem greatly. There is an effect that kicks in when the airframe is rotating that effectively provides a phase shift in where the control needs to be applied. In helicopters this can be up to around a 90 degree shift which really complicates the pitch/yaw control (think that controlling the blade pitch when abeam actually works on the pitch axis). Stopping the roll first eliminates that problem. In reality you can just start all controls up at once and the lower inertia about the roll axis means it stabilises quite quickly unless your control system is really badly wrong.
I agree that being able to correct for the rotation around the main axis does simplify the problem greatly.

But the problem with doing this is that the axial rotation isn't present to be measurable right off the rail. The forces causing rotation are somewhat in proportion to the rocket's velocity and with air resistance.

In contrast, the rocket tilt deflection angle from vertical happens right off the rail when the rocket hits a sideways air current and starts to "weather-vane". The rocket is more prone to "weather-vane" at slower velocities, and the tilt angle accumulates over time. Tilt control, like rotation control is better with higher velocity air flowing over the fins.

Although controlling the rotation first is desirable, it will need to happen throughout the flight unless the initial control of it that fixes stops the rotation completely. And a rotation fix would also require an integral component to integrates the rotational error measurement over time, which is time when the rockets tilt error also needs to be controlled. There's a small window of time when both rotation and tilt need to be controlled. In addition there's also gravity-cause tilt component vector that happens with long burn engines, and is the effect of gravity on the rocket's Cg.

But I do not underestimate the complexity of the multivariable control, especially with the need to determine the precise rotational orientation of the rocket tilt to determine which fins to adjust. While I've designed and tuned dozens of control systems with multiple single control loops and seen numerous analyses for multivariable control in advanced process control text books, I have only done one or two actual multivariable control systems throughout my career. In practice this is very difficult to do robustly.

One thing that might simplify the actual design of such a control system (that doesn't have separate modes of control for tilt and rotation) -- is that rotation might be both more easy to measure and to control throughout the flight. On the other hand, controlling the tilt angle is inherently more difficult to measure and control. The absolute tilt angle with reference to the vertical angle to ground must be deconvoluted from the rotational angle of the rocket's principle axis at every point in time. Then the correction to the tilt angle must be determined by adjusting the relevant fins. A four-fin model would simplify this over a three-fin model, but there's always a time phase angle both in the measurement delay and the time it takes to adjust the fins.

So by default, the rocket tilt control might have an indeterminant solution, and a large time phase shift would make the solution unworkably unstable, and the tilt control would be locked-out until the rotational spin is slow and under control. What this means is that it might not be necessary to have a modal control system decide to do rotational control first to simplify things. The result of having too fast a rotational spin would be that the tilt control is automatically prevented until a reliable tilt measurement is made and that the fin control for it can be safely accomplished.

Another relevant issue that I haven't addressed with this "PID Tuning Help Thread" -- is what are the instruments actually being used to measure the rocket's rotation around it principle axis, as well as for measuring the tilt angle off of vertical? Do instruments actually exist that are affordable to rocketeers that provide data with the resolution and precision to control from? A while ago I saw a demonstration video of some kind of control system that controlled both rotation and vertical tilt but haven't been able to locate it since.

The value to be controlled is the rocket's tilt angle deflection from the vertical, rather than pitch or yaw. But what instrument available to rocket hobbyists can actually measure this to the extent that it can be the basis for control? Its there an affordable "gyroscope" chip with both the precision and the ruggedness to use in high power rocketry where the acceleration can be in excess of 20 G's?

To measure the axial rotation, I'm presuming that a 3-axis accelerometer chip similar to the one that Jolly Logic uses in their Altimeter3 could do the job. When aligned with the z-axis parallel to the rocket's longitudinal axis, the root sum square of the x and y axis acceleration is proportional to the rotation rate. The output of this chip could probably be scaled to the maximum rotation rate that's ever likely to occur.

It would be nice to have a discussion from others on this thread on what they know about measuring rocket tilt angle and rotation. You cannot control what you cannot precisely measure. I'd welcome learning that reliable tilt and rotation instrumentation exists to do the measurement and control, and that I am only badly misinformed about them.
 
The system I use has four canards that do mixed yaw/pitch and roll. Everything is aligned as well as I could do, by hand essentially, but it isn't perfect. Since the motions needed for yaw/pitch control are larger than for roll, at least when the rocket is not vertical, control of yaw/pitch will induce some roll that then has to be corrected. The difficulty is compounded by the fact that yaw/pitch has to be done from one end of the rocket or the other, which is not ideal for roll control in a hobby rocket. All things considered, I'm surprised the system works as well as it does, but splitting up the functions is something to consider.

Jim
 
It would be nice to have a discussion from others on this thread on what they know about measuring rocket tilt angle and rotation. You cannot control what you cannot precisely measure. I'd welcome learning that reliable tilt and rotation instrumentation exists to do the measurement and control, and that I am only badly misinformed about them.

Dan, maybe you saw one of my flight videos? I've been flying a stabilization system for several years now. My last 10 flights have been pretty good. Here are a couple of videos. There's a description of the system in one of them.

"Gyros" such as the MPU 6050 have limitations, but it is possible to use them in rockets,

Jim




 
But the problem with doing this is that the axial rotation isn't present to be measurable right off the rail. The forces causing rotation are somewhat in proportion to the rocket's velocity and with air resistance.
I apologise for my earlier post that stated it is good to get the roll out first. It could have been worded better. All the control systems can be initiated at the same time. For the case where the rocket exits the rail it will indeed start off with zero roll, and just need minor corrections during flight.

In my incarnation of the Vertical Trajectory System the boost phase has the fins in the neutral position. This is because the acceleration being experienced by the avionics is outside the specifications of the gyros and accelerometers. I activate my control system at burnout, steering to the vertical vector at that point. This avoids having to use control inputs that have accelerometers and gyros working outside their specifications. The roll does get cancelled quite quickly, helping pitch and yaw get everything going in the right direction.

FYI, here are some details on my VTS:
https://forum.ausrocketry.com/viewtopic.php?f=56&t=5324
Its there an affordable "gyroscope" chip with both the precision and the ruggedness to use in high power rocketry where the acceleration can be in excess of 20 G's?
There are really quite inexpensive accelerometers capable of measuring up to 200G, and the typical gyros found in rocketry electronics are capable of measuring up to about 2000deg/s before pegging out.

It would be nice to have a discussion from others on this thread on what they know about measuring rocket tilt angle and rotation.
I'd welcome learning that reliable tilt and rotation instrumentation exists to do the measurement and control
There are a couple of commercial products that do provide tilt measurements for rocketry. Check out the TeleMega by Altus Metrum. I fly this device on most of my flights. I cannot control the flight vector, but it does calculate tilt so that can be factored into staging and deployment events.
https://altusmetrum.org/TeleMega/The good thing about this product is that it is open-source so you can dive into the hardware and software and see how it ticks. There is some cleverness, such as Kalman filtering and the use of quarternions (I think). Being open-source you can buy them or make them if you have a suitable skillset. There are many little corner-cases where rocketry electronics can bite in the firmware realm, so seeing what is coded here is a good way of finding out important considerations in design of this sort of product.
 
Regarding flight controllers if you are getting into this have a look at the range of F4 flight controllers that are out there now. Seriously cheap and they can run the Cleanflight open-source software. Would not be a big leap to make this suitable for rocketry. These are really amazing pieces of electronics for almost no money.
https://www.banggood.com/buy/f4-flight-controller.html
 
Forgot to mention: If you get really keen and are able to measure or estimate flight speed you can have variable gains for the control system constants during flight to make sure you get the most out of the control system but without it going oscillatory. The technical name for this is gain scheduling.

Personally I am happy to set the gains low and not bother with scheduling at the moment. A leisurely progression to vertical is what I am aiming for.
 
Dan, maybe you saw one of my flight videos? I've been flying a stabilization system for several years now. My last 10 flights have been pretty good. Here are a couple of videos. There's a description of the system in one of them.

"Gyros" such as the MPU 6050 have limitations, but it is possible to use them in rockets,

Jim





Jim, These are the videos.
The system I use has four canards that do mixed yaw/pitch and roll. Everything is aligned as well as I could do, by hand essentially, but it isn't perfect. Since the motions needed for yaw/pitch control are larger than for roll, at least when the rocket is not vertical, control of yaw/pitch will induce some roll that then has to be corrected. The difficulty is compounded by the fact that yaw/pitch has to be done from one end of the rocket or the other, which is not ideal for roll control in a hobby rocket. All things considered, I'm surprised the system works as well as it does, but splitting up the functions is something to consider.

Jim
JimJarvis50,

I think it’s great that you’ve been able to do mixed yaw/pitch and roll control at the same time.

What size and weight of rocket does your canard design work with? What’s a typical motor, max acceleration, velocity and altitude? Does your hardware work up to Mach 1? I was wondering if the general design would work for an L2 or L3 motor or cert attempt.

I was looking at a Talon-4 concept rocket, but with 4 instead of 3 fins, and I was wondering if the control surfaces could be built into the back fins instead of a front, canard fin design as yours does.

To accomplish this, I was thinking that four RC plane servos could be mounted above rocket motor each with a worm gear-driven right-angle shaft to rotate a “seesaw” actuator linkage to a pair of control rods going along the side of the rocket body and on opposite sides of each fin to link to a similar seesaw to control the angle of each of the lower fin’s control surfaces.

Based on my past experience, an ARM Cortex M4 level processor would have enough computation bandwidth for four axis of high resolution servo control with a 1-10 ms iteration time for simultaneous, “multivariable” yaw/pitch and roll control.

Before retiring I spent 11 years as the firmware architect writing high resolution control and measurement firmware for Quantum Design, a company that makes cryogenic physical properties measurement systems that are used in physics labs around the world. The high resolution techniques and control algorithms could also be applicable to controlling rockets.

The form of PID I’ve worked with is a Z-transform of the classical PID equation into a difference equation and then transformed into a 3-term FIR-filter that only calculates the difference of the controlled variable since the last iteration. This sums into a high resolution 32 or 64-bit accumulator where only the upper most significant bits are used for a D/A convertor or servomechanism, but the lower bits aren’t truncated or lost. The manual mode sets the controls by manually setting or ramping the control accumulator, and there’s completely bump-less transfer between manual and automatic control.
 
Dan, maybe you saw one of my flight videos? I've been flying a stabilization system for several years now. My last 10 flights have been pretty good. Here are a couple of videos. There's a description of the system in one of them.

"Gyros" such as the MPU 6050 have limitations, but it is possible to use them in rockets,

Jim





JimJarvis50 — These were the same videos I saw and was referring to! Impressive!
 
JimJarvis50 — These were the same videos I saw and was referring to! Impressive!
I took a closer look at the data you supplied with these videos and it completely answered my questions about whether what you’ve developed would be applicable for L2 or L3 rockets.

Really great stuff! Are you selling this technology or helping others to implement similar controls?

I wonder if to avoid the wind drift, the pitch/yaw control could have a modified setpoint from the vertical, to a GPS-calculated offset based on the total estimated downwind drift. It seems likeTripoli/NAR/FAA rules against guided missiles have already been modified for vertical angle control.

But would such a modification as this break them entirely?
 
What size and weight of rocket does your canard design work with? What’s a typical motor, max acceleration, velocity and altitude? Does your hardware work up to Mach 1? I was wondering if the general design would work for an L2 or L3 motor or cert attempt.

Dan,

The system was designed for the purpose of controlling multi-stage flights with control from the bottom during the coast. I have flown it this way for two three-stage flights (N to N to M) and on a P to O flight. With success - No, Yes, No. The Yes was a 175K flight where the system controlled from the bottom of the second stage, per the pic. I estimate that the tilt could have been as high as 8° at second stage ignition but was instead 1.5° of so. That's the difference between a 20+ mile recovery and the actual 3 mile recovery. This flight is why I designed the system.

When I first built it, I did testing with the system on the top of the rocket (instead of steering from the bottom as in the staged flights). It can be used in either configuration. I often fly it with the system on top just because it is so much fun to fly it. The "test rocket" that I built for this is an inexpensive fiberglass rocket that has flown much more than I ever expected it to. But, it's not a particularly strong rocket (you can see it flexing in the videos), so I don't fly it above Mach 1.

Jim
 

Attachments

  • Configuration pic.jpg
    Configuration pic.jpg
    80.3 KB · Views: 9
I took a closer look at the data you supplied with these videos and it completely answered my questions about whether what you’ve developed would be applicable for L2 or L3 rockets.

Really great stuff! Are you selling this technology or helping others to implement similar controls?

I wonder if to avoid the wind drift, the pitch/yaw control could have a modified setpoint from the vertical, to a GPS-calculated offset based on the total estimated downwind drift. It seems likeTripoli/NAR/FAA rules against guided missiles have already been modified for vertical angle control.

But would such a modification as this break them entirely?
When I was developing the system, and got to a point where I thought there could be development by others, I started a beta group. About a half dozen people got boards with the intent of starting projects. To the best of my recollection, only two guys actually had flights. One guy did an M flight but the system didn't have the mechanical strength for the flight profile. But he really enjoyed doing the project and it was a treat to help him try. The other guys has had some success, but has had some setbacks with rocket performance. The thing I try to let people know about this type of project is that it is a great deal of fun, but it is also very difficult. No, I don't sell anything - I just report on what I've done.

I would really like to hear if others have had success doing this. Other than the guys in my beta group, and Alyssa Stenberg on model rockets, I have never actually seen anyone post video or data evidence of a working system. There must be, but maybe people are relucatant to publicize? I don't really know. But I keep an eye out but have seen very little. It would make a perfect college project and I am surprised more students don't try it. I have a couple of projects with student groups at the moment.

At one point, we did do testing to have the system control at a specified flight angle rather than straight up. I have one video where we make a jog in the flight path after burnout and then a jog back to vertical after a few seconds. At the time, I didn't realize that going straight up would result in a longer recovery due to drift downwind on the way up. I might give this a little more thought in the interest of minimizing recovery distance, but I have no plans to integrate this with gps. I would not encourage people to do that.

Jim
 
There are a couple of commercial products that do provide tilt measurements for rocketry. Check out the TeleMega by Altus Metrum. I fly this device on most of my flights. I cannot control the flight vector, but it does calculate tilt so that can be factored into staging and deployment events.
TeleMega
The good thing about this product is that it is open-source so you can dive into the hardware and software and see how it ticks.

The instruction page for the TeleMega does say "Can drive up to 4 RC-style servos". I see one of the makers of this flight computer at launches and asked him about using it for flight control. There is no flight control code, but it is all open source and if you learned to work with it you could add something.
 
When I was developing the system, and got to a point where I thought there could be development by others, I started a beta group. About a half dozen people got boards with the intent of starting projects. To the best of my recollection, only two guys actually had flights. One guy did an M flight but the system didn't have the mechanical strength for the flight profile. But he really enjoyed doing the project and it was a treat to help him try. The other guys has had some success, but has had some setbacks with rocket performance. The thing I try to let people know about this type of project is that it is a great deal of fun, but it is also very difficult. No, I don't sell anything - I just report on what I've done.

I would really like to hear if others have had success doing this. Other than the guys in my beta group, and Alyssa Stenberg on model rockets, I have never actually seen anyone post video or data evidence of a working system. There must be, but maybe people are relucatant to publicize? I don't really know. But I keep an eye out but have seen very little. It would make a perfect college project and I am surprised more students don't try it. I have a couple of projects with student groups at the moment.

At one point, we did do testing to have the system control at a specified flight angle rather than straight up. I have one video where we make a jog in the flight path after burnout and then a jog back to vertical after a few seconds. At the time, I didn't realize that going straight up would result in a longer recovery due to drift downwind on the way up. I might give this a little more thought in the interest of minimizing recovery distance, but I have no plans to integrate this with gps. I would not encourage people to do that.

Jim
JimJarvis50 —

Although I’m a retired firmware and process control engineer, I’m quite new to HPR with a newly minted L2.

It’s obvious to me that you’re really advanced in HPR and in the development of your well-proven pitch/yaw and rotation control system.

Because I regard an L3 as the PhD of rocketry, hopefully I’ll be able to include something similar to what you’ve developed once I’m ready for my L3 cert.

But I have a lot of builds and launches before that, including whatever technology I’ll be including in my L3.

Congratulations on your achievement!
 
JimJarvis50 —

Although I’m a retired firmware and process control engineer, I’m quite new to HPR with a newly minted L2.

It’s obvious to me that you’re really advanced in HPR and in the development of your well-proven pitch/yaw and rotation control system.

Because I regard an L3 as the PhD of rocketry, hopefully I’ll be able to include something similar to what you’ve developed once I’m ready for my L3 cert.

But I have a lot of builds and launches before that, including whatever technology I’ll be including in my L3.

Congratulations on your achievement!
Thanks Dan. I'll take credit for about 20% of this project (someone had to build the system and fly the rockets). But the technology for it came from Bill Premerlani. It was a very fun collaboration and I was fortunate to get hooked up with Bill.

Again, I'll just say if you have the interest in venturing into a project like this, I would very much encourage it because it brings together so many different aspects of rocketry. I'm a fan of rocketeers that want to do innovative things as part of their L3 projects, although I'm not sure I would recommend this particular thing, although there was a guy who did roll control back in the early 2000's and I'm reasonably sure (??) it was part of his L3.

Jim
 
I love HPR because there’s the possibility of making discoveries and doing innovative things in it. I’m not doing them to get an L3. An L3 is just a signpost of where I’ve gone that gives me the ability to go further. But I’m pretty sure that you’re this way too.
 
I have not seen that book. However, I find it interesting that you can buy individual chapters from the book. And don't forget the ...with MATLAB and Simulink. This is commercial software that few sport rocketeers have, and almost certainly not Yukon.
I am lucky enough to have them for work, but I do realise they are relatively high-end packages. The methodology is still valid and can be applied to other programs and packages, and also give understanding to what is happening for craft in flight.
 
Last edited:
I am lucky enough to have them for work, but I do realise they are relatively high-end packages. The methodology is still valid and can be applied to other programs and packages, and also give understanding to what is happening for craft in flight.
So, can you easily use the book with Octave instead of MATLAB? I don't use either, but I appreciate good software, after you have learned all the underlying and embedded principles and methods. The real question is, if Yukon buys this book, how long will it take him to determine "right on the money" PID gains for his controller?
 
So, can you easily use the book with Octave instead of MATLAB? I don't use either, but I appreciate good software, after you have learned all the underlying and embedded principles and methods. The real question is, if Yukon buys this book, how long will it take him to determine "right on the money" PID gains for his controller?
My aim is to increase his understanding of PID controls. It would not be an overnight effort to get the PID constants "on the money". Too much control theory and understanding for that to happen in a short time. He might not need to buy the book ;).
 
Dan,

The system was designed for the purpose of controlling multi-stage flights with control from the bottom during the coast. I have flown it this way for two three-stage flights (N to N to M) and on a P to O flight. With success - No, Yes, No. The Yes was a 175K flight where the system controlled from the bottom of the second stage, per the pic. I estimate that the tilt could have been as high as 8° at second stage ignition but was instead 1.5° of so. That's the difference between a 20+ mile recovery and the actual 3 mile recovery. This flight is why I designed the system.

When I first built it, I did testing with the system on the top of the rocket (instead of steering from the bottom as in the staged flights). It can be used in either configuration. I often fly it with the system on top just because it is so much fun to fly it. The "test rocket" that I built for this is an inexpensive fiberglass rocket that has flown much more than I ever expected it to. But, it's not a particularly strong rocket (you can see it flexing in the videos), so I don't fly it above Mach 1.

Jim
Has anyone thought about a steerable drogue chute?

Coming down from 20k feet and above after using vertical control with 4 axis canards, the same technology could control the four shroud lines of a drogue as it descends at say, 70fps from 10k to the 1k main deployment. Instead of coming down 3 miles away, 100 yards would make recovery much easier.

But a drogue steering control system wouldn’t have to be as fast acting because it would be acting over tens of minutes, rather than just seconds.

This would make an intriguing addition to your fin stabilization system, although not quite like landing a rocket on a barge at sea.
 
Has anyone thought about a steerable drogue chute?

Coming down from 20k feet and above after using vertical control with 4 axis canards, the same technology could control the four shroud lines of a drogue as it descends at say, 70fps from 10k to the 1k main deployment. Instead of coming down 3 miles away, 100 yards would make recovery much easier.

But a drogue steering control system wouldn’t have to be as fast acting because it would be acting over tens of minutes, rather than just seconds.

This would make an intriguing addition to your fin stabilization system, although not quite like landing a rocket on a barge at sea.
This isn't something that I've done, but I've seen quite a few attempts at it. Some have worked.

Jim
 
Has anyone thought about a steerable drogue chute?

Coming down from 20k feet and above after using vertical control with 4 axis canards, the same technology could control the four shroud lines of a drogue as it descends at say, 70fps from 10k to the 1k main deployment. Instead of coming down 3 miles away, 100 yards would make recovery much easier.

But a drogue steering control system wouldn’t have to be as fast acting because it would be acting over tens of minutes, rather than just seconds.

This would make an intriguing addition to your fin stabilization system, although not quite like landing a rocket on a barge at sea.

I worked on a RC controlled main, with the intention of deploying it at or near apogee. I chose a Ram Air design because of the 20 mph forward speed.

Not only does it have to be steerable it has to have a substantial forward speed. A 5 mph forward speed into a 20 - 30 mph wind isn't going to help a lot. It might make it drift further if the decent rate is much slower then a drogue. Our waiver is 16K, but even flying only 8K - 10K can put you into 30-45 mph upper level winds when the surface winds are 8 - 15 mph. Having a 20 mph forward speed becomes much more important.

Being steerable isn't the only consideration.
 
Back
Top