Skip to content

Multi Channel Configurable PID regulator on M5Stack Core

License

Notifications You must be signed in to change notification settings

knifter/DualPID

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DualPID

Dual channel PID regulator. Each channel is (compile time) configurable to read out a sensor and control an output (on/off or H-Bridge). It could for example be used for:

  • Temperature and/or Humidity control (Incubator or Grow box)
  • Reflow Oven (either use one channel or two 'zones')

Currently used for controlling both temperature and humidity but should be versatile enough to control any two things from different sensors. The general design goals are:

  • Least work hardware: Use existing, easily buyable parts like M5Stack.
  • Two channel PID with
    • Lock detection
    • Linear forward term with offset and slope
    • Derivative-on-measurement
    • Intergral windup prevention
    • On-Device editable PID settings
    • Input filter
    • D-term filter
    • Planned: Take-back-half
  • Fixed output setting to measure step response
  • Lock-detection
  • Alarms
  • Expert-Mode: Hide Setup and PID settings on normal usage (press A+B+C for 2 seconds to open configuration)
  • Two H-Bridge outputs able to control most things from heaters, peltiers, valves etc (temporarily removed)
  • Two single pin positive drive outputs capable of:
  • SlowPWM (<1Hz) and FastPWM (>1 Hz up to kHz) outputs
  • Easy to add sensors as inputs or other output methods (implemented in classes and run-time configurable)
  • Multiple sensors: Temperature, Humidity, CO2, more to come
  • Adjustable time intervals per channel (100ms - minutes)
  • run-time configurable: Input sensor and output drive configurable through GUI, no recomile for your combination
  • Error graphs
  • Remote logging (csv, mqtt or other)
    • SerialPlot filterable data
    • Yaapt is planned
    • MQtt

Incubator

Hardware

Start with M5Stack Cushion, mandatory lab equipment

Base

Backplane (optional)

Sensor

Output Drivers

Ideas which could be added/supported/implemented:

Dependencies

Credits

Originally this design was based upon https://github.com/sciunto-org/humidity_regulator, an arduino sketch for an Ardiuno Uno. But since I've replaced even the PID loop library, I don't think there is anything left of that design. But the idea came from them so credit where credit is due ;)

The user interface is build with the Light Weight Versatile Graphics library: LVGL The screen library is written by lovyan03, LovyanGFX