Are the PIDs 6 in total since I have 3 angles as input, so 3 at each stage?
Why the output of the first PID system is rotational rate and not angles? Is it because of the derivative term?
How to integrate the rotational rate output of the last PID to usable values in the above equations (since I will be sending 4 PWM signals and the throttle is easily mapped to duty cycle)? Is there a mathematical to do it? Is it trial and error?
I think the Output of the first PID system is an angular rate of change. The Setpoint and Input of a PID must be in the same units. The output of the rate gyro (Input to the next PID) is an angular rate of change so the Setpoint has to also be an angular rate of change.
You have one throttle value for four motors. The Yaw, Pitch, and Roll values are used to modify the throttle value for each motor according to the formulas shown. The Roll value increases thrust to one side and reduces thrust to the other side. The Pitch does that front and back. The Yaw does that the CW and CCW motors.
If the input and the output units of a PID are the same. That means I need to convert the output of the first PID to angular rate/velocity.
And as you said, the pitch, roll and yaw values will affect the thrust of each motor. Since the output of the second PID is an angular rate and the throttle is having a different unit (could be time or percentage), how can I get unified unit? or How can I get from an angular rate to the throttle's unit?
They are not, according to the diagram you posted. In any case, you have to work out the conversion (scale factors) from input measurements to output control separately, for each individual control problem.
I wonder why you picked that particular article to follow. I glanced through it and was not impressed.
Hint: people moved on from the "complementary filter" about a decade ago.
The Output units are arbitrary. Only the Input and Setpoint values have to be in the same units.
No. It's the Input (from the rate gyro) and Setpoint (from the first PID) that are in angular rate of change. The Output is arbitrary units. It's a value to change the throttle/thrust value.
@jremington I'm taking a baby steps in this whole thing. I didn't find some guides to make something like this from scratch so I decided to stick to something and lesrn as I go. it happened to be this.
If it's outdated, could you please point in the right direction as I just started.
"Baby steps" in this process would necessarily include a fairly complete understanding how a very simple 1D PID controller works, for example, a temperature controller. Then you might start thinking about writing a quadcopter flight stabilizer.
What have you done so far?
Are you aware that there are open source flight controllers, for example Ardupilot?
I did try PID control (software) in fairly simple way, and it was a matter of tuning the gains as I didn't have to worry about the output which was fed to the "plant", but this one is more complex.
I'm aware of existing FOSS FCs and checking the source code is not something I can make sense out of it.
My goal when I started this project is to cut with simple projects and step up to learn concepts and gain skills, and I'm sure it'll take me long time to get a decent outcome, in terms of knowledge and final working project.
I read few of your posts and I know you're very skilled and probably this post is senseless and you're right, I'm lost in it
I wouldn't say it is a senseless post, just that it is extremely ambitious to tackle something as complex as a flight stabilizer, even if you already understand the background material.
A good place to start with PID in robotics is a 2WD floor robot or boat that should travel in a straight line along a given direction. You have come a long way if you can program it travel in a square path and return to the starting position.
Another good starting project is a horizontal platform stabilizer. There are plenty of posts and tutorials on those.