Skip to content

Fine regulation with ac_dimmer #1

@eldarmusin

Description

@eldarmusin

I would like to contribute for those who cares in 4 steps.

T Sensor
For an experimental purpose, a used a DHT22 than switched for a 18ds20. Kept in code for the better comprehension.

T Regulator
I have used the same pid component for the regulation, but as output used the ac_dimmer component. To set up the PID values Kp, Kd, Ki please see below.

Dimmable Output
I used the ac_dimmer component because of the triac hardware. The main advantages are:

  • Price 2.5 € vs 10 € for an SSR
  • The on state voltage is about 0.85V versus 1.6V of an SSR. And the power dissipation is than twice lower, as well as the dissipator for it
  • You manage the max voltage on it. So you can reduce the wear of the oven (see max_power parameter)
  • You manage the min voltage on it. So you can avoid the high frequency oscillations due to approaching the set point

Set up PID
I referred to the file [Russian] .

  1. Set Kp = 100, Kd = Ki = 0 and let the system heat
  2. You will see a Temperature curve of your sensor like this
    image
  3. After 4-5 oscillations, calculate the values as follows and report them to the code:
  • Kp = 1.2 * DeltaT
  • Ki = 1.5 * Tau
  • Kd = 0.2 * Tau

Here is my code
sensor:

  • platform: dht
    pin: GPIO14
    temperature:
    id: sauna_temperature_sensor
    name: "Sauna temperature"
    humidity:
    name: "Sauna humidity"
    update_interval: 1s
    model: DHT22

output:

  • platform: ac_dimmer
    id: dimmer1
    max_power: 0.8
    min_power: 0.2
    gate_pin: GPIO32
    zero_cross_pin:
    number: GPIO33
    mode:
    input: true
    inverted: yes

climate:

  • platform: pid
    id: pid_climate
    name: "PID Sauna Controller"
    visual:
    min_temperature: 40 °C
    max_temperature: 90 °C
    temperature_step: 1 °C
    sensor: sauna_temperature_sensor
    default_target_temperature: 70°C
    heat_output: dimmer1
    control_parameters:
    kp: 1.44
    ki: 13.5
    kd: 1.8

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions