SSR with blinking led

I am trying to understand the led status of the SSR’s that I bought from the brewpi store. I completely understand on and off, but what is going on when the led is blinking?

The SSR seems to start blinking when the temperature of the fridge has reached the desired temperatue, but it takes a really long time for the heater to turn off. The temperature just keeps rising beyond the set temp.

The SSR is blinking, because it is not heating at full power. It is ON only a small percentage of the time.

If the SSR is heating beyond the setpoint, this is due to integrator windup. When the temperature is under the setpoint, the integrator slowly increases, when it is under the setpoint, it slowly decreases.

You can verify this on the control algorithm tab of the maintenance panel.

To reduce overshoot, you can increase Td, so it multiplies the derivative by a larger gain (lookahead). You can also increase Ti to get increase/decrease the integrator slower.

But far most, you want to set your heater Kp as high as you can without creating overshoot. Think: if the fridge is x degrees too low, the heater should be at full power. Your Kp is 100/x.

For my understanding, an SSR is on/off right? So what I’m seeing is pretty fast on/off switching to reduce the heating power?

This is what I’m seeing with the default settings (version 0.4.2):

Also, I don’t have a cooler connected (considering the outside temperature), does that mean I have to be more conservative with the heater settings?

I have 2 20W heating elements installed by the way.

I am not happy that it takes too long for the integrator to go back to zero in cases like this. I am going to set up a simulation to mimic this and then will try changing the algorithm to better handle it.

With just 2x 20W I think you can increase Kp to for example 40.

I have one extra 20W heating element which I can install now, so it totals to 60W, that must be enough for tomorrows brew (looking forward to it).

I still see the SSR led blink a lot for a second or so, I expected it too be at least the 4 seconds from the default settings, or am I wrong about what that setting does (PWM period)?

It doesn’t look too bad a few hours later:

(the only setting changed is the dead time between switching, I set it to 60s)

The dead time between switching is for switching between heating and cooling. If you do not have a cooler installed, it should not affect you. But otherwise, I would still suggest a longer dead time to prevent cycling.

The LED should blink with a period of 4 seconds. If you check ‘read values’ in the device manager, you can see the current PWM value. It should be ON for value / 100 * 4.

I think your setup would work better with a larger Ti. Something in the range of 3600s. I would set Kp to 30 or 40. (For heater 1).

The value for PWM reads 3.3. If it should be on for value / 100 * 4 that would be very short and match with what the led tells me.

This is the led this morning: https://www.dropbox.com/home?preview=blinking+led.mp4

I changed the heater settings to Kp: 30 and Ti: 3600 last night and the beer temperature was a flat 20 degrees the second part of the nigth, so flat, that I could hardly beleive it:

Still worried about the SSR, @Elco do you think it will damage the SSR it if it does this for a week?

The SSR movie is not working, you need to generate a share link with dropbox.
SSRs are fine with switching frequently, that is why we use them instead of mechanical relays.

Glad that it flatlined, that’s how I want the chart to look :smiley:

Ah, right, here it is: https://www.dropbox.com/s/h05shah4lq1fm4w/blinking%20led.mp4?dl=0

While the test eventually went very well, the actual start of the fermentation made me wonder. The beer temperature slowly sank below the set point while the state remained ‘cooling’. I would have expected a switch to heating a lot earlier. Especially when I don’t have a cooler connected and configured.

Can you go to the control algorithm tab, hit the refresh button a few times and paste the JSON here?

Sure, no problem.

{
  "kind": "Control",
  "pids": [
    {
      "kind": "Pid",
      "name": "heater1",
      "enabled": true,
      "setPoint": {
        "kind": "SetPointSimple",
        "value": 9.6445
      },
      "inputSensor": {
        "kind": "TempSensor",
        "name": "fridge",
        "sensor": {
          "kind": "OneWireTempSensor",
          "value": 9.125,
          "connected": false,
          "address": "282E113607000031",
          "calibrationOffset": 0
        }
      },
      "inputError": -0.5273,
      "Kp": 30,
      "Ti": 3600,
      "Td": 60,
      "p": 15.8203,
      "i": 0.2969,
      "d": 0.1172,
      "actuatorIsNegative": false,
      "outputActuator": {
        "kind": "ActuatorPwm",
        "value": 16.2344,
        "period": 4,
        "minVal": 0,
        "maxVal": 100,
        "target": {
          "kind": "ActuatorMutexDriver",
          "mutexGroup": {
            "kind": "ActuatorMutexGroup",
            "deadTime": 1800000,
            "lastActiveTime": 128844999
          },
          "target": {
            "kind": "ActuatorPin",
            "state": false,
            "pin": 17,
            "invert": false
          }
        }
      }
    },
    {
      "kind": "Pid",
      "name": "heater2",
      "enabled": true,
      "setPoint": {
        "kind": "SetPointSimple",
        "value": null
      },
      "inputSensor": {
        "kind": "TempSensor",
        "name": "beer2",
        "sensor": {
          "kind": "TempSensorDisconnected",
          "value": null,
          "connected": false
        }
      },
      "inputError": 0,
      "Kp": 10,
      "Ti": 600,
      "Td": 60,
      "p": 0,
      "i": 0,
      "d": 0,
      "actuatorIsNegative": false,
      "outputActuator": {
        "kind": "ActuatorPwm",
        "value": 0,
        "period": 4,
        "minVal": 0,
        "maxVal": 100,
        "target": {
          "kind": "ActuatorMutexDriver",
          "mutexGroup": {
            "kind": "ActuatorMutexGroup",
            "deadTime": 1800000,
            "lastActiveTime": 128844999
          },
          "target": {
            "kind": "ActuatorNop",
            "state": false
          }
        }
      }
    },
    {
      "kind": "Pid",
      "name": "cooler",
      "enabled": true,
      "setPoint": {
        "kind": "SetPointSimple",
        "value": 9.6445
      },
      "inputSensor": {
        "kind": "TempSensor",
        "name": "fridge",
        "sensor": {
          "kind": "OneWireTempSensor",
          "value": 9.125,
          "connected": false,
          "address": "282E113607000031",
          "calibrationOffset": 0
        }
      },
      "inputError": -0.5273,
      "Kp": 10,
      "Ti": 1800,
      "Td": 200,
      "p": 5.2734,
      "i": -9.1445,
      "d": 0.0391,
      "actuatorIsNegative": true,
      "outputActuator": {
        "kind": "ActuatorPwm",
        "value": 3.832,
        "period": 1200,
        "minVal": 0,
        "maxVal": 100,
        "target": {
          "kind": "ActuatorMutexDriver",
          "mutexGroup": {
            "kind": "ActuatorMutexGroup",
            "deadTime": 1800000,
            "lastActiveTime": 128844999
          },
          "target": {
            "kind": "ActuatorTimeLimited",
            "minOnTime": 120,
            "minOffTime": 180,
            "maxOnTime": 65535,
            "active": false,
            "target": {
              "kind": "ActuatorNop",
              "state": false
            }
          }
        }
      }
    },
    {
      "kind": "Pid",
      "name": "beer2fridge",
      "enabled": true,
      "setPoint": {
        "kind": "SetPointSimple",
        "value": 10
      },
      "inputSensor": {
        "kind": "TempSensor",
        "name": "beer1",
        "sensor": {
          "kind": "OneWireTempSensor",
          "value": 10,
          "connected": false,
          "address": "28E6F335070000DE",
          "calibrationOffset": 0
        }
      },
      "inputError": 0.0156,
      "Kp": 2,
      "Ti": 7200,
      "Td": 1200,
      "p": -0.0313,
      "i": -0.6055,
      "d": 0.2813,
      "actuatorIsNegative": false,
      "outputActuator": {
        "kind": "ActuatorSetPoint",
        "targetSetPoint": {
          "kind": "SetPointSimple",
          "value": 9.6445
        },
        "targetSensor": {
          "kind": "TempSensor",
          "name": "fridge",
          "sensor": {
            "kind": "OneWireTempSensor",
            "value": 9.125,
            "connected": false,
            "address": "282E113607000031",
            "calibrationOffset": 0
          }
        },
        "referenceSetPoint": {
          "kind": "SetPointSimple",
          "value": 10
        },
        "output": -0.3555,
        "achieved": -0.875,
        "minimum": -10,
        "maximum": 10
      }
    }
  ],
  "sensors": [
    {
      "kind": "TempSensor",
      "name": "fridge",
      "sensor": {
        "kind": "OneWireTempSensor",
        "value": 9.125,
        "connected": false,
        "address": "282E113607000031",
        "calibrationOffset": 0
      }
    },
    {
      "kind": "TempSensor",
      "name": "beer1",
      "sensor": {
        "kind": "OneWireTempSensor",
        "value": 10,
        "connected": false,
        "address": "28E6F335070000DE",
        "calibrationOffset": 0
      }
    },
    {
      "kind": "TempSensor",
      "name": "beer2",
      "sensor": {
        "kind": "TempSensorDisconnected",
        "value": null,
        "connected": false
      }
    }
  ],
  "actuators": [
    {
      "kind": "ActuatorPwm",
      "value": 3.832,
      "period": 1200,
      "minVal": 0,
      "maxVal": 100,
      "target": {
        "kind": "ActuatorMutexDriver",
        "mutexGroup": {
          "kind": "ActuatorMutexGroup",
          "deadTime": 1800000,
          "lastActiveTime": 128844999
        },
        "target": {
          "kind": "ActuatorTimeLimited",
          "minOnTime": 120,
          "minOffTime": 180,
          "maxOnTime": 65535,
          "active": false,
          "target": {
            "kind": "ActuatorNop",
            "state": false
          }
        }
      }
    },
    {
      "kind": "ActuatorPwm",
      "value": 16.2344,
      "period": 4,
      "minVal": 0,
      "maxVal": 100,
      "target": {
        "kind": "ActuatorMutexDriver",
        "mutexGroup": {
          "kind": "ActuatorMutexGroup",
          "deadTime": 1800000,
          "lastActiveTime": 128844999
        },
        "target": {
          "kind": "ActuatorPin",
          "state": false,
          "pin": 17,
          "invert": false
        }
      }
    },
    {
      "kind": "ActuatorPwm",
      "value": 0,
      "period": 4,
      "minVal": 0,
      "maxVal": 100,
      "target": {
        "kind": "ActuatorMutexDriver",
        "mutexGroup": {
          "kind": "ActuatorMutexGroup",
          "deadTime": 1800000,
          "lastActiveTime": 128844999
        },
        "target": {
          "kind": "ActuatorNop",
          "state": false
        }
      }
    }
  ],
  "setpoints": [
    {
      "kind": "SetPointNamed",
      "name": "beer1set",
      "setPoint": {
        "kind": "SetPointSimple",
        "value": 10
      }
    },
    {
      "kind": "SetPointNamed",
      "name": "beer2set",
      "setPoint": {
        "kind": "SetPointSimple",
        "value": null
      }
    },
    {
      "kind": "SetPointNamed",
      "name": "fridgeset",
      "setPoint": {
        "kind": "SetPointSimple",
        "value": 9.6445
      }
    }
  ]
}

I have this issue as well. Maybe it’s not an issue per se, but more a consequence of a set of settings and equipment.

I know that you’re busy Elco, but it seems like a good idea to help out new users with setting guidelines how to program the Spark. The descriptions in the settings of the controllers (kP, Td, etc) are a challenge for me to understand, as I’m sure they are to other less technically gifted/experienced users. I could imagine that some examples would go a long way in helping out starters, tying in with an earlier request on the forum for a more commercialized, beginner friendly and supportive approach.

For example, I have a ‘nervous’ controller as well, with the led on the heat controlling ssr blinking every seconds as well. I see a lot of action on the fridge setting where I think a more ‘relaxed’ setting would be sufficient.

Would like to know what you think! Anyway, great job so far, keep up the good work.

Rogier

2 Likes

I am also seeing this exact same scenario. My LED is blinking, the status is heating (over an hour now) and the fridge temp is very close to what it should be. I am running a 50W heating cable (http://bit.ly/1Q5EXXQ) which doesn’t respond very quickly to on/off. When I tested it by just plugging it into the wall it took a good 10 minutes before I felt any heat. However, once it got going it became nice and warm. The beer is at the right temp, it’s just concerncing to see the heater going for over an hour without a noticeable change in the fridge temperature.

The ON/OFF behavior is normal, it is how we regulate the power to the heater. The ON/OFF ratio varies with how much heat is needed. It is heating just enough to keep the fridge at the desired temperature. You don’t want the temperature to rise when it is at the setpoint.