Sensorless Control Techniques

rhitee05

10 kW
Joined
Apr 7, 2009
Messages
841
Location
Upstate SC
One of my goals is to eventually develop a high-performance controller. I plan to incorporate some advanced features, including field-oriented control and hybrid sensored/sensorless operation. For the time being, I'm focused on the algorithmic details of how the control will function, especially the sensorless aspect. I thought the community might benefit from a discussion on this topic. So, what I plan to do is go over the basics of sensorless control and discuss the various approaches to implementing it. It's far from a "solved" problem, and there seems to be a lot of active academic research in this area which I've been mining to try and find the "best" technique for our purposes. I'm hoping this thread will lure some of the experts to share their knowledge and experiences, and can help to answer questions from other members looking to learn more.

Sensored vs. Sensorless

For the un-initiated, BLDC motor control requires knowledge of the motor position so we can sent the appropriate signals to the FET switches. Many e-bike motors use Hall effect sensors to provide this information (AFAIK, virtually all motors designed for e-bike use). Most RC motors and some others do not have Hall sensors, and so require the use of sensorless controllers (RC ESCs, mainly). Sensorless controllers measure the phase currents and/or voltages and use them to estimate the position. Some members have come up with various ways to add sensors to these motors to allow the use of regular sensored e-bike controllers. Most just accept (grudgingly) the limitations of the ESCs and live with them.

Sensorless advantages:
- Obviously, does not require the extra sensor hardware. This can mean a smaller motor, and also means fewer wires going to/from the motor.
- More reliable (no chance of sensors failing)
- At high speeds, more accurate position information (sensor accuracy relies on accuracy of their physical position)

Sensorless disadvantages:
- For the most part, no way to detect motor position at zero speed. This means less torque capability from stop and at low speeds
- Position accuracy decreases at lower speeds
- Requires more processing power, especially for more advanced techniques

Goals

I think it should be fairly obvious from the above that for our purposes a controller using a combination of both techniques would be ideal. Sensors allow for reliable, high-torque operation from a stop and at low speeds. Sensorless methods give very accurate position at higher speeds, which allows the use of more advanced control techniques for high-performance operation. Since there are a large number of techniques to accomplish sensorless control, we'd like to determine what the best one is. For my purposes, I consider that to be ease of implementation, good accuracy at lower speeds, and flexibility for a variety of motors. We also need to develop the best method to combine the information from both sensors and sensorless.

Sensorless Techniques

Most of the techniques rely on measuring or estimating the back EMF waveforms of the motor, or sometimes the flux waveforms (which are basically equivalent). Since these waveforms depend on the rotor position, they can be used to provide the desired information. If the Kv is known, the magnitude of the EMF can also be used to estimate the speed (speed can also be determined by the rate of change of position).

I plan to go into more detail in later posts. For now, a quick overview of the techniques I'm planning to investigate so far:

Zero-Crossing Detection
AFAIK, this is the technique used by most (perhaps all) of the sensorless ESCs commonly in use here. The controller directly senses the back EMF on the undriven phase and uses this to control commutation. This is pretty simple to implement, requires only a small amount of additional hardware, and very little extra processing. However, it completely fails a low speeds and only allows for basic 6-step commutation (not sinusoidal or field-oriented control). I plan to use a post to discuss this since its so widely used, but I'm looking for a better method.

Structural Methods
I'm going to lump a variety of different methods under this heading. The inductance of the phase coils will vary as the rotor moves, which can be used to sense position. However, this requires knowledge of the motor structure, and generally doesn't work very well for motors using surface-mounted magnets (which are virtually all e-bike motors). Some variations on this will inject high-frequency signals into the motor or rely on harmonics of the PWM signal. In general these methods are highly dependent on the type and structure of the motor, so I would prefer a method that's more general. I don't plan to investigate these techniques any further.

Estimation Methods
The electrical theory of BLDC motors is well known. The controller knows what voltages are being applied to the phases, and current sensors measure the phase currents, so we can use the electrical theory to develop a formula for either the back EMF or the magnetic flux. Either one will allow us to estimate the rotor position. This requires we know the electrical parameters of the motor - phase resistance and inductance, also possibly the Kv. These methods show some promise as being relatively easy to implement.

Luenberger Observer
This is similar to the estimation methods. Knowing the electrical parameters of the motor, we can construct a model which given the inputs (phase voltages) will predict the outputs (phase currents and back EMFs). We can also compare the measured and predicted phase currents, and use the error as feedback to correct the model. This is called a Luenberger observer. The back EMFs can then be used as in the estimation method to estimate the rotor position. This is a little more complex than straight estimation, but feedback should make it more accurate. In particular, this method seems to be robust even when the electrical parameters are not exact.

Kalman Filter
This technique also relies on a model of the motor and feedback using the measured currents. However, the feedback is now based on the estimated error in the measurement, as well. This has the potential to perform better at low speeds, when more error is present, but is probably the most complex of all techniques.

More to come!
 
For low-RPM sensors another option that is rarely used is optical sensors. The indexing disc can have holes or slots in it to allow the light to shine through onto a light sensor. Also, the disc can be a dull and dark color with reflectic strips where the light is reflected back to the sensor which is next to the light. I have also read about UV lights/sensors being used instead of visible light LEDs.

Don't know if there is any benefit to optical over hall-sensors/magnets, but it is a viable option. The indexing disc can be easily advanced or retarded. I recall one hub that simply had black and white painted sections on an internal part of the hub to reflect the light.
 
Eric, i assume you are aware of Castle's "smartsense" ESC's.. ?

Castle, the leader in brushless technology for RC cars, is pleased to announce the release of our new Mamba Max Pro brushless ESC featuring SMARTSENSEâ„¢ operation. SMARTSENSE brings the best of sensored and sensorless ESC together to create the ideal controller for serious 1/10th scale enthusiasts. Operating at up to 6S, Mamba Max Pro can handle nearly twice the power of the market standard Mamba Max!

Castle Builds A Sensorless Controller?
Hey, we’re never going to just go with the flow, so we’ve built the best of both worlds into the new controller.

* SmartSense uses the motor sensors to start the motor and then it switches over to Castle’s ultra powerful and efficient dynamic sensorless mode which boosts motor efficiency. Simply put, you’ll get more power and less heat from your motor.
* Sensored Only mode runs sensored motors using sensored timing only.
* CHEAT MODE, Castle’s High Energy Advanced Timing allows users to electronically advance their sensored motor’s timing to extreme settings. This can often yield just that extra bit of power needed to win the race. Be careful – there’s never a free lunch, extra power comes with extra motor heat!
 
Eric,

I wish I could add something of value. I do have some observations that might me useful, since a sensored controller doesn't know the rotor position at 0 rpm either. I used a sensorless that actually started smoother than my sensored as long as I gave it just the slightest forward rotation. By smoother I mean the motor was far more silent instead of the bit of growl coming from the motor during takeoff using a sensored controller, which to me sounds like some kind of misfiring in the commutation.

I wish you the best of luck coming up with a better sensorless answer.

John
 
spinningmagnets said:
For low-RPM sensors another option that is rarely used is optical sensors. The indexing disc can have holes or slots in it to allow the light to shine through onto a light sensor. Also, the disc can be a dull and dark color with reflectic strips where the light is reflected back to the sensor which is next to the light. I have also read about UV lights/sensors being used instead of visible light LEDs.

Don't know if there is any benefit to optical over hall-sensors/magnets, but it is a viable option. The indexing disc can be easily advanced or retarded. I recall one hub that simply had black and white painted sections on an internal part of the hub to reflect the light.

Yes, optical is certainly an option and I know of a few people around here who've tried things like that. I can see both advantages and disadvantages. The optics can get dirty (since they are usually placed outside the motor in these add-ons), but like you mention they're easy to adjust and would also be immune to interference from stray magnetic fields. The detectors do need to be shielded from ambient light, too.

I don't think I've ever heard of them being used for e-bikes, but for high-precision applications a resolver is often used. These are sort of like a rotating transformer with two secondary coils in quadrature to each other (90 deg apart). You can use trig to derive the position with a high degree of precision (small fractions of a degree).

Hillhater said:
Eric, i assume you are aware of Castle's "smartsense" ESC's.. ?

Now I am. :) That sounds very similar to what I'd like to accomplish. I'll have to look and see if they provide any technical info (probably not). Thanks for the tip!
 
John in CR said:
I do have some observations that might me useful, since a sensored controller doesn't know the rotor position at 0 rpm either. I used a sensorless that actually started smoother than my sensored as long as I gave it just the slightest forward rotation. By smoother I mean the motor was far more silent instead of the bit of growl coming from the motor during takeoff using a sensored controller, which to me sounds like some kind of misfiring in the commutation.

It's interesting that you say that. A sensored controller should always know the motor position, even at standstill. There must be something strange going on there, a timing issue or bad sensor or somesuch.
 
Zero-Crossing Detection

This method relies on the fact that in standard 6-step commutation (also known as 120 deg commutation), only two phases of the motor are driven at a time. The third phase is left floating, so it can be used to sense the back EMF of the motor for position information. It's easiest to visualize how this works in a wye-connected motor, but it works exactly the same in a delta-connected motor. It also works the same whether the motor has a trapezoidal EMF (traditionally called BLDC), or sinusoidal EMF (traditionally AC or PMSM), or somewhere in between. Motors with non-trapezoidal EMF shapes will probably experience some torque ripple due to the requirement for 6-step drive, but that's not really important for a discussion of how this works.

My two primary sources for this writeup are AN-901 from Microchip and AN-1946 from ST Micro. These documents, as well as many other similar app notes, can easily be found via Google.

Theory

The goal of BLDC control is to align the phase current and BEMF waveforms. The product of current and back EMF is the power produced by the motor, so by doing so we maximize power output and minimize the losses. At high speeds it's necessary to advance the timing to achieve this (to compensate for inductance), but that's strictly-speaking a separate topic from sensorless control.

BEMF Waveforms.png

The above graph shows the ideal BEMF waveforms in red, black, and blue, with the applied PWM voltages in gray. This shows how the BEMF waveform crosses zero 30 degrees before the ideal commutation change point (when BEMF reaches max). Each of the three phases has two zero-crossings (rising and falling), giving us the required 6 commutation changes. The required 30-degree delay can easily be obtained by using a timer to measure the 60-degree commutation period, then dividing by 2.

Implementation

Obviously, the controller must have a means in hardware to sense the phase voltages and detect the zero crossings. There can be dedicated hardware for each phase, or one set of hardware can be shared since only one phase needs to be measured at a time. There are two main approaches. The first is to use a hardware comparator, whose inputs are connected to the phase and a reference voltage (despite the name, this reference voltage is not necessarily zero - will be discussed later). The comparator provides a digital output which goes low-to-high or high-to-low at the crossing moment. The comparator must have hysteresis to avoid noise and an analog filter is also often used on the input. The second method uses two ADCs to digitize the phase voltage and reference voltage with the comparison and possibly a filter in the digital domain. The second approach offers more flexibility and requires less hardware, since the phase voltage can generally be connected directly to the controller's ADC with little more than a resistor divider, but timing accuracy will be limited by the speed of the ADCs (simultaneous sampling is also usually required). The first approach requires some additional hardware but provides better timing accuracy, as the comparator can trigger an interrupt in the controller.

The phase voltage must be compared against a reference to detect the zero-crossing. In a wye-connected motor, the desired reference is the neutral voltage at the star point. Unfortunately, the actual star point in the motor is not usually accessible, so we have to create a reference instead. One method is to create what's called a 'virtual neutral' by connecting 3 high-value resistors from each phase to a common point. This point should then be at roughly the same voltage as the actual motor neutral and can be used as the reference.



This method works regardless of when the voltage is sampled, as the network will always track the applied phase voltages. The alternative method requires us to choose to sample either during the PWM on-time or during the off-time. During the on-time, with one phase at ground and the 2nd connected to the DC bus, if we assume the motor is symmetric the neutral voltage will be half the DC voltage. We can easily sense the DC voltage and divide by 2 to get the desired reference. If we measure during the off-time, then both phases are approximately at ground (one through the lower transistor and the other through a freewheeling diode), so the reference voltage is ground. In all cases except the ground reference a filter is usually required to smooth the reference voltage. Diode drops, FET resistance, etc. will all contribute small errors between our reference and the actual neutral voltage. The virtual neutral method is a little better in that it should compensate for these.

Timing the voltage samples in conjunction with the PWM waveform is critical, both to avoid the noisy switching edges and so the voltage on both driven phases correspond to the chosen reference. Sampling can be done exclusively during the on- or off-time, but this places a restriction on the available range of duty cycle. For example, if we are sampling during the off-time, we must restrict the maximum duty cycle to less than 100%. We can also allow the system to sample during both on- and off-times, with the only restriction to avoid the edges. This is more flexible, but requires that we switch the reference voltage between samples. A system which uses the external comparator method must have the ability to ignore edge triggers which occur during these restricted times and only accept them during certain windows. Many slightly different schemes are possible, so I don't see any point in listing them all here. AN-1946 from ST discusses several different options in some depth.

Advantages

This is definitely the simplest way to implement sensorless control, with very low processing requirements and only a little bit of extra hardware required. This makes it cheap to implement. Performance is good above a threshold speed, which is basically where the BEMF waveform becomes substantially larger than the noise. Low Kv motors, or motors operated at higher voltage and lower current would seem to have an advantage here. Additional filtering or amplification seem to reduce the threshold speed somewhat if done right. This method does not require any knowledge of the motor parameters (R, L, Kv), and will work with wye- or delta-connected motors, sinusoidal or trapezoid BEMF, etc.

Disadvantages

This method only permits the use of 6-step commutation and not more advanced methods like sinusoidal or field-oriented control. The controller must start up the motor open-loop, which results in reduced torque until the controller is able to sync up. At lower speeds, noise becomes significant compared to the BEMF waveform, which will tend to trigger commutation at non-ideal times and eventually loss of sync. Continuous low-speed operation is either not possible, or will be very jerky near the threshold. High-speed operation (high electrical RPM) will require a very fast ADC or comparator to get accurate timing (not much of a limitation, given the usual speed range of common e-bike motors), so performance will tend to drop off approaching this limit.
 
Back
Top