You are here

Tmotor U8 and VESC6 FOC

27 posts / 0 new
Last post
protontim
Offline
Last seen: 6 years 5 months ago
Joined: 2017-09-25 23:31
Posts: 19
Tmotor U8 and VESC6 FOC

I have a Tmotor U8 100KV (21 pole pairs) running on a VESC6 with a 12S supply.  I was able to adjust the parameters such that I can get it to successfully discover its parameters in FOC mode.  If I mess with the observer gain as well as the current KP and current KI, I can even get it to run to full throttle under load.  However, at full power it draws a good deal more current than it should and when I look at the current waveform on the dc bus (with a current probe) it seems to indicate that the VESC6 is having trouble tracking and commutating synchronously.  I am running in the neighborhood of 70,000 erpm at full throttle and around 25A.  I can poke around twisting knobs for this motor to see if I can do better, but I am kind of flying blind.  Has anyone successfully used this motor and controller combination in FOC mode to spin a prop?  Is there a procedure for tuning FOC that might save me some time verses a random, non scientific hunting approach?  Thanks!!

artteth
artteth's picture
Offline
Last seen: 2 weeks 1 day ago
VESC FreeVESC Original
Joined: 2017-09-05 00:48
Posts: 12

to get better answer make video of your setup

but in my case with 28 poles motor (and u 10 copy motor) i make next

autodetect all foc parametrs

then i adjust in advancet tab switching freq up to 35KHz (with from you have 5Khz steps)

protontim
Offline
Last seen: 6 years 5 months ago
Joined: 2017-09-25 23:31
Posts: 19

Shown below is the steady state plot with the motor running at 90% throttle.  I am running the system at a 40KHz pwm rate (when I look at the phase voltage on the scope each phase appears to switch at 20KHz).  As you can see from the current plot below, there is a serious current ripple that develops at these speeds (~78000 erpm), and an offset in the phase currents.  There is also a corresponding angular rotational phase ripple.  This ripple causes the motor to be inefficient and unstable at these speeds.  Any ideas what might cause this and how to fix it?  Thanks. (BTW looks like we lost the ability to directly paste images)

ThierryGTLTS
Offline
Last seen: 5 years 7 months ago
Joined: 2017-09-06 14:18
Posts: 116

Maxon is a reference of what is possible with high reliability for me.

In their EPOS4 Module 50/15 pdf, you can see that the power stage switches at 50kHz.

They announce a maximum speed of 100000 erpm for block commutation, and 50000 erpm for sinusoïdal drive.

So perhaps you (we) ask too much to the controller.

Don't forget the very high capacitance of the MOSFET and the limited drive possibility of the DRV8301, 1.7A source /2.3A sink.

Have a Nice Day.

Thierry

benjamin
Offline
Last seen: 2 days 2 hours ago
VESC FreeVESC OriginalVESC Platinum
Joined: 2016-12-26 15:20
Posts: 490

Can you give this firmware a try?

http://home.vedder.se/tmp2/BLDC_4_ChibiOS.bin

you can upload it from the custom file tab. It has a modification to the observer that I have been experimenting with, which I used to run a few motors at 160K erpm.

protontim
Offline
Last seen: 6 years 5 months ago
Joined: 2017-09-25 23:31
Posts: 19

Hi Benjamin,

Thanks for taking a look at this, I really appreciate that.  I tried the new code you sent.  It works better and I can now make it to full throttle using FOC - most of the time.

As a quick and dirty way of observing how well the motor is commutating I typically look at the current ripple on the DC bus.  The ripple is very large at full throttle (nearly 30% of the full current amplitude) and the frequency of the ripple equals the commutation frequency of 1250Hz or 75,000 erpm.

Thinking that increasing the PWM rate might give things a bit higher resolution (and perhaps lower the ripple) I bumped my 20KHz rate up to 40KHz and it worked far worse - if I accelerated VERY slowly I could make it to ~80% throttle, but with any "reasonable" acceleration it would loose sync at a much slower speed.  Observing the current on the bus you can see it go unstable well below full throttle.  Since 40KHz was worse, I tried several other rates.  15KHz seemed to have a lower ripple at full throttle than 20KHz but the ripple was a bit less periodic and quite a bit more erratic.  Does changing the PWM rate change the FOC current PID timing?

There is one other thing worth mentioning regarding what I observed.  There are times when I have seen the VESC loose sync and go into current overload when passing through about 30% throttle.  Not sure what is happening there but there might be some sort of system resonance that whacks things out. 

Let me know if there is anything I should tweak or if there are some tests you want me to run.

Thanks again!!

protontim
Offline
Last seen: 6 years 5 months ago
Joined: 2017-09-25 23:31
Posts: 19

One more point of interest.  It appears that when the motor is "cold" that it goes unstable before it gets to full throttle (at about 90% throttle).  Once it warms up a bit (>40C), this problem goes away. Here is a plot of the loss of sync at nearly full throttle with a "cold" motor.  It was having this problem at the start and then it just went away. I let them motor cool and it came back.  Interesting since the motor winding resistance change is only around 4% or so.  I have thermocouple on the motor which is not connected to the VESC.

ThierryGTLTS
Offline
Last seen: 5 years 7 months ago
Joined: 2017-09-06 14:18
Posts: 116

I've also noticed that when my U8 motor was warm, it works better!

Have a Nice Day.

Thierry

benjamin
Offline
Last seen: 2 days 2 hours ago
VESC FreeVESC OriginalVESC Platinum
Joined: 2016-12-26 15:20
Posts: 490
I'm not sure why it would loose sync, at 100 kv and 21 pole pairs the max erpm should be around 100k, which should be fine. Can you do the detection as usual and try doubling the observer gain?
benjamin
Offline
Last seen: 2 days 2 hours ago
VESC FreeVESC OriginalVESC Platinum
Joined: 2016-12-26 15:20
Posts: 490

It turns out that I have the exact same motor at home. I just tested it at 51V running at 101k ERPM drawing around 1.5A with no load. I don't have any way to put load on it though. What I did notice is that I had to run the detection at a lower voltage to the flux linkage to pass. One more thing you have to keep in mind is that the motor only is rated at 8A, so if you keep the current limit at the default of 60A the resistance and inductance measurement will be way off. You can probably set the current limit to 20A or so.

For me the motor parameters were
R: 66.4 MOhm
L: 28.04 µH
Lambda: 2.614 mWb

I do not have any way to put load on the motor, so I cannot test that. Also keep in mind that if you put too much load on the motor it will saturate and not work, so going much higher than the recommended 8A from the web site is not a good idea.

protontim
Offline
Last seen: 6 years 5 months ago
Joined: 2017-09-25 23:31
Posts: 19

Messing with the observer gain was one of the first things I tried, to no avail.  It does not appear to be an issue with observer speed, but one of tracking stability.  The U8 motor is very low inductance and resistance and, at least in BLDC mode, can have a large demag time relative to the commutation frequency (during high speed acceleration it can exceed 30 degrees).  Just to restate the strange observation noted above, it appears that stability goes down as PWM rate increases.  Not sure why that would happen.  Let me know if there are captures you would like me to run and I would be happy to do that.

benjamin
Offline
Last seen: 2 days 2 hours ago
VESC FreeVESC OriginalVESC Platinum
Joined: 2016-12-26 15:20
Posts: 490

what currents are you running on, and does it work without load? I think your load might simply be too high and the motor goes into saturation.

protontim
Offline
Last seen: 6 years 5 months ago
Joined: 2017-09-25 23:31
Posts: 19

Benjamin,

The resistance I was using (82mOhm) was a good bit higher than yours, the other numbers we not too far off from mine - next time I will measure the motor parameters at a lower voltage.  Using all your numbers I was able to run to full throttle no trouble, but only once.  Once the motor warmed up (~40C) the motor would not start unless I raised my resistance back up a bit (to 73mOhm) then it worked fine.  At full throttle we are indeed pushing the motor - your display reads 27A at full power.  We don't fly at that power for long (we can't or the motor would fry), but we need to peak at those powers for good control power.  Interestingly the Tmotor FLAME 80A controller works very well with this motor at those powers - though most other controllers we have tried do not.

Having said that, using your numbers and the 73mOhm resistance for the warm motor seems to work very well, though if I accelerate very rapidly I can make it momentarily lose sync. As a benchmark, the Tmotor FLAME controller permits significantly faster accelerations than the VESC, but it draws very large (90A+) and very short surge currents during those accelerations, as expected.  (see plot below for test bench data)

Currently my VESC6 current limit is set to 50A so that we can handle moderate peak accelerations without causing a fault.  My summary observation is that the observer seems to be very sensitive to winding resistance - with the resistance set properly, it seems to work pretty well.  But it still has trouble with high acceleration rates.  Short term I plan on doing the following.

                         1) Instrument the motor with a thermistor and connect it to the VESC for temp compensation

                         2) Measure motor parameters at a lower voltage

Thanks to your input, we are making good progress with the VESC6.  It would be helpful if we could further improve our acceleration rates.  Do you know how we might be able to improve our acceleration rates?  I realize we are pushing things so I really appreciate your help.

TMOTOR Controller Response

ThierryGTLTS
Offline
Last seen: 5 years 7 months ago
Joined: 2017-09-06 14:18
Posts: 116

My 2 cents.

R = 77.3 mohms

L = 23.3 µH

Lambda = 2.69 mWb

Have a Nice Day.

Thierry

protontim
Offline
Last seen: 6 years 5 months ago
Joined: 2017-09-25 23:31
Posts: 19

Theirry,  Thanks for the parameters.

Benjamin,

Below is a less extreme, more realistic test of the U8 motor using the Tiger Motor Flame 80A controller.  I will run a similar test on the VESC6 to see how it performs.  BTW, Tiger Motor recently changed their website for the U8.  It used to say 15A, and had a good deal of test data at 12S.

 

 

ThierryGTLTS
Offline
Last seen: 5 years 7 months ago
Joined: 2017-09-06 14:18
Posts: 116

Hi Tim,

What did you use to test your motor and the T Motor Flame 80A controller?

PicoScope or something like that?

Your graphs are so clean!

Have a Nice Day.

Thierry

protontim
Offline
Last seen: 6 years 5 months ago
Joined: 2017-09-25 23:31
Posts: 19

Benjamin,

Shown below is a similar ramp but using the VESC6 (a bit less collected data as this is a minimal test setup).  As you can see there are some significant resonances that occur at about 50% throttle.  Also, current waveform gets jagged above 90% throttle, and (though it is not shown) I am pretty sure efficiency takes a dive.  I will work on confirming efficiency (need to get my hands on the full up testbench for that), but the mid throttle instability is certainly a problem.  Any suggestions how to get rid of that?  Does that have to do with the current PID loop?  Can I tune out that instability?  THANKS!

 

benjamin
Offline
Last seen: 2 days 2 hours ago
VESC FreeVESC OriginalVESC Platinum
Joined: 2016-12-26 15:20
Posts: 490

The problem with FOC and the observer is that it is sensitive to parameter changes, and running currents high enough to bring a motor into saturation causes significant paramter changes. Block commutation with zero cross detection is completely different as it is almost independent of the motor parameters when tracking the motor, although the timing has to be considered.

On the FOC -> Advanced page there is a saturation compensation parameter that you can experiment with. It will adjust the motor parameters as the current increases proportional to the maximum current. It does not adjust kp and ki of the current controller though, but if it helps and I can get a test setup where this can be confirmed I can implement that as well. I would recommend to not use a current limit as high as 50A though if you aren't going to use that much current. Pushing high currents way into the saturation region gives a bit extra torque, but the losses are huge and it is not a good practice. You don't need a high current limit to prevent fault codes, just a high abs max current. The abs max current does not affect the control loops, but the current limits do and can make detection and other things unreliable if the motor goes into saturation at those currents.

protontim
Offline
Last seen: 6 years 5 months ago
Joined: 2017-09-25 23:31
Posts: 19

Benjamin,

I dropped my current limit to +25A/-30A.

The saturation compensation (10% and 15%) does not make any perceivable difference, except making startup more temperamental (temperature sensitive).

Saturation may well be the issue, but our commutation frequency is quite high (78,000 erpm), so I am not full convinced that it is.  Is there a way to detect saturation?

The U8 motor is a very popular drone motor, so if you could tweak the VESC6 to work with that motor it might open up another rapidly growing market for your product.  Having said that, I would be happy to send you either a standard U8 prop or one of our custom props to mount on the U8 motor, if you were willing to devise a way of securely and safely mounting the motor/prop combo.  You will definitely need a shroud between you and the motor when it is spinning full speed as things can get a little "intimidating" at full power. Let me know your thoughts and what you are willing to do.  I greatly appreciate your help to this point.

Regards,

Tim

 

benjamin
Offline
Last seen: 2 days 2 hours ago
VESC FreeVESC OriginalVESC Platinum
Joined: 2016-12-26 15:20
Posts: 490

The observer should be less sensitive to parameter changes at high speeds, and I have been running at much higher speeds than 78k ERPM, so I don't think that is the problem. You can try setting lower current limits when running the detection (e.g. 20 A) to get parameters with less saturation effects. You can also try experimenting with the inductance as it has more influence at higher speed. The observer is not that sensitive to inductance in general, so you can make changes with 20% at a time and see if it makes any difference.

protontim
Offline
Last seen: 6 years 5 months ago
Joined: 2017-09-25 23:31
Posts: 19

Benjamin,

I "calibrated" the motor at 6s, with a 10A max current and loaded those parameters.  I then ran the 12S/30A max speed ramp for both the VESC6 FOC, and the block commutated FLAME 80A by Tmotor.  Looks like the key was getting the parameters more accurate.  I am going to instrument the motor with a thermistor and add temp compensation and beat on it a bit.  But things are looking up.  Currious as to why the current gets so jagged at the high RPM end.  Thanks for all your help.

VESC6 Speed Ramp Response

 

FLAME ESC Speed Ramp

 

 

protontim
Offline
Last seen: 6 years 5 months ago
Joined: 2017-09-25 23:31
Posts: 19

I turned on the speed PID loop and I am experiencing bad resonance at the higher RPMs (eRPM ~55000).  Shown below is the plot for Kp = 0.0005 Ki = 0.0001 Kd =0.  As you can see the loop goes unstable.  Are there any docs showing how to properly tune the speed loop?  Any pointers? Thanks!

jlcortex
Offline
Last seen: 3 years 5 months ago
VESC Original
Joined: 2017-05-24 12:48
Posts: 30

I have not tested FLAME 80A but i am sure it is the same than XRotor Pro 80A-HV-V3

I am quite sure than ALPHA 80A HV is faster ESC for U8 motor. We are using FOC ESC from hobbywing and it works much better than any BLDC ESC. we see a huge difference.

I also would like to see VESC controller working with U8 style motors  

 

 

lizardmech
Offline
Last seen: 5 months 1 week ago
VESC Original
Joined: 2017-06-02 19:21
Posts: 83

What is the primary bottleneck in running very high ERPMs? FET Switching speed and frequency? Or is it current sensing issues due to timing and latency?

moto_guy
moto_guy's picture
Offline
Last seen: 3 weeks 3 days ago
VESC Free
Joined: 2019-02-20 11:08
Posts: 18

Hi Tim

  do you still keep working on your issue ?

   i got similar issue just like yours

 There are some significant current resonances that occur at about 50% throttle,and motor will be lost tracking and cutoff suddenly.

magnus.w
Offline
Last seen: 3 years 7 months ago
Joined: 2019-04-15 19:05
Posts: 6

Hi

I too have similar problems. It would be very nice with a video showing how to configure/tune to get the maximum performance out of a motor (high rpm and heavy load) and explain what is giving the controller problems keeping a stable current. The motor (kde 3520xf) I am running is working fine in BLDC mode up to 40A, but when running FOC the current becomes unstable at ~35A and cant increase rpm (with a propeller as load) could it be saturation, or something else? How do I know it starts getting saturated?

magnus.w
Offline
Last seen: 3 years 7 months ago
Joined: 2019-04-15 19:05
Posts: 6

Hi

I too have similar problems. It would be very nice with a video showing how to configure/tune to get the maximum performance out of a motor (high rpm and heavy load) and explain what it giving the controller problems keeping a stable current. The motor (kde 3520xf) I am running is working fine in BLDC mode up to 40A, but when running FOC the current becomes unstable at ~35A and cant increase rpm (with a propeller as load) could it be saturation, or something else? How do I know it starts getting saturated?