I've followed the ziegler nichols method and had some improvements. I also tried loading the servo and then retuning. That's got me the best results so far (github repo updated with graphs).
This is a concept, a general idea. Take for example the servomechanism of CD players. They have a coarse position mechanism with cheap plastic gears and a fine positioning mechanism based on magnetic cushion for the laser head. But making a lemonade out of servos only, you could try to cascade a big servo with a small servo, or you could cascade a servo a second being the movement of the second demultiplied mechanically. A third try is based on the precision obtained using large movements. You may try to attach two servos and make them turn at opposite directions and the difference between both may give you the precise turn with small movement.
I am assuming that you are not talking about cheap RC servos, but something you have direct control with motor drivers and encoder.
My layman observation is that PID system looks at the past (I), present (P) and future (D). It sounds like you might have too large of a gain in the P term which can cause oscillations/overshoots.
You want a larger contribution of the D term to replace part of the P term gain as it is there to prevent overshoots by slowing down when you get closer to the target. The I term let you reduce the error over time without introducing excessive gain in the P term.
You need to increase the P and D terms together with the I term to avoid overshoot.
Lets say that you were happy with the overshoot performance of some P, I and D setting, but you wanted smaller tracking error. So you want to increase the I term by a factor 2. To achieve the same overshoot behavior, you need to increase the P and D terms by factor ~2 as well.
Try to search for the "ziegler nichols tuning method". Cheers!
Well, I use some more advanced methods which involves modelling the system and analytically setting the gains from required performance, also known as "pole placement".
But I have used ziegler nichols before, and it works well I would say.
Hobby servos have something that is called "dead band" -- area near the target position that is considered "good enough" for their movement. This is so that they stop, and don't keep buzzing constantly adjusting the position.
I'm working on a servo to replace a stepper (because I'm interested). I can get long, fast, accurate moves, but not small ones. If I increase the I term in my PID loop I can get accurate (2 within 2 encoder counts) but then I get large overshoot on longer moves.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.
I'm going to try this in my application and see if I can get as good results as with steppers. Thanks for the help everyone!
Are you sure? yes | no
Are you sure? yes | no
I've followed the ziegler nichols method and had some improvements. I also tried loading the servo and then retuning. That's got me the best results so far (github repo updated with graphs).
Are you sure? yes | no
A classical solution for such problem is to cascade another servo mechanism with smaller resolution.
Are you sure? yes | no
can you post a link? I don't understand the 'smaller resolution' part...
Are you sure? yes | no
This is a concept, a general idea. Take for example the servomechanism of CD players. They have a coarse position mechanism with cheap plastic gears and a fine positioning mechanism based on magnetic cushion for the laser head.
But making a lemonade out of servos only, you could try to cascade a big servo with a small servo, or you could cascade a servo a second being the movement of the second demultiplied mechanically. A third try is based on the precision obtained using large movements. You may try to attach two servos and make them turn at opposite directions and the difference between both may give you the precise turn with small movement.
Are you sure? yes | no
don't know why I can't reply to your comment below, but thanks I'll look into it.
Are you sure? yes | no
sorry, yes I wanted to post a photo of my setup. I'm trying to build a servo out of a dc motor and an encoder. I'll have another go at tuning.
Is 100hz fast enough for the PID loop? I've noticed that servo drivers like the geckodrive are at 5khz.
Are you sure? yes | no
I am assuming that you are not talking about cheap RC servos, but something you have direct control with motor drivers and encoder.
My layman observation is that PID system looks at the past (I), present (P) and future (D). It sounds like you might have too large of a gain in the P term which can cause oscillations/overshoots.
You want a larger contribution of the D term to replace part of the P term gain as it is there to prevent overshoots by slowing down when you get closer to the target. The I term let you reduce the error over time without introducing excessive gain in the P term.
Are you sure? yes | no
You need to increase the P and D terms together with the I term to avoid overshoot.
Lets say that you were happy with the overshoot performance of some P, I and D setting, but you wanted smaller tracking error. So you want to increase the I term by a factor 2. To achieve the same overshoot behavior, you need to increase the P and D terms by factor ~2 as well.
Try to search for the "ziegler nichols tuning method". Cheers!
Are you sure? yes | no
Also, If your output (voltage probably?) hits its limits, you have to worry about "integrator windup". Search for that too (:
Are you sure? yes | no
I'd be interested in learning more about pole placement - reminds me of university days!
Are you sure? yes | no
I'd be interested in learning more about pole placement - reminds me of university days!
Are you sure? yes | no
did you have to go through this with your servo board?
Are you sure? yes | no
Well, I use some more advanced methods which involves modelling the system and analytically setting the gains from required performance, also known as "pole placement".
But I have used ziegler nichols before, and it works well I would say.
Are you sure? yes | no
Hobby servos have something that is called "dead band" -- area near the target position that is considered "good enough" for their movement. This is so that they stop, and don't keep buzzing constantly adjusting the position.
Are you sure? yes | no
I think he is talking about a brushed DC servomotor, given that he is talking about encoder counts. (:
Are you sure? yes | no
I'm working on a servo to replace a stepper (because I'm interested). I can get long, fast, accurate moves, but not small ones. If I increase the I term in my PID loop I can get accurate (2 within 2 encoder counts) but then I get large overshoot on longer moves.
Is it the gearbox?
Are you sure? yes | no