Custom FOC servo motor system build - Page 1
Forum section: electronics / projects

author: tatus1969
author_rank: Super Contributor
timestamp: June 09, 2017, 02:52:04 pm
content: Last week I completed one of my most recent projects, and I took the time to take some footage that I wanted to share with you.Key specs of this controller:16-90V, 23AHall and encoder inputsPowered by STM32F405, running ST FOC libraryConnected to it: a PMSM servo motor, originally speced at 500W, doing 2kW at 10,000rpm.Some pictures from the build:Videos showing it in action:https://youtu.be/HXEJ5LIHKaEhttps://youtu.be/7w4F_EB-Bqc

author: jbb
author_rank: Super Contributor
timestamp: June 10, 2017, 10:53:23 pm
content: NiceLooks like a good smooth transition through zero on the speed ramp. Does your motor have an encoder built in? (I've been wondering about the practicality of saliency-based rotor position estimators, which in principle do work at zero speed.)I do have a couple of comments if you're planning to do more work:a little berm of solder mask around the surface mount DC rail caps under the main MOSFETs would help keep them in the right place for machine assembly (if you're going that way)have you checked the expected temperature/lifetime of the capacitors?And of course, do you have any plans to share the design?

author: tatus1969
author_rank: Super Contributor
timestamp: June 11, 2017, 08:20:43 am
content: ThanksThe motor has a SinCos feedback (just because it came like that, I got it for free) that I have hooked up to the differential encoder input. Apart from huge noise during zero crossings, the main drawback is that it only has 128 periods per mechanical rev. The motor has 3 pole pairs. That makes oinly 42 steps per electrical rev, which results in a poor velocity feedback bandwidth at low rpm. The microcontroller does hardware based glitch filtering, and the FOC library performs further low pass filtering (sliding average). I have set the history depth to 6 samples (at 2kHz), which was a good compromise of bandwidth limitation and phase current distortion.This means that the same motor with proper encoder feedback could do even better, the step response would be in the range of 3ms then.The FOC library supports saliency based rotor position measurement, and I already checked that this motor would be suitable. I just haven't found the time to experiment with it yet. I would expect quite a lot of nonlinearity, and possibly a noisy signal. But it could be used together with an encoder, in order to be able to start into load directly after power up without the need of an alignment procedure, or even an additional hall sensor.Quote from: jbb on June 10, 2017, 10:53:23 pmThanks, it has that already. I soldered the board with stencil and paste. Without a guard it would have got very messy. The plating is a bit of a relict, I use it to solder litz wires all the way across it to improve the current carrying capability. With that addition, it manages 40A phase current.Quote from: jbb on June 10, 2017, 10:53:23 pmYou caught me on thatThe design was originally targeted at 15A, and they were fine with that. At continuous 23A, or even 40A, they are the hottest spots in the entire circuit. The MLCCs do help a bit, that is 6x4u7, but they are 100V X5R so maybe they have 5u total at full voltage.But I am having a problem here, and that is how to derive the correct current waveform for the DC bus capacitance under load. I have three individual H bridges, each with different PWM duty cylces, and motor current flowing between them, and all that changing while the motor rotates. It is a lot of effort to model all this in LTspice, and the Matlab-Simulink hurdle kept me from going that way either. It should be possible to calculate a graph showing the ripple current as a function of drive voltage (% bus voltage) for a rotating motor.Quote from: jbb on June 10, 2017, 10:53:23 pmThis particular design is for a customer, and I'll have to see how it works out selling my know-how to them. Just wanted to share my work at the moment, but that doesn't tell the future.

author: MagicSmoker
author_rank: Super Contributor
timestamp: June 11, 2017, 10:54:03 am
content: Quote from: tatus1969 on June 11, 2017, 08:20:43 amThe biggest downside to sensorless control is that maximum torque is never as good as it can be with accurate rotor position position feedback, and many sensorless approaches all but fail at zero to very low RPM. Also, the synchronous motor, in particular, is very sensitive to rotor angle error, with torque dropping off dramatically with just a few degrees of error in the estimated position per pole. This is the main reason why there are so many approaches to sensorless rotor angle estimation in the literature and believe me, as someone who has mainly been designing traction drives the last 10 years or so, there isn't a magic bullet here: all the position estimation algorithms suck in one way or another.Quote from: tatus1969 on June 11, 2017, 08:20:43 amDetermining the DC link capacitance and its ripple current rating is probably an exercise in futility. I'll attach a paper by J.W. Kolar from the highly regarded power electronics school at ETH Zurich on this matter:EDIT: whose -> who has

author: tatus1969
author_rank: Super Contributor
timestamp: June 11, 2017, 01:26:59 pm
content: Quote from: MagicSmoker on June 11, 2017, 10:54:03 amST has implemented an interesting approach which they call High Frequency Injection. Basically it uses the power stage to superipose a high frequency test signal on the motor voltages, and it measures the current ripple caused by that. That way they effectively measure the inductance variation of the spinning motor. As I said I would expect the result to suffer from bad S/N and to be highly nonlinear, but it may be good enough to eliminate the need of an additional hall sensor for an application that requires immediate torque at powerup.Quote from: MagicSmoker on June 11, 2017, 10:54:03 am1000 thanks for that, which is exactly what I was looking after for quite some time now. Luckily, they assume the same PWM scheme (center aligned) as the one that I a using. That allows me to make the missing reliability calculation.The paper suggests a factor Ic/In (rms) of roughly 0.63 at 60% modulation index (cos phi = 1)In(peak) = 23A-> In(rms) = 16.3A-> Ic(rms) = 10.3AThe used capacitors are 2x MAL212019221E3 (220uF, 100V). These are low ESR, high temperature, high reliability parts. They are rated at 1.96A(rms) at 10kHz and Tamb=125°C. This means that the ripple current is 2.6 times this value.The controller housing is cooled by forced air in the application. I still have to measure it, but I assume Tamb,max = 50°C for the capacitors for now. The lifetime graphs tells me that the capacitor has a lifetime of 3.0 x 8000hrs under this condition. More than acceptable, checked off the list!

author: tatus1969
author_rank: Super Contributor
timestamp: July 18, 2017, 03:08:29 pm
content: Just for a short update, here are the measured current and velocity step responses of the controller/motor setup. The current step is 0 -> 23A in 170us, the velocity step is 200 -> 5000rpm in 6.8ms.