I’m trying to recreate ArduPlane’s basic PID flight controller algorithms for my custom Arduio/Teensy plane.
I’ve decided to look into implementing a pitch controller first and then move on to roll and yaw. I was able to find the attached picture of ArduPlane’s pitch controller diagram. I’m able to understand how to implement all of the pieces except for the input “AirspeedScaler”.
My question: Is “AirspeedScaler” a global constant defined somewhere (if so, what is the value?) or is it user defined (if so, what are the value limits)?
I’d look in the source code, but I know from previous experiences that ArduPilot is written/structured in a way that is very difficult for someone new to the codebase like me to understand/find things, lol.
That is the mid-point for the scaling. It acts as an overall scaler for the fixed wing surface PIDs. Setting it to the cruise speed of the aircraft allow you to use the default PIDs on a much wider range of aircraft.
Basically if you are flying at airpeed=g.scaling_speed then the scale is 1.0
I usually only recommed that people set this on really fast aircraft (eg. jets)
Also, one last question: I tried looking into how ArduPilot converts the controller output into a servo signal (either us pulse length or servo angle), but I couldn’t figure it out. How can I convert the pitch controller output to a servo us pulse length?