arduino PID autotuning library help !

First post,

I need to work with the PID, to control a dc motor in order to keep the difference between two LDR = 0, i started with 1 ldr and 1 LED, the PID worked at least the diode was blinking ,:slight_smile:
when i tought about the tuning parameters to make the controller efficient, I decided to use the PID autotune library. so the problem is :
i tooked the autotune example whithout making any changes, except for the analog read and the analog write pins.
while executing the program on arduino uno, i noticed that the parameters values didn't change, they tooked those in the begining of the program !
i've read the program, i'm not strong enough to detect the source of that problem.

i'm wondering why is that happened? and i'll be thankfull if some one told me how to do the autotune step by step.
thank's a lot for your help .

PS: autotune library's link : Arduino Playground - PIDAutotuneLibrary

i tooked the autotune example whithout making any changes, except

So, you DID make changes. And, now you want us to guess what you changed, what you expected the program to do, and what it actually did.

Sorry, I'm done with guessing games for today. Maybe tomorrow.

Funny ! :slight_smile:

who are you to say you want us to guess !? you rather say you want “Me” to guess and obviously I didn’t ask you by person ! I asked someone who can understant and can reply and wants to do so. A wise person.

you could try the program and tell me if the example is really working! and then i’ll conclude that I did something wrong, which is near impossible because I only changed the input and output pins, but you didn’t !

So arrogant you are ! you didn’t came with any help hhhhhh I’m fine man, don’t need help from someone like you;

thank’s and sorry for the time we lost writing those lines whithout any additional knowledge.

hope this question will have answers for futur persons in need.


I do not know if it is any help but I used the pidautotune library when I builded a temperatur controller.
My autotune function code is very similar to the exempel, I only removed the "simulation" stuff and changed aTuneStep and aTuneNoise.

My autotune function works in the following way:

  1. First I set a output value, say 500

  2. Then I wait until the temperatur is steady

  3. When the temperatur is steady I start the autotune function.

It takes a VERY long time for the autotune to finish but the result is good.

thank’s man ! that’s what I’m talking about :slight_smile:

I think I didn’t wait that much… how much time it tooked to establish the values ? and the change in tune step and noise is based on what how did you knew they were good ? could you please explain more ?

thank’s for you help and for giving life to this topic :slight_smile:

When I set the output to say 500 I get a fixed temperatur in the space I want to control.
Say 30 degrees.

Then when I start the "autotune" function it will increase/decrease my output and see how the input (temperatur) respond.
I think the aTuneStep is how much the tuning will increase/decrease the output.

I made the controller two years ago so I don't remember for sure. A tuning with my parameter takes hours!

byte val = (aTune.Runtime());
Try and print the val to the serial console. Maybe it can give you some indication if the tuning is working.
When the value is 0 the tuning is finished.

@olof_n I really appreciate thank's, I'll do it :wink:


where did you get the example code??

could you please send the link?