Default mbed pwm doesn't have enough resolution at high frequencies, thats why I implemented VNH5019 Motor carrier with FastPWM.
Fork of VNH5019 by
Diff: VNH5019.h
- Revision:
- 7:76af111bfff3
- Parent:
- 6:c8343fa0f3b4
- Child:
- 8:1458b4da7e56
--- a/VNH5019.h Sun Jan 08 13:08:34 2017 +0000 +++ b/VNH5019.h Thu Apr 27 11:46:05 2017 +0000 @@ -89,9 +89,9 @@ inline float VNH5019::get_current_mA() { - // Scale is 144mV per A - // Scale factor is 3.3 / 0.144 = 22.916667 - return CS.read() * 22916.667; + // Scale is 210mV per A + // Scale factor is 3.3 / 0.210 = 15.7142 + return CS.read() * 15714; } inline