I Have not delved into this properly yet.
Can someone say if it supports pwm power control as well as Slower PID type time constants at the same time please ?
Question is prompted by another thread.
My programming skills are not that good and a pending project may need this, but I may have to go for a bespoke unit.
Hope this makes sense to someone.
It sort of depends on what you mean by "at the same time". If you mean two different PID objects then yes, one can be set with the default Output range of 0-255, useful for analogWrite() PWM, and another for 0-5000, useful for a 5000 millisecond PWM interval.
The PID code itself neither knows nor cares what you're controlling or how you're controlling it. It is simply running an algorithm based on inputs and coefficients you provide, and calculating an output value, without knowing what that output value is or does. The two primary limits will be the PID update rate, which is limited by available processing power. On a 16 MHz AVR processor, about the fastest practical update rate is somewhere around 200 HZ, more or less. On a Due, about 1kHz. Or, you can run multiple PiDs, with the update rate of each reduced accordingly. One og my projects runs 4 PIDs on a Due, controlling brushed DC servo motors, two with 2mSec update intervals, and two more with 5 mSec update intervals.
Regards,
Ray L.
Thanks , that's petty much how I understand PIDs.
I think what im looking for is a hybrid, not sure what they are called, ill have to get the books out.
One PID object is going to give you a single output. It's up to you how you interpret and use that output. If you have proportional control over the thing impacting your process e.g. a valve that manages water flow, you can have the PID give you a value from say 0 to 100 to give you a range between fully off & fully on.
If you can cycle the something rapidly like a heating coil, PWM is likely your thing.
If the object can't be cycled quickly - such as a refrigeration system or mechanical relay, you can use ersatz PWM by using a long window of time and turning the thing on for an amount of that window proportional to the output.
I'm unsure how you would use the single output value to control both PWM and the window method - what are you trying to control?
PID is great, but as Ray said, it doesn't know anything specific about the system it's controlling - you may find for your application that coding something that does gives you better results.
This is what I have.
I want to get the camera as cold as possible and then keep it at a stable temperature +_0.1 deg.
Thermal mass is very low particularly the camera end.
There will be 0.1 mm silver foil between the peltiers
http://www.trademaid.co.uk/catalogue/Kilner-Round-125ml-Cliptop-Jars.cfm?gclid=CIS2iNXV0sMCFUcUwwodTUEA-Q
It will be mounted in one of these with the lid replaced by optically flat Perspex and evacuated.
For experimental purposes.
A slug of copper to act as a heatsink in the bottom
Edit
Experimentally iv controlled the peltiers with analogue means .
Tests with dry ce indicate the premise is good.
As a first pass, I think I'd turn on the pelitiers and see how cold they can get the camera. Then pick a temperature a little bit warmer as the target and let the PID PWM the peltier closest to the camera.
I'd have the PID tuned to manage the temperature right around the set point and only start it when the system is close. i.e. run max cooling until you're a few degrees away and them let the PID take over - should get less overshoot & there's no point controlling the ramp up (down?) if it's just going to be at full power.
If it turns out that you need to vary the cooling of the other two, that's going to be tricky to get right I suspect.
wildbill:
If it turns out that you need to vary the cooling of the other two, that's going to be tricky to get right I suspect.
I edited while you posted.
Analogue experiments indicate that is the case.
Its much more convenient to tinker at atmospheric though.
Im not sure if I have the mechanical arrangement correct either, I am limited to whatever size peltiers are available.
As yet I do not know how cold I can go but im given to understand -90 is achievable.
When evacuated I expect a dramatic reduction in temperature.
I would think a PID driving a PWM driving the Peltier should work just fine. You probably only need to use P, or perhaps P and I. Depending on how the Peltier responds, it may be helpful to put a deadband in the PWM response. i.e. - A PWM output of zero turns the PWM off, a PWM output other than zero turns the PWM with a value of PWM+offset, where offset is a minimum PWM value required to get meaningful cooling. This is often done in mechanical systems to over-come friction, or a motor that requires a significant minimum voltage to start moving.
Regards,
Ray L.
RayLivingston:
I would think a PID driving a PWM driving the Peltier should work just fine.
Regards,
Ray L.
That's pretty much the idea I was trying to get across in the original post as I saw it mentioned elsewhere.
I just cannot get my mind around how it all slots together.
PID is on off so how does that vary the pwm control of the peltier.
im guessing its another control loop.
Im trying to digest your post to generate a "Picture"
PID output on the arduino library varies between 0 and 255 - perfect for PWM. You can adjust the range of the output to whatever range you like though.
Thanks Bill perfect.
I was fixated by the pid on off output as that's what nearly all of my experience is for heating control.
Thinking back to analougue PIDs the penny has dropped.