QPIDfirmware  v0.1
Object oriented firmware for autonomous motor drivers with encoder based PID controller and flexible interface
Todo List
page QPID firmware - Autonomous PID and encoder controlled motor driver

check private, protected, public for all classes

check use of 'override' for all derived classes (because in c++ everything* that makes more fool proob is either optional or not available at all)

Class QPID_Encoder
Add derived base class for angular type encoders which takes care of the full turn wraparound/overflow problem.
Class QPID_Encoder_ESP32
check private, protected etc. for all derived classes
File QPID_Encoder_ESP32.h
Error handling if encoder not attached?
Class QPID_Encoder_QuadratureStateMachine
check private, protected etc. for all derived classes
File QPID_Encoder_QuadratureStateMachine.h
Error handling if encoder not attached?
Class QPID_Endstop_Digital
check private, protected etc. for all dervide classes
Class QPID_Endstop_PinSharedAnalog
check private, protected etc. for all dervide classes
Member QPID_Endstop_PinSharedAnalog::isOn ()

AD converters need short pauses between readings on Arduinos. We could use a timer to recycle very fresh readings.

Also, two endstops sharing the same pin don't know from each other, which complicates the possible problem. Needs testing to see if this actually could lead to errors. A possible solution could be based on semaphores or something like that.

Class QPID_MotorDriver

Initially developed with only DC motors in mind (PWM, frequency, decay etc.). I'd be better to have an even more generic class and derive QPID_DC_MotorDriver and QPID_Stepper_MotorDriver classes

(done) document abstract methods as implementation guide for derived classes. For now, look at sample DRV8833 class

(done) add fault signaling

Class QPID_MotorDriver_AdafruitMotorShieldV2

mostly untested yet.

Access to the master I2C bus should be regulated, in case other subsystems use I2C too (e.g. endstops on an I2C extender). So, for the moment, watch out for possible problems yourself.

(done?) Can only use the system's default I2C bus (Wire). The library supports providing your own Wire interfaces which would make it possible to use an alternate bus, e.g. if the default bis is used for slave access to the device.

Class QPID_Object
(done by eliminating typeid()) Having to editing platform.txt sucks. Find a better way or eliminate typeid().
Member QPID_Object::log (const char *logEntry)
implement smarter logging
Member QPID_Object::throwError (const char *invokedBy, const char *errorMessage)
implement smarter error messaging
Class QPID_Unit
implement acceleration/deceleration ramps as an alternative to PID control
Member QPID_Unit::calibrate (bool findEndstops, bool findMaxSpeed, bool findDeadbands, bool findAccelerationCurve)

Not implemented yet.

Where are these values saved?

Make options an enum insteat of booleans?

Member QPID_Unit::init (QPID_MotorDriver *d, QPID_Encoder *e, QPID_Endstop *es1, QPID_Endstop *es2, unsigned long cycleInterval)
how to reverse? Change polarization of encoder or motor; by software: implement PID.SetControllerDirection()
Member QPID_Unit::runAtSpeed (double speed)

At the moment, no checks are implemented for valid positions, configured PIDs etc.

Implement endstops!!!

Member QPID_Unit::runAtSpeedFor (double speed, unsigned long duration, stopMode mode)

(partly done) At the moment, no checks are implemented for valid positions, configured PIDs etc.

(done) Implement endstops!!!

Member QPID_Unit::runAtSpeedUntil (double speed, unsigned long timeout, stopMode mode)

At the moment, no checks are implemented for valid positions, configured PIDs etc.

Implement endstops!!!

Member QPID_Unit::runTo (double target)
(partly done) At the moment, no checks are implemented for valid positions, configured PIDs etc.