# BLDC: 'pseudo'-torque control in sensorless setup

Hey all,

I have a setup with a 3-phase BLDC motor (outrunner, 22 poles, 24 slots), an L6234 driver (not IC) and a rotary encoder, for which I want to implement some sort of torque control. I understand that this is not so simple without current sensors, since current control tends to go hand-in-hand with torque control.

But what I think is possible, though, is using the angle between the rotor field direction and the stator field in order to implement some kind of torque control. Since the torque is maximal when the angle is 90 degrees, the control scheme would be something along the lines of -

1. measure rotor angle (encoder)
2. measure stator field angle (i.e. phase, this is the tricky part)
3. compare the angles - the difference should be 90 degrees (or something equivalent, in electrical degrees)
4. change this difference until it reaches 90

So, that's the gist of it.

But the (big) question is - how do I turn this into code?? Ha.

As of right now, I have a code to control both position and speed; by using a sine wave lookup table to send PWM values to the motor driver (sinusoidal commutation).
That's nice, but I can't figure out a way to measure the field angle (of the stator, that is) from a given trio of PWM values.

Does anyone have an idea? Or, perhaps, a suggestion for some other kind of solution?

Any help would be greatly appreciated.

Excellent presentations on field-oriented control: Teaching Old Motors New Tricks - Part 1 - YouTube

What do you mean by stator field? Do you mean flux?

Firstly you have an encoder, so this is a sensored motor, not sensorless, or can be
thought of as a PMAC motor with rotor angle sensing.

But you have 11 pole pairs, which is demanding a lot from the encoder (is it absolute?
what resolution? You have nearly 4000 electrical degrees per revolution).

So you can always apply a voltage drive to the stator at right angles to the rotor flux, which
at low speeds (winding resistance dominates) is enough to ensure efficient operation.
This is not torque control, that is basic commutation.

At high speeds that's not great as the winding inductance dominates. You normally measure
the current and use a control loop to drive the PWM so that the current vector is where you
want it, ie at 90 degrees to rotor flux. And if you are measuring current you can also control
the amplitude of modulation to control the torque - that's how its done.

The problem is to estimate stator flux you need to know both stator voltage, current and resistance,
so you still need to measure current. And it doesn't work at very low speeds.

In theory you could add extra windings and measure back EMF directly on an unloaded winding
to estimate stator flux (well, its derivative). And it doesn't work at very low speeds.

Measuring current works from stationary upwards, and without it you are very limited in
control posibilities.

The other approach is to sense the load rather than the motor, so that you can modulate the
drive level from a knowledge of the load response curve (such as for a fan) since the torque
is a well defined function of speed, so you turn torque control into a problem of speed control.
Only works for well defined loads of course.

MarkT:
What do you mean by stator field? Do you mean flux?

I guess so! The direction of flux through the coils (?).

Firstly you have an encoder, so this is a sensored motor, not sensorless, or can be
thought of as a PMAC motor with rotor angle sensing.

Oops, I was under the impression that any setup without Hall sensors or back-emf detection was called "sensorless", for some reason.

But you have 11 pole pairs, which is demanding a lot from the encoder (is it absolute?
what resolution? You have nearly 4000 electrical degrees per revolution).

The encoder is incremental, with 20000 pulses per 360 degrees, so it's pretty good, resolution-wise.

Measuring current works from stationary upwards, and without it you are very limited in
control possibilities.

Ah, I see. So there's not much to be done here without current measurement.

I think I'm going to try to connect a resistor to two of the driver pins in order to measure the current (there are designated pins as in the datasheet, but since I'm not using the standard IC (using a 'driver' setup) I'm going to have to add the resistors manually).
Do you think this is a viable solution?

No, you need to measure the phase currents, only 2 need to be measured as w = -u-v in a u,v,w
3-phase load. The gives you the current vector directly. With 3-phase PWM its distinctly non-trivial
to determine phase currents from driver ground return, I wouldn't suggest trying. You'll need to measure
fairly quickly, the Arduino ADC may be too slow, a 1MSPS SPI ADC is a reasonable possibility, I've used such
with ACS711's and ACS712's for such purposes.

Oh, I see. I might have to work with a different driver then if I eventually want to implement FOC.

Thanks for all the help!