Ampera/Volt inverter with Lebowski brain

arber333

100 W
Joined
Mar 29, 2013
Messages
211
Hi recently i made a mainboard for Ampera/Volt inverter using one lebowski chip.
Intention was to use it to prove concept and later develop additional features such as propper precharge and temp reading interface. Also CAN is an option...

I have succesfuly run 3 PMSM motors with this controller on desk as well as 2x ACIM motors. In ACIM instances we actually used inverter to power the motor in a car. It worked reasonably well and with enough capacity to allow us to consider adapting control mechanism for BLDC motors. https://leafdriveblog.wordpress.com/

First tests were performed with motor tied to desk. Motor was run sensorless. In paralel a friend installed the same motor in a car and used the same inverter. That allowed us to quickly test application on desk as well as in field.

After initial tests i installed 3x hall sensors SS41Fs from Honeywell directly to the winding spaces inside stator.
https://leafdriveblog.wordpress.com/2019/04/07/3x-hall-sensors/

Currently motor runs quite smooth on sensorless as well as with sensors WITHOUT LOAD on desk!
When we tried to run it in a car we encountered a problem. Motor would move for about a quarter turn and then block, but current would still flow. It is as inverter wouldnt be able to read sensors... I made some video as well as logs https://leafdriveblog.wordpress.com/2019/04/23/engine-run/

My findings to date were:

1. I have made an error in calculating deadtime. Nothing serious, but it may have an influence on FOC reading.
tdead = [(t D _ OFF − t D _ ON )+ (tPDD _ MAX − tPDD _ MIN )]×1.2
Innitialy i calculated deadtime at 1.65us.
I now came to a conclusion i would have to add more time to account for maximum delay in IGBT datasheet and this showed to be 2.1us. First tests proved no difference. Up to date no change in FOC measurement at 100A 12Kerpm.

2. I may want to try and switch hall sensors back and foth. This didnt make a difference with motor on desk. Will test it in the car as well.

If anyone has any advice, please tell me where i missed?

TNX
 

Attachments

  • mbb600tv6a.pdf
    823.7 KB · Views: 156
I'll try to help on this as much as I can.
 
Hi

Since i put SS41F sensors on the windings i am wondering if i oriented them correctly. I glued them in the back of the winding with TO92 sensor positioned 0deg to the rotor and look to the motor front. I think it shouldnt matter, but would it be any better if i rotated sensor (pulled the head at right angle) to 90deg to the plane of rotation?

tnx
 
We managed to get the car rolling. I just copied Arlos FOC motor reading of 178uH and 43mohm.
There is a thing from the start when the motor wants to pull, but just cant manage. If we overcome this then car drives off and it can climb a hill or regen into a valey. So i would rule out incorrect current sensor signal positions or incorrect phase signals. I think it just comes to a ground bounce or other EMI problems.

Bas can you tell me if you have an idea how we can filter the hall signals to the board. Could a RC filter correct anything?
But if i just add a cap i would get rounded signals, not sharp edges...

Though there is still a question of why i cant read the motor correctly. What is the main information for FOC parameter readings? Is it current sensors? Do i have a problem with current sensors?
How would i confirm mV/A is correct? I dont have a datasheet. Do i just apply 1A through sensor and then 10A to compare? I can use a PSU up to 20A... I can also wind a wire 10x around in the sensor to get 10x reading.
If my information is correct i have 2.85mV/A transimpedance. So at 1A i should see 2.503V on scope and at 10A 2.53V and with 10x wire i would get 2.78V for 100A effect? What do you think? Is there a better way?
 
Lebowski said:
It matters, they are only sensitive for magnetic field in 1 (out of possible 3) direction

I have them oriented with writing towards rotor. The head is oriented towards the front of the motor.
Should i turn them around or make them stand at 90deg towards rotor?
 

Attachments

  • IMG_20190416_190941a.jpg
    IMG_20190416_190941a.jpg
    149.4 KB · Views: 6,070
Best is Arlo1's method of the extra magnet on the axle combined wigh encoder IC. What you will always have with hall sensors in the motor like that is that they also detect field from the windings. Dependent on construction and settings field can move over 45 degrees...
 
Lebowski said:
Best is Arlo1's method of the extra magnet on the axle combined wigh encoder IC. What you will always have with hall sensors in the motor like that is that they also detect field from the windings. Dependent on construction and settings field can move over 45 degrees...

Yup the stator it self will make a stronger magnetic field and mess up your Hall readings. It will be even worse because its an IPM motor.
 
Success!
I installed the RLS RMB28U8 encoder and magnet sensor in place of original resolver. This encoder reads magnetic field of radialy polarised magnet. When this magnet rotates encoder produces either UVW or ABZ signals.
https://leafdriveblog.wordpress.com/2016/11/16/encoder/
When i installed this sensor car took off and i was surprised with the ease it adjusted to the sensor calibration.

There is a downside too... After some practice runs it became evident that controller is throwing an error in some low region.
Around some 15km/h in 1st or at 25km/h in 2nd inverter would throw alert and reset. I would then recover throttle and tried to drive further. Ands again it would reset... Frustrating!
What would be the cause of that? Transition from mode 2 to 23?
I tried to calibrate FOC and at 50A and 12kerpm i get 173uH and 15mohm. While Arlo got 178uH and 43mohm at 100A! If i try at this settings i get even lower R value. If i try editing manually i get identical errors in drive.
It looks like motor does not want to depart drive 2.
I use almost the same settings as Arlo in his video. System voltage is 200Vdc. I use phase current 400A to drive. Battery current i have set at 200A.
Acceleration limiter is 4 to 6.
I have motor steps 48 in menu g.
Also for menu c i am using total current sensing. What will happen if i select error current?

tnx

A
 
I spent a lot of time tuning the transition. Like 100s of hours!!
 
Arlo1 said:
I spent a lot of time tuning the transition. Like 100s of hours!!

Hm... true! I will start experimenting. As soon as it stops raining :). You have any instruction where to start correcting?

tnx

A
 
Hurah! The car drives without a hitch!
Thank you TomDB, Lebowski and thank you Arlo!
I revisited some of the FOC settings and slowly increased resistance value untill at 48ohm the motor took off into a steep hill without shaking or hesitation. I use 178uH inductance also. Car felt superb to drive and there was no power loss uphill.
Also i changed regen ramp to range from 400erpm to 3000erpm.
Best results i got when i recalibrated sensors and immediately reved the motor to gather at least 10 samples. My offset was then at 0deg with spread of 2deg. This really helped with smooth driving.
Transmission shifting required me to take regen to 0 and then motor allowed to engage synchros. Therefore i will not pull both throttles to GND, but instead i will just pull down the regen signal.

This is the capture from controller. We use 200Vdc with 150Ah Kokam cells capable of 3C discharge nominaly and 5C max.
version:2A1_
0x019A 0xE000 0xFFFF 0xFFFF 0x0007 0xFFFA 0x4000 0x0006
0x5C00 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000
0x0110 0x045F 0x0117 0x0400 0x0400 0x000E 0xFFDB 0x48EF
0xFFE2 0x42AB 0xFFFF 0x0BBF 0x00DA 0x01F4 0x02EF 0x08DF
0x02A9 0xFFFF 0x01E1 0x0012 0x0192 0xFFFF 0xFFFF 0xFFFF
0xFFFF 0x0BC0 0x1AD0 0x7FBC 0x7D2E 0x0030 0x795E 0x0000
0x07AE 0x0018 0x0000 0x01E0 0xFFFF 0xF852 0xFFE8 0x0000
0xFE20 0x0000 0x4CCD 0x0018 0x0000 0x01E0 0xFFFF 0xB333
0xFFE8 0x0000 0xFE20 0x06AD 0x02BC 0x0064 0x0019 0x2EF3
0xFF00 0xF437 0x9F37 0xC937 0x4937 0x1F37 0x7437 0xFF00
0x0E49 0x00CC 0x0087 0x0012 0x01C6 0x008B 0x0000 0x0577
0x02BB 0x03EE 0x03EE 0x03F0 0x09C3 0x1194 0x0097 0x04E0
0x0007 0x0D5A 0xFFC4 0x0BBF 0x1333 0x0000 0x0000 0xF999
0x0000 0x0000 0x010D 0x01A1 0x0043 0x03BC 0x15DD 0x0117
0x1066 0x045F 0x04B0 0x0258 0x0064 0x885C 0x115C 0xFFFF
0xFFFF 0x0003 0x0000 0x0078 0x0000 0x0000 0xFFFD 0x0000
0xFF88 0x0000 0x0000 0x0005 0x0000 0x0064 0xFFFB 0x0000
0xFF9C 0x000C 0x0000 0x00F0 0xFFF4 0x0000 0xFF10 0x02D9
0x0221 0x0577 0x005B 0x0186 0x0221 0x0036 0x0010 0x0E10
0x88B8 0x03B6 0x6000 0x068F 0x0088 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 0x1CCA 0x0005
0x8000 0x07B2 0x0000 0x7F80 0x0000 0x0000 0x0000 0x0000
0x0000 0x0000 0x0000 0x0000 0xFFDB 0x48EF 0xFFE1 0x7773
0x07B2 0x0000 0x1000 0x612E 0x0000 0x7F80 0x0045 0x033D
0x010C 0x7FBD 0x0494 0x0000 0x04EA 0x04EF 0xFFDB 0x48EF
0xFFE1 0x7773 0x01B3 0x0001 0x8000 0x099E 0x0000 0x0000
0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000
0xFFDB 0x48EF 0xFFE1 0x7773 0x099E 0x0000 0x3000 0x6417
0x0000 0x7F80 0x001A 0x01F9 0x0102 0x5D6A 0x01FC 0x00CB
0x0000 0xFFEF 0xFFDB 0x48EF 0xFFE1 0x7773 0x263E 0x0001
0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000
0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000
0x0000 0x0000 0x0000 0x0000 0x0000 0x0324 0x0648 0x096A
0x0C8C 0x0FAB 0x12C8 0x15E2 0x18F9 0x1C0B 0x1F1A 0x2223
0x2528 0x2826 0x2B1F 0x2E11 0x30FB 0x33DF 0x36BA 0x398C
0x3C56 0x3F17 0x41CE 0x447A 0x471C 0x49B4 0x4C3F 0x4EBF
0x5133 0x539B 0x55F5 0x5842 *
 
Great news! What gear are you using in the RX8 and how does the overall reduction ratio compare to the Leaf? Top speed on 200V? The real mystery is why your controller was giving you a reading of only 6.66 mOhms.
 
kiwifiat said:
Great news! What gear are you using in the RX8 and how does the overall reduction ratio compare to the Leaf? Top speed on 200V? The real mystery is why your controller was giving you a reading of only 6.66 mOhms.

It is a great news yes.
I forgot to mention i also changed deadtime to 3.1us and still it showed 185uH 8.5mohm on FOC reading. I will have to observe this still. It also happens on my second motor - inverter combo which is on the bench now. So it is something to investigate.
Higher deadtime seemed to work smoother however. On transition from mode 2 to 3 i noticed low rumble in motor, then on high rpm it subsided.
I use 35000 points in transition like Arlo uses so it takes some time to complete i guess.
Regen is absolutely wonderful with +80A going back in 4th gear on downslope. We never used our brakes.
I use pot on the central console, but shifting will require more immediate switch to pull throttle 2 to GND and release regen for shifting.
We used all gears save 5th. We had to start in 1st since i cautioned 2nd required too much amps. I now think it would start with enough throttle.

A
 
You should not need a transmission :) Just put it in 2nd or 3rd and drive it.

I think you are using a leaf motor right?
 
kiwifiat said:
Great news! What gear are you using in the RX8 and how does the overall reduction ratio compare to the Leaf? Top speed on 200V? The real mystery is why your controller was giving you a reading of only 6.66 mOhms.

Deadtime distortion makes the resistor measurement very unreliable (but does not affect the inductor measurement much). So more deadtime, more wrong value. It is better to override this value by hand, typical value to aim for is R = L/X, with X roughly 1e-3 (all motor seem to have time constants in the same area of roughly 1 msec). With the resistor (totally) wrong it will tend to conk out around 10k-erpm.
 
Lebowski said:
Deadtime distortion makes the resistor measurement very unreliable (but does not affect the inductor measurement much). So more deadtime, more wrong value. It is better to override this value by hand, typical value to aim for is R = L/X, with X roughly 1e-3 (all motor seem to have time constants in the same area of roughly 1 msec). With the resistor (totally) wrong it will tend to conk out around 10k-erpm.

I am getting very close to completing my Lebowski Chevy Volt drop-in board with encoder support so
that explaination will be a great help thanks.
 
Hi Arber, can you try the car with this '48' valued coefficient (I think It is the last one in the list) in the coefficient menu at 0 and see if it makes any difference ? I am also curious if you notice any difference when bringing the # of transition cycles down from 35000 to 1000 ?

Do you have a video of the driving car ?
 
Lebowski said:
Hi Arber, can you try the car with this '48' valued coefficient (I think It is the last one in the list) in the coefficient menu at 0 and see if it makes any difference ? I am also curious if you notice any difference when bringing the # of transition cycles down from 35000 to 1000 ?

Do you have a video of the driving car ?

I was visiting Johannes in Kassel theese days so i have to get back to my work.
I also tried to run with coeeficient at 48 and that was at the time unsuccessful. I did try to change various settings. So it may not have affected the motor at all.
I changed offset calibration to 10A like yoiu said
I extended regen region from 400erpm to 4500erpm
I reset voltage setting to current value 198Vdc
I used 0 for the n setting in control loops, also varried c from 96k back to 24k
I setup FOC values to 178uH and 48mOhm manually
I used 3.1us for deadtime
i keep transition cycles to 35000 since Arlo advised so. I did try before at 2000 and i forgot about it since overall result was not good.
And last and most important thing was that i put 0.8 for PLL damping in hall sensors. It got me 0deg offset and smooth ride.

I will post some videos untill next weekend hopefully. I was mostly inside setting values...
 
Lebowski said:
Deadtime distortion makes the resistor measurement very unreliable (but does not affect the inductor measurement much). So more deadtime, more wrong value. It is better to override this value by hand, typical value to aim for is R = L/X, with X roughly 1e-3 (all motor seem to have time constants in the same area of roughly 1 msec). With the resistor (totally) wrong it will tend to conk out around 10k-erpm.

This is just what happened with my controler and Leaf motor when i had R set below 40mohm. It would be good up to about 1500rpm and then tripped into mode 0.
 
I wonder whether 40 is correct though... it will probably work fine too for 80 and maybe even 160 (this would bring it to 1 msec time constant). Not so important for stability, but has a small effect on efficiency when running with field weakening.

I wonder what a simple dc measurement would give... put 10A through, measure voltage, calculate resistance...
 
Lebowski said:
I wonder whether 40 is correct though... it will probably work fine too for 80 and maybe even 160 (this would bring it to 1 msec time constant). Not so important for stability, but has a small effect on efficiency when running with field weakening.

I wonder what a simple dc measurement would give... put 10A through, measure voltage, calculate resistance...

Is it important how much voltage do i use? Would 30V at 10A be enough?

Or i could put true PWM 50% duty and measure voltage

A
 
Best is to use a current limited supply, but else a 12V car battery with a lightbulb will do. Measure current and voltage across motor and apply Ohms law. Use 2 motor terminals (leave 3rd one open), divide resistance by two for the star equivalent resistance value
 
Lebowski said:
Best is to use a current limited supply, but else a 12V car battery with a lightbulb will do. Measure current and voltage across motor and apply Ohms law. Use 2 motor terminals (leave 3rd one open), divide resistance by two for the star equivalent resistance value

Oh yeah now I know what you are up to.

Amber what I did was took like 4 multi meters and setup a little test where I put my 120Vac heat dish (its just a resistive element) in series with 1 phase of the motor and a battery (DC voltage). I measured the current flowing in the series circuit and the voltage drop of the motor.
From that you can work the math.

Some RC car chargers have a wire cut mode that can work for this.
But I suggest making sure you are over 10 amps to be as accurate as you can.
If you could do 100 amps it would be great but setting that up is not easy or cheep.
 
Lebowski said:
Best is to use a current limited supply, but else a 12V car battery with a lightbulb will do. Measure current and voltage across motor and apply Ohms law. Use 2 motor terminals (leave 3rd one open), divide resistance by two for the star equivalent resistance value

Will try that later today.
So i will measure mV voltage difference between motor contacts and divide that to get single phase voltage drop?
Do i use old analog volt meter? :)
 
Back
Top