![]() |
SimpleFOClibrary 2.4.0
|
#include <LowsideCurrentSense.h>
Public Member Functions | |
| LowsideCurrentSense (float shunt_resistor, float gain, int pinA, int pinB, int pinC=_NC) | |
| LowsideCurrentSense (float mVpA, int pinA, int pinB, int pinC=_NC) | |
| int | init () override |
| PhaseCurrent_s | getPhaseCurrents () override |
Public Member Functions inherited from CurrentSense | |
| void | linkDriver (FOCDriver *driver) |
| virtual int | driverAlign (float align_voltage, bool modulation_centered=false) |
| 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) |
Additional Inherited Members | |
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 16 of file LowsideCurrentSense.h.
| LowsideCurrentSense::LowsideCurrentSense | ( | float | shunt_resistor, |
| float | gain, | ||
| int | pinA, | ||
| int | pinB, | ||
| int | pinC = _NC |
||
| ) |
LowsideCurrentSense class constructor
| shunt_resistor | shunt resistor value |
| gain | current-sense op-amp gain |
| phA | A phase adc pin |
| phB | B phase adc pin |
| phC | C phase adc pin (optional) |
Definition at line 9 of file LowsideCurrentSense.cpp.
| LowsideCurrentSense::LowsideCurrentSense | ( | float | mVpA, |
| int | pinA, | ||
| int | pinB, | ||
| int | pinC = _NC |
||
| ) |
LowsideCurrentSense class constructor
| mVpA | mV per Amp ratio |
| phA | A phase adc pin |
| phB | B phase adc pin |
| phC | C phase adc pin (optional) |
Definition at line 24 of file LowsideCurrentSense.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 88 of file LowsideCurrentSense.cpp.
|
overridevirtual |
Function intialising the CurrentSense class
Implements CurrentSense.
Definition at line 38 of file LowsideCurrentSense.cpp.