QPIDfirmware  v0.1
Object oriented firmware for autonomous motor drivers with encoder based PID controller and flexible interface
QPID_Encoder_ESP32 Class Reference

Implements a quadrature encoder using ESP32's super cool hardware counters (yeah!). Based on the ESP32Encoder library by Kevin Harrington (madhephaestus). More...

Inheritance diagram for QPID_Encoder_ESP32:

Public Member Functions

double getCount ()
 Returns current incremental position. Angular type encoders, which start counting at 0 after a full turn, need to keep book of full turns internally and compute the incremental count accordingly.
 
void setCount (double count)
 set count of current encoder position More...
 
void clearCount ()
 set count of current encoder position to 0
 
void pauseCount ()
 Ignore any pulses until resumeCount() is called.
 
void resumeCount ()
 Resume counting, after having it stopped by pauseCount()
 
double getTicksPerRevolution ()
 ...
 
void init (double t, uint8_t a, uint8_t b, encType type)
 attach ESP32Encoder to pins and clear position to 0 More...
 
- Public Member Functions inherited from QPID_Encoder
void setFilter (double value)
 Set filter to smoothen faulty or jittery absolute readings. More...
 
double getFilteredCount ()
 Returns current position count with filter setting applied. More...
 
- Public Member Functions inherited from QPID_Object
virtual void update ()
 (abstract) Can be overridden by QPID subsystems which need to do their own polling. Will be called by QPID_Unit::update() for subsystems, and by firmware/client for QPID_Unit itself.
 
void throwError (const char *invokedBy, const char *errorMessage)
 Writes error message and error invoking class to Serial. More...
 
void log (const char *logEntry)
 Puts timestamped string into the system log (atm: writes it out to Serial). More...
 

Protected Member Functions

bool processMessage (uint8_t *m) override
 (abstract) Interprets message handed down from QPID_Unit locally. Must be overridden in derived classes
 
- Protected Member Functions inherited from QPID_Object
 QPID_Object ()
 Constructor. Begins Serial with 115200 baud for logging and error reporting, if not done previously.
 

Additional Inherited Members

- Public Attributes inherited from QPID_Encoder
double ticksPerRevolution
 
- Protected Attributes inherited from QPID_Encoder
double filter = 0
 
double lastCount = 0
 

Detailed Description

Implements a quadrature encoder using ESP32's super cool hardware counters (yeah!). Based on the ESP32Encoder library by Kevin Harrington (madhephaestus).

QPID_Encoder)

Todo:
check private, protected etc. for all derived classes

Member Function Documentation

◆ setCount()

void QPID_Encoder_ESP32::setCount ( double  count)
virtual

set count of current encoder position

Parameters
countposition to set

Reimplemented from QPID_Encoder.


The documentation for this class was generated from the following files: