Lebowski's motor controller IC, schematic & setup, new v2.A1

Hi Lebowski,

I'm not sure this has been asked before, but can the controller chip be configured for regen when going from high throttle to lower throttle? I mean, like engine braking in a gasoline car. I guess you could call it regen while coasting.
 
Yes. I have done it read back and lebowski tells you how. Its neat because the first bit of throttle is variable regen like driving a Tesla !!!
 
that's a cool feature :)
 
Its not a real wheelie control its a brake that varies the throttle (variable regen input works combined with throttle.)
Wheelie control would be something to use an accelerometer to control the throttle and brake when the angle of the bike gets to high.
 
for those interested: i was in search for a good looking (in terms of usability) and fully functional terminal software. after trying termite, realterm, hyperterminal, securecrt, and several others, i found COOLTERM. it's available for win, mac, linux.
http://freeware.the-meiers.org/
i can highly recommend it. it works perfectly nice with the controller ic, you can upload configs very easy etc ...
enjoy!
 
izeman said:
for those interested: i was in search for a good looking (in terms of usability) and fully functional terminal software. after trying termite, realterm, hyperterminal, securecrt, and several others, i found COOLTERM. it's available for win, mac, linux.
http://freeware.the-meiers.org/
i can highly recommend it. it works perfectly nice with the controller ic, you can upload configs very easy etc ...
enjoy!

i will second that! very nice UI
 
Arlo1 said:
Its not a real wheelie control its a brake that varies the throttle (variable regen input works combined with throttle.)
Wheelie control would be something to use an accelerometer to control the throttle and brake when the angle of the bike gets to high.

Yes not true wheelie control, but something that can help loads in controlling wheelie over shoots. Most folks that have good throttle skills will most likely love it. Would also help bikes act more like a ice sport bike slowing going into turns and the like when dropping the throttle and motor drags down the speed. Would be great if it can be adjusted on the fly with a three speed type switch for wet or slippery conditions to lessen the deceleration / braking forces/rates if need be to better keep traction on the rear. Excellent feature.
 
oh man how i hate the MAC motor. for those that may have followed andy's 3kw controller thread: i had fake fets installed, swapped them last weekend, and had a good feeling that everything would be fine.
NOPE. everything like before. motor conking out at start, motor conking out at too much maps at speed, etc etc ... after tuning several hours i can at least reach top speed if i apply the throttle very gently. lift off from a stand still is still a no-go.
after being very frustrated i tried to install the controller on a gng-type mid drive bike i'm just building. reset all values to zero and started from scratch. auto completed all values, and guess what: the motor ran super nicely in 5min. everything perfect.
so it's proven that there is something VERY strange with this mac motor that i CAN NOT solve. the MAC is working fine with those 3xx infineon style controllers, running fine with kellys, but not working at all with lebowski's controller. at least not ootb. i still hope that we will solve gordon's knot sometime ...
 
New stuff to try Izeman, based on insights gained from all the experiments you did (thanks !) . You told me as you separate out the coefficients further it works better.

This tells me the phase control loop is unstable with the original coefficients. Reason for this can be that maybe the MAC is an unusually slow motor. Most motors I've seen have a L/R of about 1 millisecond, it might
be that your motor is slower (meaning it has a high inductance and a low resistance). For this the bandwidth of the control loops must be reduced (at the moment they are at about 300 Hz)

The bandwidth of the control loop relates to the ratio of 20 and 41 that I've always told you to observe ( 20 between 1st, 2nd and 41 between 2nd and 3rd order coefficients)

When you space out the coefficient more (so ratios larger than 20 and 41) you basically lower the bandwidth, something which you have reported seems to make things better.

Rather than just guessing the ratios, there is actually a scientific method leading to the 20 and 41... When I get home I'll start up my Octave (Matlab), play with some besselfunctions and give you new ratios.

P.S. bandwidth is roughly (1 to 2) * f_sample / (2*pi * 20) , the 20 coming from the 2nd/1st order phase control coefficient ratio.
 
Lebowski said:
... Reason for this can be that maybe the MAC is an unusually slow motor. Most motors I've seen have a L/R of about 1 millisecond, it might
be that your motor is slower (meaning it has a high inductance and a low resistance). For this the bandwidth of the control loops must be reduced (at the moment they are at about 300 Hz)

resistance phase/phase is 0.045mOhm
inductance is 80mH

just in case you need those values ...
 
izeman said:
Lebowski said:
... Reason for this can be that maybe the MAC is an unusually slow motor. Most motors I've seen have a L/R of about 1 millisecond, it might
be that your motor is slower (meaning it has a high inductance and a low resistance). For this the bandwidth of the control loops must be reduced (at the moment they are at about 300 Hz)

resistance phase/phase is 0.045mOhm
inductance is 80mH

just in case you need those values ...

so you measure 0.045mOhm between two phases with the 3rd hanging open ? This makes it 0.023mOhm per phase (in wye), L/R is then 3.5 msec.... slow motor indeed
 
Animalector said:
Pretty sure I was getting 120ish mH on Nips's mac motor... Not 80...
But anyways. I like where this is going . Fingers crossed.
yep. seems to depend heavily on the winding. i get different values for different motors. but i always get a very constant reading. 79.7-80.1mH. so quite accurate.
 
Ok, this is going to be interesting 8)

Just to start some definitions:
The drive modes typically have 3 control loop coefficients, lets call the 1st order coef_1, 2nd order coef_2 and 3rd order coef_3.
Important for stability is the ratio between these, lets call those:
ratio_12 = coef_1 / coef_2
ratio_23 = coef_2 / coef_3

Furthermore important is the loop sample frequency, f_sample (can be found in the PWM menu)

So far I've recommended ratio_12 to be 20 and ratio_23 to be 40 . With this there is one more freedom left, I typically aim for either coef_1 to be around 250 to 1000, or coef_2 around 20 or so.

Now, the bandwidth of the control loop is roughly

BW = 2 * f_sample / (2 * Pi * ratio_12)

f_sample is typically around 40 kHz (when you use autocomplete with a PWM of about 20 kHz). With a ratio of 20 the BW is then 640 Hz. This seems to work OK for a motor with 1 millisec L/R ratio.

Now, in Izemans case he has a slow MAC motor with an L/R of about 3.5 millisec. So the BW must be reduced by 3.5 to 183 Hz.

ratio_12 = 2 * f_sample / (2 * Pi * BW) =~ 70

The equation for ratio_23 is simple:

ratio_23 >= 2 * ratio_12 =~ 140 (>= means larger or equal to)

to get to the drive_3 coefficients:
lets choose coef_1 = 1000 , then coef_2 = 14.29 and coef_3 = 0.102

for drive_2 it is best to have coef_1 and _2 the same as drive_3.I typically reduce coef_3 but 0.1 is already so low, so also the same for drive_2.





Note the impact of the f_sample in Izemans case. Lets say f_sample would be lowered to 19 kHz (best to stay away from PWM freq by 1 or 2 kHz).
Then for the same 183 Hz BW ratio_12 becomes 33 and ratio23 becomes 66.
If you keep coef_1 at 1000, coef_2 becomes 30.3 and coef_3 is now 0.459

Interesting here is that the speed at which the motor can spool up depends on f_sample * coef_3, which in the latter case is higher.... penalty to pay for
this though is more noise in the system.





It is best to also observe ratio_12 and ratio_23 in the amplitude control loop. Here I typically keep coef_3 0 and have coef_2 at 2 or 3 , coef_1 can then be
calculated with ratio_12
 
ok. i can follow the math - not that i understand the Hz and bandwidth stuff behind it :)
so let's say i try

Code:
coef_1 = 490
coef_2 = 490/70 = 7
coef_3 = 7/140 = 0.05
these values are valid for MY motor and PWM=20kHz. correct?

for amplitude control loop it would be

Code:
coef_1 = 2*70 = 140
coef_2 = 2
coef_3 = 0
edit: ooops. i just saw that you added a lot more stuff to your post while i wrote mine. thanks :)

would it be better to use PWM 19kHz or 20kHz - the values differ a lot?
 
well. now i got some hope at last :)
those settings sent by bas are the first ones that made my bike lift off from a stand still. not perfectly well, but it works. of course starting in a higher gear and steeper hill makes it conk out.
but now drive_3 works worse.
and i have something to work with. it's still a lot of poking around for me, but maybe i will find a solution soon.
 
izeman said:
well. now i got some hope at last :)
those settings sent by bas are the first ones that made my bike lift off from a stand still. not perfectly well, but it works. of course starting in a higher gear and steeper hill makes it conk out.
but now drive_3 works worse.
and i have something to work with. it's still a lot of poking around for me, but maybe i will find a solution soon.
Try doubling the coefficients for drive 3, and-or increase error current filter times for both drive modes.

For drive 2 it may help to, in the recovery menu, switch to total current instead of error current.
 
I am hoping someone can give me a clue about what it might cost me to build one of these controllers, including output stage. Application is my 27' sailboat, currently powered with a ME0201014201 5kw BLDC motor at 48v but I intend to upgrade to a ME0913 or similar in the near future so output should be capable of sustained delivery of 200a at 72v. My last controller I thought was adequate for the 4201 motor but it went north on me. I do know one of the MosFETs is blown because the B- to phase A resistence is like .4 ohms and the other two are around 47k ohm. Anyway I am tired of diddling with Kelly. You cant even configure the controller unless you have a windows computer or a mac, and I only do ubuntu. Anyhow, back to the specs, I don't need regen, but I need reverse. My motors have hall sensors but sensorless capability would be a plus just in case a hall sensor goes north on me. I have built electronic doodads before but never done any surface mount soldering. Don't have a laser printer. Don't have an oscilloscope. Dont even have a high precision multimeter, just handheld cheapies. So, is building this practical for me, and how much should I expect it to cost?

This looks like a really great controller design. My hat is off to you, Lebowski.
 
Info about prices and parts list in Excel can be found here:http://endless-sphere.com/forums/viewtopic.php?f=30&t=63572#p978868
My parts cost (board, electronics, lebowski-controllerchip) for 1 controller/powerstage was ~USD 200.- when ordering parts for 10 controllers.
The info in the link is for chip-version 2.30, but the hardware difference in version 2.40 is minimal.
Cheers emmgee
 
after reading half through this thread I have a few questions left :D

1. to limit power .. do you PWM both high and low side fets or only one of them or even alternating ?
2. I am building something with the NCP5181 .. is it a bad IC compared to other drivers ?

greets !
 
Vendetta277 said:
after reading half through this thread I have a few questions left :D

1. to limit power .. do you PWM both high and low side fets or only one of them or even alternating ?
2. I am building something with the NCP5181 .. is it a bad IC compared to other drivers ?

greets !

1. it PWM's both high and low side FETs
2. I;ve had NCP5181's blow up in places where the IRS2186 survived... the 5181 cannot handle negative kickback voltages from the output stage, the 2186 can...
 
Back
Top