I would like to set the PWM speed to slow down when approaching the target and slowly go back if it overshoots. Does it have to be THAT complicated?
PID Control
Moderator: Benj
-
mimiyum
- Posts: 94
- Joined: Wed Jul 16, 2008 4:39 pm
- Location: Philippines
- Been thanked: 1 time
- Contact:
PID Control
I have seen the PID example and I'm sorry it's too complicated for me. Is there a simple way of doing PID control?
I would like to set the PWM speed to slow down when approaching the target and slowly go back if it overshoots. Does it have to be THAT complicated?
I would like to set the PWM speed to slow down when approaching the target and slowly go back if it overshoots. Does it have to be THAT complicated?
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: PID Control
Hello Mimiyum,
PID is a fairly simple equasion. However implementing PID on an 8-bit device can be a little tricky. Especially as you have to balance the equasion so it gives you usable numbers in the range of 0-255.
I will dig through my old work and try and find the equasions for PI and PID control. Hopefully this will help to get you started.
PID is a fairly simple equasion. However implementing PID on an 8-bit device can be a little tricky. Especially as you have to balance the equasion so it gives you usable numbers in the range of 0-255.
I will dig through my old work and try and find the equasions for PI and PID control. Hopefully this will help to get you started.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
mimiyum
- Posts: 94
- Joined: Wed Jul 16, 2008 4:39 pm
- Location: Philippines
- Been thanked: 1 time
- Contact:
Re: PID Control
I understand it's better to use PID on a 10-bit device due to the difficulty in computing without going below or above 255.
Maybe if you could send the same PID program in your example with a few more "NOTES" and information so that we can edit it to suit our application. It would be easier to learn when there are notes embedded into your example programs.
Like for example, if we want the whole "PID" to go at a faster rate, which variable should we edit?
Thanks!
Maybe if you could send the same PID program in your example with a few more "NOTES" and information so that we can edit it to suit our application. It would be easier to learn when there are notes embedded into your example programs.
Like for example, if we want the whole "PID" to go at a faster rate, which variable should we edit?
Thanks!