Prox / RFID
Ladder Logic
[interfacing] †
Tube Joints
Key Code From Photo
SolveSpace (3d CAD)
SketchFlat (2d CAD)
Resume / Consulting
Contact Me

LDmicro Forum - PID regulation of burning

(you are viewing a thread; or go back to list of threads)

PID regulation of burning (by Artemy)
I have a question regarding PID regulation.
The goal is to control the burning of the wood in the boiler. I want to do this with the help of a servo motor that controls the air. The servo motor turns from 0 to 90 degrees depending on the temperature in the chimney and controls the air. Maybe someone has an idea how to do this?
Mon Nov 8 2021, 01:46:23
(no subject) (by Ziggy)
You will need a thermocouple subsystem.
I mean thermocouple and a thermocouple preamp.
You can try to roll your own or use something like a Maxim analogue output amplifier directly into an analogue input port.
The other option is a Maxim I2C preamp providing direct digital transfer.

Once you have reliable temperature measurement think about either the PID algorithm or Take Back half algorithm.
Take back half is easier to tune and get to work sensibly.

Then think about the servo motor and the air valve.

I suppose you could use a model aeroplane servo motor to adjust the air valve position.

So now You need to make sure your servo motor has the range of operation to achieve desired outcome.

Once every block works as it should think about linking them together to control the temperature.
Tue Nov 9 2021, 01:34:04
(no subject) (by Artemy)
Thanks for your reply.
Yes, I think that MAX6675 winth SPI will be a good solution as thermocouple.
The question is regulation. How it may be realised in LDmicro?
How realise Take Back half algorithm in LDmicro?
Could you point me?
Tue Nov 9 2021, 04:23:05
(no subject) (by Ziggy)

LD micro How to web site has instructions on setting up SPI interface.

Google will help with take back half algorithm.

Essentially with PID you calculate difference between desired set point and actual measured value. The error is then processed by calculating the P,I,D terms and applying them to the demand signal.

With Take back half algorithm the measured variable is sampled to determine whether demand signal needs to go up or down.
At the same time a log of previous demand signal is maintained. If demand signal needs to go up a small portion of error signal added to demand signal.
If the measured variable has gone over the setpoint a new demand signal is calculated whihc is half way between the current demand signal and previous demand signal.
Now the cycle of taking a small portion of error variable and applying it to the demand signal starts again.
This way the two end points of the demand signal tend towards the correct value just like the PID algorithm BUT MAJOR DIFFERENCE IS PID SUFFERS FROM INTEGRAL WIND UP AND IN SYSTEMS WITH LONG TRANSPORT DELAY WILL CAUSE OSCILLATIONS.
Tue Nov 9 2021, 16:53:57
(no subject) (by Artemy)

First of all, thank you so much for your reponse!
I have read HOWTO about SPI and I have no questions about it.
PID is also realised in ladder logic here:https://cq.cx/ladder-forum.pl?action=viewthread&parent=190

But as you mentioned PID will cause oscillations. So, I should use Take Back Half algorithm.

But regarding TBH algorithm I never have deal with it.
Tried to Google it and found this your post:

You wrote:
"It would represent a minimum problem to implement the algorithm in LDmicro".

Could you show an example in LDmicro? I'm pretty sure that many newbies (like me) will be very grateful for that.
Wed Nov 10 2021, 02:27:40
(no subject) (by Ziggy)
I am sure google returned many more hits than just the one .
Persevere...it is a simple enough algorithm... even i understand it and i am no genius.
You will understand it in the end.
I have implemented it on an ATmega 328 microcontroller but have not had the opportunity to try it out yet.
Thu Nov 11 2021, 02:49:34
(no subject) (by Artemy)

Could you please show what you implemented?
Tue Nov 16 2021, 12:11:44
Post a reply to this comment:
Your Name:
Your Email:
(no HTML tags; use plain text, and hit Enter for a line break)
Attached file (if you want, 5 MB max):