Click here to Skip to main content
15,885,309 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: Unsigned Integer Mod/Remainder Pin
John Paul Walker29-Jul-11 13:40
John Paul Walker29-Jul-11 13:40 
GeneralRe: Unsigned Integer Mod/Remainder Pin
Dr.Walt Fair, PE30-Jul-11 17:23
professionalDr.Walt Fair, PE30-Jul-11 17:23 
AnswerRe: Unsigned Integer Mod/Remainder Pin
David198729-Jul-11 20:41
David198729-Jul-11 20:41 
QuestionHow to find estimated time remaining ? Pin
yogish29326-Jul-11 0:53
yogish29326-Jul-11 0:53 
AnswerRe: How to find estimated time remaining ? Pin
Richard MacCutchan26-Jul-11 3:00
mveRichard MacCutchan26-Jul-11 3:00 
GeneralRe: How to find estimated time remaining ? Pin
yogish29326-Jul-11 4:27
yogish29326-Jul-11 4:27 
GeneralRe: How to find estimated time remaining ? Pin
Richard MacCutchan26-Jul-11 4:46
mveRichard MacCutchan26-Jul-11 4:46 
QuestionPID control algorithms Pin
Wjousts21-Jul-11 8:47
Wjousts21-Jul-11 8:47 
I've been implementing a PID control algorithm[^] to control a heater (or cooler) to reach a setpoint. Everything works perfectly so far - PID really is magic.

Now the device I'm using can heat or cool depending on the polarity of the voltage you apply to it, so, with a suitable relay and some hardware, I can automate it to switch from heating to cooling or vice versa. As it currently works (I have a manual switch to reverse polarity), if you have a setpoint of, let's say, 30°C, it'll heat up, overshoot, shut off the voltage and cool naturally, then undershoot and turn the voltage back on. In theory, I suppose, it could be more efficient if, instead of letting it cool naturally, I switch the polarity and drive it back down. It's more aggressive and likely to be less stable perhaps, but my real concern is that it'll abuse the heck out of the relay which will be rapidly switching back and forth around the setpoint. So I was thinking that if I have some kind of "dead zone" area to add a "buffer" around the setpoint it might save the relay. In essence, the relay should only switch if you're a long way off and not when you are right around the setpoint. I was thinking if I made my input range say, -10 to +10 and in software I mapped it such that +10 gives the maximum voltage to the device and it reduces linearly until it reaches 0 at, let's say +2. Then from +2 to -2 the voltage remains at zero, and from -2 to -10 the voltage goes up again, but the polarity is reversed.

One concern here is that in addition to stopping it switching polarity, it'll also delay turning it back on. Also, depending on where the setpoint is, I should be spending most of the time either cooling or heating. For example, if I change the setpoint from 10°C to 5°C, I should spend most of my time cooling, I really shouldn't need to heat at all unless I drastically overshoot, and I'm not sure whether this will automatically pick up on that.

Does this sound like something that might work (I'm waiting on the hardware at the moment, so I'm just thinking it through right now)? Is there a way to handle this kind of setup? Is it just a bad idea? Should I just not try and drive it so aggressively?

Any hardware control experts out there?
AnswerRe: PID control algorithms Pin
Roger Wright21-Jul-11 12:12
professionalRoger Wright21-Jul-11 12:12 
GeneralRe: PID control algorithms Pin
Wjousts21-Jul-11 13:45
Wjousts21-Jul-11 13:45 
AnswerRe: PID control algorithms Pin
Bernhard Hiller31-Jul-11 19:42
Bernhard Hiller31-Jul-11 19:42 
AnswerRe: PID control algorithms Pin
CPallini5-Aug-11 4:15
mveCPallini5-Aug-11 4:15 
QuestionFind an emtpy entry in a 3x3 grid? Pin
Neo1010118-Jul-11 4:31
Neo1010118-Jul-11 4:31 
AnswerRe: Find an emtpy entry in a 3x3 grid? Pin
BobJanova18-Jul-11 4:49
BobJanova18-Jul-11 4:49 
GeneralRe: Find an emtpy entry in a 3x3 grid? Pin
David198718-Jul-11 4:54
David198718-Jul-11 4:54 
GeneralRe: Find an emtpy entry in a 3x3 grid? Pin
Neo1010118-Jul-11 6:24
Neo1010118-Jul-11 6:24 
GeneralRe: Find an emtpy entry in a 3x3 grid? Pin
David198718-Jul-11 6:31
David198718-Jul-11 6:31 
GeneralRe: Find an emtpy entry in a 3x3 grid? Pin
Neo1010118-Jul-11 6:47
Neo1010118-Jul-11 6:47 
GeneralRe: Find an emtpy entry in a 3x3 grid? Pin
David198718-Jul-11 7:03
David198718-Jul-11 7:03 
GeneralRe: Find an emtpy entry in a 3x3 grid? Pin
Neo1010118-Jul-11 7:04
Neo1010118-Jul-11 7:04 
GeneralRe: Find an emtpy entry in a 3x3 grid? Pin
Wjousts21-Jul-11 9:45
Wjousts21-Jul-11 9:45 
QuestionCollision detection? [modified] Pin
Neo1010116-Jul-11 4:29
Neo1010116-Jul-11 4:29 
AnswerRe: Collision detection? [modified] Pin
Wjousts21-Jul-11 9:30
Wjousts21-Jul-11 9:30 
QuestionSorting algorithm problem [modified] Pin
Neo1010115-Jul-11 6:56
Neo1010115-Jul-11 6:56 
AnswerRe: Sorting algorithm problem Pin
Wjousts21-Jul-11 9:02
Wjousts21-Jul-11 9:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.