Software > Software
My first little PID: please comment
jkerns:
Bottom line - the objective of the D is to counteract any changes in the error. How you combine the + and - doesn't really matter just as long as when the error is going positive, the controller output is going negative.
jwatte:
I don't think there is a "how it was meant originally" regarding the sign of the D term (or coefficient.) Once you work with math, you realize that sign is just an interpretation detail, as as long as you get it right (compared to the physical system you model,) which way it goes really doesn't matter. Except perhaps for aesthetics -- so, if you want a particular aesthetics, then choose that direction of the sign! Just be aware that not everyone chooses the same, so be clear to document your assumption when you write, and understand what assumption other authors use when they write.
Pet peeve: Even though it's well known that there are many conventions in various ways, authors tend to always forget to document what conventions they use in their particular writing/paper/tutorial. Row vectors on left, or column vectors on right? Row major or column major matrix storage? Left-handed or right-handed coordinate interpretation of the world? W first or W last in quaternions? Y up or Z up or Z down? Positive or negative "d" in a plane equation? The list goes on and on ...
jkerns:
--- Quote from: jwatte on May 15, 2013, 09:54:58 AM ---
Pet peeve: Even though it's well known that there are many conventions in various ways, authors tend to always forget to document what conventions they use in their particular writing/paper/tutorial.
--- End quote ---
Units - that's a big one. Ignoring the g in F=(M/g) *A. That tends to work OK if you are working with KG / Newtons, but if you are working in pounds mass / pounds force, the answers tend to be off by 32.2 :)
obiwanjacobi:
Okay. It's becoming guesswork at my part at this point, so I think I will start experimenting with this further until I have some more practical experience.
I am just ready to setup a PID controller for managing speed. I have my motor control software in place and my wheel encoders working, so now I have to feed the wheel encoder pulses into the PID and drive the motors with the output. Not sure yet how to get these values to mean the same thing, but I will do some more research first.
I want to thank you both very much for helping me out.
jkerns:
You can translate your desired speed to the necessary pulse duration or pulses per second (which ever fits the time scale of your controller). Or, you can take the pulse duration / rate and convert it to speed. And away you go.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version