SimpleFOClibrary
2.1
|
#include <InlineCurrentSense.h>
Public Member Functions | |
InlineCurrentSense (float shunt_resistor, float gain, int pinA, int pinB, int pinC=NOT_SET) | |
void | init () override |
PhaseCurrent_s | getPhaseCurrents () override |
int | driverSync (BLDCDriver *driver) override |
int | driverAlign (BLDCDriver *driver, float voltage) override |
Public Member Functions inherited from CurrentSense | |
virtual float | getDCCurrent (float angle_el=0) |
DQCurrent_s | getFOCCurrents (float angle_el) |
Public Attributes | |
int | gain_a |
phase A gain More... | |
int | gain_b |
phase B gain More... | |
int | gain_c |
phase C gain More... | |
Public Attributes inherited from CurrentSense | |
bool | skip_align = false |
variable signaling that the phase current direction should be verified during initFOC() More... | |
Definition at line 11 of file InlineCurrentSense.h.
InlineCurrentSense::InlineCurrentSense | ( | float | shunt_resistor, |
float | gain, | ||
int | pinA, | ||
int | pinB, | ||
int | pinC = NOT_SET |
||
) |
InlineCurrentSense 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 8 of file InlineCurrentSense.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)
Implements CurrentSense.
Definition at line 70 of file InlineCurrentSense.cpp.
|
overridevirtual |
Function intended to implement all that is needed to sync and current sensing with the driver. If no such thing is needed it can be left empty (return 1)
Implements CurrentSense.
Definition at line 58 of file InlineCurrentSense.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 49 of file InlineCurrentSense.cpp.
|
overridevirtual |
Function intialising the CurrentSense class All the necessary intialisations of adc and sync should be implemented here
Implements CurrentSense.
Definition at line 23 of file InlineCurrentSense.cpp.
int InlineCurrentSense::gain_a |
phase A gain
Definition at line 32 of file InlineCurrentSense.h.
int InlineCurrentSense::gain_b |
phase B gain
Definition at line 33 of file InlineCurrentSense.h.
int InlineCurrentSense::gain_c |
phase C gain
Definition at line 34 of file InlineCurrentSense.h.