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

cheers Arlo
setup for only throttle 1, left throttle 2 doing nothing & not connected, trying to do no regen and no reverse just to get things moving.
I assumed the led-1 meant it was trying to recover from something.
FWIW motor impedance measurement seems to go nicely, motor hums louder & louder then stops with credible henrys & milliohms
autocomplete on all the FOC & filter screens...
please advise us on what to ask for in the throttle & regen menus :)
 
bobc said:
cheers Arlo
setup for only throttle 1, left throttle 2 doing nothing & not connected, trying to do no regen and no reverse just to get things moving.
I assumed the led-1 meant it was trying to recover from something.
FWIW motor impedance measurement seems to go nicely, motor hums louder & louder then stops with credible henrys & milliohms
autocomplete on all the FOC & filter screens...
please advise us on what to ask for in the throttle & regen menus :)
I think its polynomials what did you set the throttle to?
I set mine to throttle 1 +1.3,0,0
And throttle 2 -.5,0,0
 
I think the problem is mainly in the not very realistic erpm menu... I would change it to:

Code:
a) erpm limiter (forward) rampdown start, range: 49.99, 2.97 k-erpm
b) erpm limiter (reverse) rampdown start, range: 49.99, 2.97 k-erpm
c) regen rampup start, range: 496, 793 erpm
d) accept direction change below: 99 erpm
e) erpm boundary between dr2 & dr23: 992 erpm
f) erpm boundary between dr23 & dr3: 2977 erpm

Also the currents in the current menu are low for 200 A sensors, and the deadtime looks short (300 nsec)

When you change the current don't forget to autocomplete the current menu and recovery menu again (as both have current values in them).

Also, before running hall calibration check that it is switched on in the hall menu and that save is enabled in the ROM menu. The chip switches of the
hall calibration automatically after running calibration...
 
Hi Arlo - 1 0 0 for throttle 1
throttle2 didn't touch - I'll go and check....
OK it's switched off & all coeffs are -0.0002
the "throttle test" worked fine
 
Thanks Bas
will try that over the next couple of days (bed time now & working late tomorrow.....)
Thanks Arlo too
The deadtime was OK with zero current draw (when the real "physical" dead time was 200ns or so greater than the programmed value), I'll try to save a trace when it's trying a bit & check it's still good (or not). Also makes good sense to start out with this on the safe side - a tighter spec on this would give better voltage control (in my mind that should translate to better sensorless performance esp. at low speed....) but I'd prefer not to blow anything up!!
 
bobc said:
Thanks Bas
will try that over the next couple of days (bed time now & working late tomorrow.....)
Thanks Arlo too
The deadtime was OK with zero current draw (when the real "physical" dead time was 200ns or so greater than the programmed value), I'll try to save a trace when it's trying a bit & check it's still good (or not). Also makes good sense to start out with this on the safe side - a tighter spec on this would give better voltage control (in my mind that should translate to better sensorless performance esp. at low speed....) but I'd prefer not to blow anything up!!


For dead time the proper way is to calculate it by subtracting all the shortest on times from all the longest off times.

Once calculated you set it to that number and never change it. The dynamic method lebowski suggests will get you started but as things heat up or go though different scenarios you might find the dead time you chose is not correct.
 
Andy came over today and we got the motor spinning. Never took more than an amp from the battery, turned smooth as you like with a slight "hissy" noise. I guess Andy will put his ifone film of the occasion on utube soon enough. It seemed to fall over at the transition but generally a good start.
I don't like running it from batteries at this stage so I'll do more when I have a more forgiving power supply.
We still don't know what the LEDs signify, but the RH one seems to be "some sort of problem" and this went away when we had enough volts on the thing.
It never ran on 35V even though we switched off the "K -> m" option (described as "spinning motor detection") but it was happy at 50V.
I'll keep updating the power electronics stuff on my emax thread :)
ps - I assume the slight "hissy" noise was noise on the motor current due to the high current transducers (the quantisition noise alone will be correspondingly higher)
 
[youtube]gH9vmZHQsFk[/youtube]

As promised. Lots of good progress today, very pleasing to see this even if it's only sensorless mode.
 
Feature request. - capacitor bank charge up control
I'm just canvassing opinion here, if enough folk think this is a good idea maybe it will happen.....

Your big inverter has a big bank of electrolytic capacitors. If your battery contactor just closes onto these it will quickly weld itself shut or go into high resistance melty unpleasantness so it is normal to charge the caps through a resistor and close the contactor later when there are very few volts across.

If the inverter starts driving output before the contactor has closed, many amps will flow in the charge up resistor and it will get mighty hot, either 1) desoldering itself or 2) setting fire to your car/bike

So the controller should not be allowed to enable drives to the inverter gates until it knows the battery contactor is closed. There are 2 ways of doing this
1) external inrush control system informs the controller it is ready (not ready forces into drive_0 state)
2) the controller state machine controls the contactor (extension to LED-0 logic by inspecting battery voltage feedback)

I prefer the latter, but either case would require a lebowski 'brain' update. As luck would have it there IS a spare pin, pin 22. This could be used as a digital input in the first case or an output in the 2nd

here is a simple "ignition key" circuit to control a car/bike battery isolator (using the 2nd case above)
Inrushcct.gif
The system electronics power up via the inrush resistor (control electronics will only take a few milliamps to get going) when the key is turned 'on'. When the 'brain' decides the caps are sufficiently charged it asserts the output "inrush" which closes the main battery contactor. Bingo you're motoring.
When the key is turned 'off' it's 2nd gang or pole now opens the main contactor -> battery drain is zero.
I'm asking the guys who've used this thing for real if they think this minor addition would have helped them.
Cheers Bob
 
Hi Bas,
finaly I got your controller running on my E-Max scooter :D

It is running very smooth and quick (about 70km/h at 16s LiFePo). Regen works like a charme.

But it has a very low torque when starting at sensored mode. What are the parameters to give more power in this mode. And how can I define when it will switch to drive_23?
And (it's not a real problem) when the motor spins down and enters the sensored mode there is a little "bump" (the wheel is braked for some ms).

Maybe you'll have a hint.

Code:
version:293_                                                                    
0x01DC  0xFFFF  0xFFFF  0x07BF  0x0063  0x014A  0x0295  0x003B                  
0x0CCC  0xFFCA  0xFFCA  0xCFBC  0xD8C4  0x0358  0x3A86  0x7FBC                  
0x7D2E  0x0030  0x010E  0x0A6A  0x028C  0x009D  0x0007  0x11C6                  
0x001E  0x2AF8  0x795E  0x0040  0x9D64  0x000A  0x0000  0x07AE                  
0x0018  0x0000  0x01E0  0xFFFF  0xF852  0xFFE8  0x0000  0xFE20                  
0x0000  0x4CCD  0x0018  0x0000  0x01E0  0xFFFF  0xB333  0xFFE8                  
0x0000  0xFE20  0x045F  0x021D  0x001E  0x0017  0x1582  0xFF00                  
0xC23D  0x6C3B  0x973D  0x173B  0xED3B  0x423B  0xFF00  0x0000                  
0x050B  0x0D24  0x00DC  0x0443  0x0C79  0x00C6  0x0063  0x0000                  
0x01EF  0x0000  0x0B84  0x05C2  0x03F8  0x03FC  0x03FA  0x0752                  
0x0883  0x0009  0x0AA4  0x0003  0x0CFA  0xFFFA  0x0357  0x1800                  
0x0000  0x0000  0xF000  0x0000  0x0000  0x00CA  0x0212  0x0054                  
0x03AB  0x2E12  0x0189  0x2664  0x0F5B  0x0224  0x0258  0x0064                  
0xFFFF  0xFFFF  0xFFFF  0xFFFF  0x0003  0x0000  0x0078  0x0000                  
0x0000  0xFFFD  0x0000  0xFF88  0x0000  0x0000  0x0005  0x0000                  
0x0064  0xFFFB  0x0000  0xFF9C  0x000C  0x0000  0x00F0  0xFFF4                  
0x0000  0xFF10  0x1400  0x06F1  0x0061  0x04A6  0x0F5B  0x00C6                  
0x0353  0x04A6  0x0077  0x0010  0x0000  0x07D0  0x03B6  0x6000                  
0x0DD2  0x0129  0x4000  0xFFFF  0xFFFF  0xFFFF  0xFFFF  0xFFFF                  
0xFFFF  0xFFFF  0xFFFF  0xFFFF  0xFFFF  0xFFFF  0xFFFF  0xFFFF                  
0xFFFF  0xFFFF  0xFFFF  0xFFFF  0xFFFF  0xFFFF  0xFFFF  0xFFFF                  
0xFFFF  0xFFFF  0xFFFF  0xFFFF  0xFFFF  0xFFFF  0xFFFF  0xFFFF                  
0xFFFF  0xFFFF  0xFFFF  0xFFFF  0xFFFF  0xFFFF  0xFFFF  0xFFFF                  
0xFFFF  0xFFFF  0xFFFF  0xFFFF  0xFFFF  0xFFFF  0xFFFF  0xFFFF                  
0xFFFF  0xFFFF  0xFFFF  0x0000  0x2AA9  0x0000  0x0005  0x9000                  
0x07D1  0x0000  0x7F80  0x0000  0x0000  0x0000  0x0000  0x0000                  
0x0000  0x0000  0x0000  0x0000  0x0000  0x0000  0x0000  0x8000                  
0x0235  0x0000  0x0000  0x0000  0x0000  0x0000  0x0000  0x0000                  
0x0000  0x0000  0x0000  0x0000  0x0000  0x0000  0x0000  0x9000                  
0x07D1  0x0000  0x0D48  0x0000  0x0000  0x0000  0x0000  0x0000                  
0x0000  0x0000  0x0000  0x0000  0x0000  0x0000  0x0000  0x8000                  
0x0235  0x0000  0x0000  0x0000  0x0000  0x0000  0x0000  0x0000                  
0x0000  0x0000  0x0000  0x0000  0x0000  0x0000  0x0000  0xFFFF                  
0xAAAA  0x6666  0x4924  0x38E3  0x2E8B  0x2762  0x2222  0x1E1E                  
0x1AF2  0x1861  0x1642  0x147A  0x12F6  0x11A7  0x1084  0x0F83                  
0x0EA0  0x0DD6  0x0D20  0x0C7C  0x0BE8  0x0B60  0x0AE4  0x0A72                  
0x0A0A  0x09A9  0x094F  0x08FB  0x08AD  0x0864  0x0820  *
IMG_20170429_142707.jpg
 
I have manged to get the torque up pretty good at startup.

The PLL bandwidth should be 100hz.
Try calibrating the halls in reverse or at different RPMs. With mine I had to calibrate in reverse and it retarded the timing.
It will take some experimenting in the Hall menu with the ERPM difference for both 2 and 23 as well the timing settings.
I think I use .4 kerpm max difference alowance for dr2 and .8 kerpm for dr23 as well 25 deg for dr2 and 55 deg for dr23
But you will have to experiment.

I also calibrated the current sensors with the phase amps set low I found this helped a lot. I got it perfectly smooth in dr2 now this allowed some experimenting in the hall menu.
 
izeman said:
Unfortunately i can't calibrate in reverse as it's got a freewheel. But your tips sound interesting. Afair lebowski said not to calibrate the current sensors, but i saw quite a difference between the three of them so i think it may still be worth a try.

Yes it took me a while to descover the right current calibration. Once I get a really smooth current sensor calibration I save the whole hex.

I also proved the current sensor calibration by doing a FOC measurement before and after each time trying to use the most amps possible to get the inductance measurement and with the current sensors calibrated properly it lets me do the FOC at a higher amperage. That combined with how smooth it is at light throttle startups shows me the current sensor calibration is worth it. It just takes a few trys at low current to get it perfect some times.
 
So you can confirm that there is a limit until which the FOC measurement completes fine w/o overflow?
I never had issues at 100A phase and autocompleted all for defaults. But when i tried 150A phase it seems test current for FOC became too high and it wouldn't complete successfully. I had to manually set the test current to some 40% of phase instead of 50%. Then it would complete. Problem i see is that calculated/measured values for L and R are completely different for 10% phase and 40% phase. So i guess that's why my problems come from.
When you start the motor will see full phase and it has totally wrong values for it when going from drive2 to 3, still with quite high phase current.
Does that make sense?
 
Thanks so much for your hints!

What I did to increase the torque of drive_2:

lowered the transition erpm -> no success
calibrated hall sensors with low phase current -> no success
changed PLL bandwidth -> no success
increased kerpm max difference in hall menu -> littel success
recallibrated halls with much lower erpm -> no success
increased phase current from motor maximum of 100A to 150A -> success - but it takes also effect to the current in upper drive modes, so I destroid my main fuse and I think it's not good for the motor...

Outstanding is the recallibration of the halls in reverse, but I didn't connect the pin...

When I look to the batterie current in drive_2 it is still quite low. Maybe there is a way to increase it. Will try more tomorrow.
 
Btw : the 'problem' with low battery current at low rpm is a non solvable one.
At zero rpm voltage is low and a low voltage multiplied with your phase amp gives only little wattage. The higher the rpm the higher the voltage so wattage increases and you'll see full battery amps.
 
You might not ever get the same torque in sensored as sensorless but you can make I better. To be clear I am using 2.93 and I have it set for dr2-dr23 at 1400 erpm and 23-3 at 5kerpm
 
Why is torque in sensorless better? Never understood that. And i wish the controller had something like the 'blocktime' feature of those xie change controllers. Pump ALL current the FETs can do into the motor for a fraction of a second. Made the motors feels extremely snappy and powerfull from a standstill.
 
izeman said:
Why is torque in sensorless better? Never understood that. And i wish the controller had something like the 'blocktime' feature of those xie change controllers. Pump ALL current the FETs can do into the motor for a fraction of a second. Made the motors feels extremely snappy and powerfull from a standstill.

Sensorless gives the current to each phase at exactly when it should be which makes it the most efficient use of the current.

The block time thing is a bad idea. Its better to run at the limits of the fets or just below at full throttle if you have it set for max power.

I would not want a controller to run past the fet limits or would I want more power for a faction of a second then have it reduce.

Feeding all the power your fets can handle into the motor during sensored operation meens you don't know if its at the right part of the phase as you only have 6 steps of info. Where as sensorless you have a analog signal which lets you know exactly when the current should be at its peak so you make the most power you can while at the limits of the fets.
trying to do this in sensored operation means there is a good chance a bunch of that turns into heat in the motor and fets.
 
The motor is a chinese 4 KW brushless DC:
http://www.proud-eagle.com/product.asp?plt=31&pone=5
I did not open it, but it seems to have 30 poles (30 ticks on the halls per revolution).

My main fuse is rated at 50A. I was not suprised when it could not stand my 80A max battery current.

With the original controller (square wave with 36A max phase current) I had not problem to start on an incline of 10%. So somehow it must be possible...
 
If your hall timing is to far advanced or retarded it will reduce the torque.

If your current sensors are not calibrated close it will not make the right torque.

The PLL at 100hz helps make more torque as well.
 
I also think it's a timing problem.
maybe this is another feature request.

In the hall menu a "shift hall angles" with values from -60 to 60 degree. This is added to all of the measured angles...
 
Back
Top