Preliminary PWM actuators release

@Elco, my doubt is related how to implement control action translating PID control action to analogWrite value (duty cycle). Seems logic that duty cycle is proportional to error between setpoint and PV, but how to translate it, linearly? Linearly considering what limits (upper and lower)? How is implemented the logic to translate PID control action to 0-255 argument in analogWrite to change the duty cycle?

Thanks,

Fabiano da Mata

This has been implemented in the BrewPi Spark. Not with analogwrite, because that PWM cycle is too fast to work well with a 50Hz AC signal. We wrote our custom, much more advanced PWM algorithm that can take into account time limits and mutual exclusivity of actuators.

We have not build this for Arduino and never will. If you want to do it yourself, that’s fine, but we have abandoned Arduino as a platform.

Ok @Elco. The Spark PWM code is available? Could you tell me where can I find it? The Spark PID is a PID tradictional, or is it modified also?

Thanks,

Fabiano da Mata

The PID is new and the PWM class depends on multiple other classes that are new in the Spark firmware.



This will be hard to migrate to the Arduino.