PID Controller - Now Working! #42
jazzmonger
started this conversation in
General
Replies: 1 comment 1 reply
-
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
After seeing another project (PiFire) successfully use a PID controller on a pellet fire system with only auger on/off control, I'm "kindling" this discussion to see if we can use it on these pellet stoves. ESPHome has a PID module, but it requires a proportional input to make adjustments. We have only one input - Auger on/off. PiFire uses on/off.
PID control may allow the fire to burn at a much lower temp w/out going out. Very useful when there's a chill in the air and P5 (the new low setting) causes too much heat to be thrown out of the pellet stove.
So, I asked ChatGPT to produce code to implement this and was surprised that it spit out something that looks useful....
Prompt: "Write an ESPHome PID routine to control a single speed auger motor knowing the temperature of a pellet fire pot and target temperature of the room"
ChatGPT said:
To control a single-speed auger motor in an ESPHome setup based on the temperature of a pellet fire pot and the target room temperature, we can implement a PID routine that adjusts the motor's duty cycle (ON/OFF periods) to maintain the desired room temperature.
Key Points:
Input 1: Room temperature from a room sensor (e.g., DHT22, BME280).
Input 2: Pellet fire pot temperature to ensure safe operation and avoid overheating.
Output: Auger motor control (ON/OFF via a relay).
Logic: The PID controller adjusts the ON duration of the auger motor based on the room temperature error (difference between the target room temperature and the actual room temperature).
ESPHome YAML Configuration
Explanation of Key Components:


Gradually adjust these parameters to achieve a stable response.
Very Interesting stuff. We'd need to bound the on/off cycle so that the fire doesn't actually go out when the thermostat is set for, say 61 and the room temp is 65. We want a very gradual decrease so the fire pot remains stable.
Anyway I thought I'd put this out there. I'll come back to it when I have more time.
Beta Was this translation helpful? Give feedback.
All reactions