2020-09-28 01:50 AM
Hello,
I want to use the B-G431B-ESC1 board to control a small motor with FOC.
After looking at the example project from the Motor Control Workbench, I set up the current sensing. In CubeIDE, I connected the motor phases to the OPAMP inputs. The OPAMP outputs are connected to ADC inputs. The OPAMPS are set in PGA mode with a gain of 16.
The motor only draws between -2A to +2A. I understand that the current needs to be polarized because the ADC needs a positive input voltage. The polarization resistor network on the B-G431B-ESC1 seems to be designed to work from -40A to +40A. That means that the 12 Bit ADC can only measure the current with a resolution of roughly 30mA. I checked my calculation with the calculator in the Motor Control Workbench. This resolution is too large to result in a good FOC when controlling the currents.
What are my options to increase to ADC resolution?
I can only think of changing the polarization resistor network but that means soldering the really small SMD resistors.
Are there other options?
Best regards
Michael S.
Solved! Go to Solution.
2020-09-29 01:55 AM
> The motor only draws between -2A to +2A.
> The motor phase resistance is 100mOhm.
So, is your power supply 0.2V?
If not, you can afford bigger shunt. It's not the ohmic resistance of winding which determines the current.
Or, look at it in this way: the 30mA resolution you've calculated for the original setup means 90uV input voltage on the shunt. Do you think you can manage precise measurement of smaller voltage changes?
JW
2020-09-28 03:10 PM
For smaller current, it would be logical to use larger shunts, IMO...
JW
2020-09-29 12:35 AM
Thank you for the reply, I appreciate it.
On the B-G431B-ESC1 board, the shunt has 3mOhm.
The motor phase resistance is 100mOhm. That means that the shunt can’t be too large, right?
I calculated the ADC resolution for a 10mOhm shunt. It would be 9mA. In my -2A to 2A current range, only 450 of the 4096 adc steps would be used. An improvement but still not great.
This might help:
The formula for the output voltage of the OPAMP with the builtin offset resistor network is
Vout = G * (4/7 * Vshunt + 0.1286V), where G is the PGA gain (2, 4, 8, ...) and Vshunt is the shunt voltage.
The term 4/7 and 0.1286V depend on the offset resistor network.
Is it feasible to increase the shunt resistance to something like 20mOhm when the phase resistance is 100mOhm?
If not, are there other possibilities?
Best regards
Michael
2020-09-29 01:55 AM
> The motor only draws between -2A to +2A.
> The motor phase resistance is 100mOhm.
So, is your power supply 0.2V?
If not, you can afford bigger shunt. It's not the ohmic resistance of winding which determines the current.
Or, look at it in this way: the 30mA resolution you've calculated for the original setup means 90uV input voltage on the shunt. Do you think you can manage precise measurement of smaller voltage changes?
JW
2020-09-29 04:07 AM
You are right, the input voltage with the 3mOhm resistor is too small.
I will change the shunt resistor to a 30mOhm one. This should lead to a maximum voltage of 60mV on the shunt and 1.51V to 2.61V on the ADC input. That means I can measure at a resolution of 3mA.
I will inform you about the result.
Best regards
Michael