Overheat protection
This option is not available for ESP8266
Current sensors are required for this option.

In-line current sensing

The current sensors can be used for Field Oriented Control and inline sensing of the current drawn by the motor to prevent overheating.
IMPORTANT: Check what type of sensor and resistor values are being used to determine the right values for the shunt_resistor and gain (see image and code below). Check the PCB pinout to see which analog pins are used to read the sensors.
Gain current sensor: INA240A2: 50 V/V INA240A3: 100 V/V
Values shunt resistors: '4MO' : 4 mΩ 'R030' / 'R05F' : 50 mΩ
Driver PCB: with shunt resistors (pink) and current sensors (orange).
// code derived from https://docs.simplefoc.com/inline_current_sense
// InlineCurrentSensor constructor
// - shunt_resistor - shunt resistor value
// - gain - current-sense op-amp gain
// - phA - A phase adc pin
// - phB - B phase adc pin
InlineCurrentSense current_sense = InlineCurrentSense(shunt_resistor, gain, phA, phB);
// Example INA240A2 & 50mΩ
InlineCurrentSense _current_sense = InlineCurrentSense(0.05, 50, PC1, PC2);
// initialize Feelix with current sense
Feelix feelix = Feelix(&_bldc, &_driver, &_sensor, &_current_sense);
// reading current sense values
// access current sense values
More information regarding how to use the output values from the current sensors in the code will follow soon. More information can also be found at simpleFOC.com
Copy link