![]() |
SimpleFOClibrary 2.4.0
|
#include <GenericCurrentSense.h>
Public Member Functions | |
| GenericCurrentSense (PhaseCurrent_s(*readCallback)()=nullptr, void(*initCallback)()=nullptr) | |
| int | init () override |
| PhaseCurrent_s | getPhaseCurrents () override |
| int | driverAlign (float align_voltage, bool modulation_centered) override |
Public Member Functions inherited from CurrentSense | |
| void | linkDriver (FOCDriver *driver) |
| virtual float | getDCCurrent (float angle_el=0) |
| DQCurrent_s | getFOCCurrents (float angle_el) |
| ABCurrent_s | getABCurrents (PhaseCurrent_s current) |
| DQCurrent_s | getDQCurrents (ABCurrent_s current, float angle_el) |
| virtual void | enable () |
| virtual void | disable () |
| int | alignBLDCDriver (float align_voltage, BLDCDriver *driver, bool modulation_centered) |
| int | alignStepperDriver (float align_voltage, StepperDriver *driver, bool modulation_centered) |
| int | alignHybridDriver (float align_voltage, BLDCDriver *driver, bool modulation_centered) |
| PhaseCurrent_s | readAverageCurrents (int N=100) |
Public Attributes | |
| PhaseCurrent_s(* | readCallback )() = nullptr |
| function pointer to sensor reading | |
| void(* | initCallback )() = nullptr |
| function pointer to sensor initialisation | |
Public Attributes inherited from CurrentSense | |
| bool | skip_align = false |
| variable signaling that the phase current direction should be verified during initFOC() | |
| FOCDriver * | driver = nullptr |
| driver link | |
| bool | initialized = false |
| void * | params = 0 |
| pointer to hardware specific parameters of current sensing | |
| DriverType | driver_type = DriverType::UnknownDriver |
| driver type (BLDC or Stepper) | |
| float | gain_a |
| phase A gain | |
| float | gain_b |
| phase B gain | |
| float | gain_c |
| phase C gain | |
| float | offset_ia |
| zero current A voltage value (center of the adc reading) | |
| float | offset_ib |
| zero current B voltage value (center of the adc reading) | |
| float | offset_ic |
| zero current C voltage value (center of the adc reading) | |
| int | pinA |
| pin A analog pin for current measurement | |
| int | pinB |
| pin B analog pin for current measurement | |
| int | pinC |
| pin C analog pin for current measurement | |
Definition at line 13 of file GenericCurrentSense.h.
| GenericCurrentSense::GenericCurrentSense | ( | PhaseCurrent_s(*)() | readCallback = nullptr, |
| void(*)() | initCallback = nullptr |
||
| ) |
GenericCurrentSense class constructor
Definition at line 4 of file GenericCurrentSense.cpp.
|
overridevirtual |
Function intended to verify if:
This function corrects the alignment errors if possible ans if no such thing is needed it can be left empty (return 1)
IMPORTANT: Default implementation provided in the CurrentSense class, but can be overriden in the child classes
Reimplemented from CurrentSense.
Definition at line 57 of file GenericCurrentSense.cpp.
|
overridevirtual |
Function rading the phase currents a, b and c This function will be used with the foc control throught the function CurrentSense::getFOCCurrents(electrical_angle)
Implements CurrentSense.
Definition at line 44 of file GenericCurrentSense.cpp.
|
overridevirtual |
Function intialising the CurrentSense class
Implements CurrentSense.
Definition at line 11 of file GenericCurrentSense.cpp.
| void(* GenericCurrentSense::initCallback) () = nullptr |
function pointer to sensor initialisation
Definition at line 27 of file GenericCurrentSense.h.
| PhaseCurrent_s(* GenericCurrentSense::readCallback) () = nullptr |
function pointer to sensor reading
Definition at line 26 of file GenericCurrentSense.h.