rombrew / phobia

Phobia Motor Controller
GNU General Public License v3.0
53 stars 22 forks source link

How to modify phobia to support hw_100_250 #5

Open willt20 opened 1 day ago

willt20 commented 1 day ago

I would like to ask the experts, how to modify the hw_100_250.h file for sampling at the lower end of the resistor so that it can run the phobia firmware, because there is one difference, the positive and negative poles of the op amp are connected in reverse, the code in vesc is #define INVERTED_SHUNT_POLARITY, how should phobia modify it in the configuration file.

rombrew commented 1 day ago

You can specify negative amplifier gain in hw configuration file.

#define HW_HAVE_LOW_SIDE_SHUNT
#define HW_ADC_AMPLIFIER_GAIN       -20.f
willt20 commented 1 day ago

好的,非常感谢您,我来试一下。