hybridgroup/gobot

Scaling, Smoothing and Controller package(s)

gen2thomas opened this issue · 1 comments

Currently we have 2 types of scaler implemented in gobot:

  • linear scaler
  • NTC scaler

The linear scaler exists multiple times:

  • utils.go (float64 to float64)
  • analog_actuator_driver.go (float64 to int)
  • analog_sensor_driver.go (int to float64)

Further scalers:

  • data point scaler (multiple X-Y points can be given, and a linear scaling is done from point to point)
  • ...

It would be nice to have a dedicated package or folder for data processing which can also contain a implementation for data smoothing (e.g. exponential smoothing).

Questions:

  • Should we introduce such a package folder in gobot?
  • Which name/hierarchy would be nice (e.g. dataprocessing/smooth , dataprocessing/scale)?
  • What about a controller package for the future (PID, bang–bang, double-setpoint etc.)?

There is already a nice controller package: https://github.com/brandondube/pctl

It contains also some useful filters, so there is no need to reinventing the wheel for PID and smoothing.