I’m having a problem trying to wrap my mind around how a PID controller works.
I need one for RWAR that will correct the steering servo (0-180) to allow it to follow a heading.
I looked at the formula, and it looks like I have the following variables in the following formula:
Note there is no integral term. I don’t think I really need it, so I am more talking about a PD controller.
I have a few question:
[li]For the accumulative_error, do I literally just add up the error (desired_heading - current_heading) since the control loop started? [/li]
[li]I need the output to be 0-180. How does the output of the above equation correspond to that? I guess I need to manually map it’s output to that 0-180 range? What’s the best way to do that?