Hello everybody,

I hope you can help me with a setup using the VESC as a DC motor controller.

I have a small project where I need to "guesstimate" the torque of a cheap cordless drill while drilling.

It does not need to be terribly precise but I need a measurement to get into the right ballpark for selecting a motor to later drive the drill in a similar setup.

I have a (prohibitively expensive) Torque measurement sensor from my employer here that is however not a rotating type of device so i can only measure torque stationary. I can sadly not simply fix the workpiece to be drilled to the sensor and make a centric bore.

So I thought why not use the VESC in DC mode, hook it up to the cordless drill and try to find out the motor torque constant by measuring torque while applying a range of currents using BLDC tool. Obviously there would be some offset due to friction in the planetary gears etc. but I expect to be able to figure that out. Later then I would use the VESC to log the current and calculate the torque from that.

Now I have the drill grabbing the axis of the sensor and its locked in place by a vise. I use a lab power supply. Here is where the confusion starts. As far as the setup goes i have a brushed DC motor that is blocked so all measurements are in a stall condition. However if I ask BLDC tool to apply eg 5A of motor current the lab supply still just shows 1.4 A delivered to the VESC. I do get sort of repeatable results and for currents below 4A(according to BLDC Tool) the Torque rises with the current as expected but when asking BLDC tool to deliver eg. 7A the tool says it does so, but the torque remains the same. I do not think the motor is "topped out" at 7A motor current also since the torque is nowhere near the max. torque when using the standard battery setup without VESC. So here are my questions:

1.

For the controller, the motor should look just like a coil of thick wire so essentially once the magnetic field has build up it's a short circuit as it can't turn. How come the Motor current is still higher than the lab supply's current. Sure the motor voltage needed to push the current in that condition is low (er than the supplys voltage) but there isn't any transformer anywhere so i expected the excess needs to be "burnt" by the MOSFETs. What am I not seeing ?

2.

ok let's assume the VESC somehow converts the excess voltage and efficiently supplies the "coil". How come the setup could "top out" at a mere 4A ? MOSFET temp is at 30° which is barely above ambient (summer yay). the Lab supply isn't at its limit at least by indicators and the drill spits out just around 0.7Nm which is far from what it should be able to.

Or does anyone have a better solution to the overall problem (on a budget so please don't suggest buying a rotating Torque measurement sensor as these devices tend to be serious $ ) ?

Thank you for the help !

Max

## DC Battery amps vs. Motor Amps

### Re: DC Battery amps vs. Motor Amps

Conversion between motor amps amd battery amps...

Let's imagine you do an FOC detection of your motor and it says the winding resistance is 0.0432 ohms

this 0.0432 ohms is the resistance from lead to virtual ground point of your motor.

therefore the lead to lead winding resistance is double the detected amount -- 0.0864 ohms

let's imagine your lab dc supply is 50v and you want to supply your motor with 5a @ 50v dc...

5a @ 50v dc is 250 watts

ohm's law:

250w @ 0.0864 ohms: 53.79 amps @ 4.64 effective pwm volts

simply, in order to "draw" 5a @ 50v from your supply, the "battery amp limit" must be 5a and the "motor amp limit" must be 53.79amps

battery amps = motor amps x (duty cycle / 100)

therefore:

5 battery amps = 53.79 motor amps x (9.29% duty / 100)

in simple terms with those amp limit settings, the 50v supply will be effectively lowered to 4.64v via pulse width modulation at 9.29% duty cycle -- & 4.64v applied to a 0.0864 ohm winding results in 250w, 53.79 motor amps, and 5 battery amps.

Let's imagine you do an FOC detection of your motor and it says the winding resistance is 0.0432 ohms

this 0.0432 ohms is the resistance from lead to virtual ground point of your motor.

therefore the lead to lead winding resistance is double the detected amount -- 0.0864 ohms

let's imagine your lab dc supply is 50v and you want to supply your motor with 5a @ 50v dc...

5a @ 50v dc is 250 watts

ohm's law:

250w @ 0.0864 ohms: 53.79 amps @ 4.64 effective pwm volts

simply, in order to "draw" 5a @ 50v from your supply, the "battery amp limit" must be 5a and the "motor amp limit" must be 53.79amps

battery amps = motor amps x (duty cycle / 100)

therefore:

5 battery amps = 53.79 motor amps x (9.29% duty / 100)

in simple terms with those amp limit settings, the 50v supply will be effectively lowered to 4.64v via pulse width modulation at 9.29% duty cycle -- & 4.64v applied to a 0.0864 ohm winding results in 250w, 53.79 motor amps, and 5 battery amps.

### Re: DC Battery amps vs. Motor Amps

Hello Devin,

Thank you for your answer !

I do get the conservation of power centered argumentation what I do not understand is what element in the VESC is actually able to convert excess voltage into current.

I am not using a brushless motor but a plain old brushed DC motor and VESC in DC (second option) mode.

Your explanaition does help however with another confusion I had about the lab supply showing roughly double the current as the battery-current in BLDC tool which I exected to be the same. I guess it assumes the winding resistance to be double the measured value (wrongly as there is no "star point" in this brushed setup). When it then senses the voltage across the shunt it thinks it pushes just half the current.... can anyone confirm that ?

Anyone have an Idea why it won't work above a couple amps ? eg. Motor Torque doesn't increase ? I will try and get an ampmeter in series with the Motor and see what that says.

Thank you for your help

Max

Thank you for your answer !

I do get the conservation of power centered argumentation what I do not understand is what element in the VESC is actually able to convert excess voltage into current.

I am not using a brushless motor but a plain old brushed DC motor and VESC in DC (second option) mode.

Your explanaition does help however with another confusion I had about the lab supply showing roughly double the current as the battery-current in BLDC tool which I exected to be the same. I guess it assumes the winding resistance to be double the measured value (wrongly as there is no "star point" in this brushed setup). When it then senses the voltage across the shunt it thinks it pushes just half the current.... can anyone confirm that ?

Anyone have an Idea why it won't work above a couple amps ? eg. Motor Torque doesn't increase ? I will try and get an ampmeter in series with the Motor and see what that says.

Thank you for your help

Max

### Re: DC Battery amps vs. Motor Amps

Your lab supply might also be using PWM to give a lower "effective" voltage... but in fact is pulsing a higher voltage at a % duty cycle to give your final dc supply voltage... same reason a 4.2v lipo cell could be overcharged leaving it attached to a "4.2v effective voltage" pwm dc supply... i think.

### Re: DC Battery amps vs. Motor Amps

devin wrote:Your lab supply might also be using PWM to give a lower "effective" voltage... but in fact is pulsing a higher voltage at a % duty cycle to give your final dc supply voltage... same reason a 4.2v lipo cell could be overcharged leaving it attached to a "4.2v effective voltage" pwm dc supply... i think.

No way. Lab powersupplies are not PWMing to generate an effective voltage.

For LIPO cells, it is better to be sligtly below 4.2V than exactly at 4.2V. Also if you want to do repeatable capacity measurements, you need to have a good definition of what you call "fully charged". So it's "when the charge current drops below XXX" that defines when you are supposed to stop charging.

It is the coil in the motor.maxkinz wrote:I do get the conservation of power centered argumentation what I do not understand is what element in the VESC is actually able to convert excess voltage into current.

I don't know why your torque doesn't increase beyond a certain point. For me the prime suspect is the motor/drill. If that tops out at some current, that would explain things.

You can measure the KV of the motor (or of the whole drill assembly). Then convert that to SI units: radians/sec per volt. Now take the inverse, and you have your torque constant in Nm/A.

So for example, if I observe my cordless drill to rotate at 120RPM at 12V, I calculate the rad/sec at 2 rotations per second, or 2*2*PI per second. or 12.5 rad/sec at 12V. So my cordless drill does 1.05 rad/sec/V. the inverse is 0.955, so that's my Nm/A torque constant.

### Re: DC Battery amps vs. Motor Amps

maxkinz wrote:Hello Devin,

Thank you for your answer !

I do get the conservation of power centered argumentation what I do not understand is what element in the VESC is actually able to convert excess voltage into current.

In the example, at 9.29% duty cycle-- during the 90.71% of the second the battery isn't applying voltage to the coil [in the motor], the current generated during the 9.29% time is inductively recirculating through the coil, a fact which simultaneously lowers the "effective voltage" of the current and raises the total number of motor amps above the amount which was "drawn" from the battery.

The amount of inductivity measured in henries in the coil is strongly increased by the presence of ferromagnetic element iron-56 in the stator core of each solenoid. Iron-56 has the least mass per nucleon (nuclear particle "mass defect") and nearly the highest nuclear binding energy, and lowest nuclear "excess energy" of all elements, and I suspect these properties give rise to ferromagnetism itself through correlation of the geometrical alignment of the iron-56 4 unpaired 3-d electron orbitals and the rotational axis of symmetry of the iron-56 nucleus itself, due to the iron-56 protons having the least mass and therefore least kinetic energy of all elements, in my theory giving rise to a similar effect to precession of a rotation axis via tidal locking in planetary orbits (similar to the moon's orbit stabilizing earth's tilted rotation axis with respect to the ecliptic), but at the quantum scale between the unpaired electrons and the symmetry axis of the iron-56 nucleus, leading to ferromagnetism we witness in the world.

Simply if you want to change the orbit axis of the 4 unpaired 3-d electron orbitals on an iron-56 nucleus with a nearby EM field, you have to change the rotational symmetry axis of the whole nucleus which has much more mass, leading to a delay in changing the axis, and requirement of additional energy above what it would otherwise require to change the electrons' orbits themselves compared to a non-ferromagnetic material, and this "tidal locking" between the electron orbitals and nucleus is due to the iron-56 protons having the least mass and therefore lowest kinetic energy of all elements, I think.

Last edited by devin on 02 Jul 2017, 18:33, edited 3 times in total.

### Re: DC Battery amps vs. Motor Amps

Where devin says "coil" he means motor.

The battery, for example sees 10A, 10% of the time, or an average of 1A, while the motor sees the current of 10A running all the time, as the current recirculates through another mosfet. You could think of that 10A being constant due to the inductance of the motor. This is approximated when the inductance of the motor is very high and the PWM frequency too. In reality the current will rise from say 9A to 11A during the 10% on-time, and then decay from 11A to 9A during the 90% off-time.

The battery, for example sees 10A, 10% of the time, or an average of 1A, while the motor sees the current of 10A running all the time, as the current recirculates through another mosfet. You could think of that 10A being constant due to the inductance of the motor. This is approximated when the inductance of the motor is very high and the PWM frequency too. In reality the current will rise from say 9A to 11A during the 10% on-time, and then decay from 11A to 9A during the 90% off-time.

### Re: DC Battery amps vs. Motor Amps

Thank you guys,

that does make sense to me so I think i got it .

Do you guy think the setup will bring me the expected results ?

This may actually be limiting my setup as the lab supply isn't capable of terribly high currents - I just thought it'd be fine since it said it was only pushing 1.5 A (average then) but i think it tops out at 5A. I guess I'll try using a battery or an ATX computer supply I got lying around with 30A capacity on the 12V line.

I'll see if i get a good linear relationship between measured torque and current. Thanks for the help !

Max

that does make sense to me so I think i got it .

Do you guy think the setup will bring me the expected results ?

The battery, for example sees 10A, 10% of the time, or an average of 1A, while the motor sees the current of 10A running all the time, as the current recirculates through another mosfet.

This may actually be limiting my setup as the lab supply isn't capable of terribly high currents - I just thought it'd be fine since it said it was only pushing 1.5 A (average then) but i think it tops out at 5A. I guess I'll try using a battery or an ATX computer supply I got lying around with 30A capacity on the 12V line.

I'll see if i get a good linear relationship between measured torque and current. Thanks for the help !

Max

### Re: DC Battery amps vs. Motor Amps

I'm not sure if normal powersupplies are quick enough. to go into "current mode" during the PWM cycle. I do hope you have an input capacitor near your VESC, right?

Suppose you're running at 10%, 1A average, 10A peak, from your powersupply with the recommended 2000uF of capacitance near the VESC. Now I = C dU/dt -> dU = I dt/C = 10A . 5us / 2mF = 25mV.. So with your powersupply at 20V, with the powersupply reacting instantly to the 10A currentdraw and putting out no more than say 2A, the difference of 8A will be drawn from the capacitor on (near) the VESC. That will cause a voltage drop on the capacitor of at most 25mV (for the 25mV we assumed the capacitor was doing ALL the current). So after the on-time, the supply has 45 microseconds to replenish the 25mV in the capacitor. At 2A that will take I = C dU/dt -> dt = C dU / I = 2000uF . 25mV / 2A = 25 microseconds. the off-time is 45 microseconds, so then there is a period of 20 microseconds where the power supply is simply in "constant voltage" mode.

So... IF your powersupply is perfect and switches to constant current mode instantly things should still work fine.

Suppose you're running at 10%, 1A average, 10A peak, from your powersupply with the recommended 2000uF of capacitance near the VESC. Now I = C dU/dt -> dU = I dt/C = 10A . 5us / 2mF = 25mV.. So with your powersupply at 20V, with the powersupply reacting instantly to the 10A currentdraw and putting out no more than say 2A, the difference of 8A will be drawn from the capacitor on (near) the VESC. That will cause a voltage drop on the capacitor of at most 25mV (for the 25mV we assumed the capacitor was doing ALL the current). So after the on-time, the supply has 45 microseconds to replenish the 25mV in the capacitor. At 2A that will take I = C dU/dt -> dt = C dU / I = 2000uF . 25mV / 2A = 25 microseconds. the off-time is 45 microseconds, so then there is a period of 20 microseconds where the power supply is simply in "constant voltage" mode.

So... IF your powersupply is perfect and switches to constant current mode instantly things should still work fine.

### Re: DC Battery amps vs. Motor Amps

Hi Rew,

Thank you for the answer. I don't think the powersupply would be that quick but it also doesn't seem to be the problem with my setup. The VESC has the recommended input capacitance so I think you're right about the current being supplied by the caps for the time inbetween.So far I do not get any better results using the battery. I will investigate further as the maximum torque I achieve using the VESC is far less than what I get with the drill as it came out of the box.

I just removed the proportional control button and replaced it with the VESC. I use either the lab supply or the original battery that came with the drill to supply the VESC. So far the max. Torque I get is abysmal, fast gear setting below 1Nm at 10A motor current, for slow gear setting (Screw mode) about 3 Nm @ 10A. The drill is a cheapo cordless drill PABS 12 B2.

If you have any more Ideas I#d like to hear them.

Thanks,

Max

Thank you for the answer. I don't think the powersupply would be that quick but it also doesn't seem to be the problem with my setup. The VESC has the recommended input capacitance so I think you're right about the current being supplied by the caps for the time inbetween.So far I do not get any better results using the battery. I will investigate further as the maximum torque I achieve using the VESC is far less than what I get with the drill as it came out of the box.

I just removed the proportional control button and replaced it with the VESC. I use either the lab supply or the original battery that came with the drill to supply the VESC. So far the max. Torque I get is abysmal, fast gear setting below 1Nm at 10A motor current, for slow gear setting (Screw mode) about 3 Nm @ 10A. The drill is a cheapo cordless drill PABS 12 B2.

If you have any more Ideas I#d like to hear them.

Thanks,

Max

### Who is online

Users browsing this forum: No registered users and 1 guest