• Hello ES! We could use some help to get us past the finish line on building the new knowledgebase for the forum.
    Can you donate? Please see our fundraising page. Thank you!

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

My thoughts are the same. But as long as you leave voltage headway in your system it should be OK. My power switches are rated for 1200v so a 470v battery with 50% boost is still only 705 . It would be past the rating of the cap though...
 
I'm not sure if the battery fuse will blow fast enough to save the controller though.

I think that field weakening will have benefits even if the motors no load speed is never exceeded. Without field weakening the controller can't put full current all the way to no load speed, because of motor+battery resistance, right?
Lets say that there is 10% resistive motor losses and 10% battery sag at full power. Then the motor can only produce full torque up to 80% of no load speed. After that, torque tapers off until becoming zero at no load speed. Field weakening will make the motor able to produce torque all the way up to (and past, if you like) it's no load speed. If speed is limited to no load speed, field weakening should be safe even if the controller looses sync. Should even be possible to run a bit past no load speed as long as you limit it to what would be a safe braking torque if it fails. At this mild level, the extra losses in the motor shouldn't be of much concern.

I have been playing a bit myself with vector control on a 8-bit Atmel, with the goal of adding field weakening, because that will be needed in my application. But I'm starting to realize that I will never finish it, and I think the CPU was a poor choice. I will likely never achieve the level of quality/operation of the Lebowski controller.
 
I think field weakening will be ok if the end user sets it up correctly.
In my case my battery max voltage is 470 but if the system had 30% field weakening it would be useful to achieve a little higher HP (torque to a higher RPM) but does not need to exceed the 470v by much to get me where I want to be. The motor is Rated for 10300 rpm and at 10000 rpm the phase to phase voltage is 476 peak. If I pushed it a bit I don't think it would be a problem as the voltage would be above the battery limit but if the controller lost control it would let the diodes in the power switches feed the battery a quick charge but this would be at a high speed and only last for a second or 2 until the car slowed from wind resistance and other drag as well as the strong regen... It would stop the auto regen at a few volts above the state of charge of the battery and I would have to apply the brakes to slow the car at that point....

If a person was to set up the RPM limit properly the over voltage of the battery and system can be avoided. One must know the risks and one must have a Decent voltage headway in the system. But If I could have full torque to ~8000 rpm and it fade to 10,000-11,000 rpm somewhere It would be perfect for my system.
The OEM leaf inverter run the LEAF motor to 10300 rpm with a 98s lithium batter which only charged to ~4.1v a cell so only 401v fully charged and still spun the motor to 10300 rpm with a KV of 21 rpm per/volt!
 
Well, I would be interested in trying out field weakening... first I want to finish with the temperature sensors though (but before that the work related project).

The leaf motor is very suitable for field weakening by the way. If you calculate the inductor impedance, the chip says its 237 uH, combined with 9000 rpm and I'm
guessing 4 erpms per rpm, you get an impedance of around 0.9 Ohm. The ''gain'' in voltage headroom for making rpms is about 2 * 0.9Ohm * I_phase_fw. So at
100A phase you have an effective 180V extra for making more rpms... (and for blowing up all your stuff too :D I am thinking about disabling all error
current checks once it goes into the field weaking range)

Problem for me is, my own motor only makes 4V extra on top of 80, it'll be almost impossible to see the effect, so testing it will be challenging...
 
Lebowski said:
Well, I would be interested in trying out field weakening... first I want to finish with the temperature sensors though (but before that the work related project).

The leaf motor is very suitable for field weakening by the way. If you calculate the inductor impedance, the chip says its 237 uH, combined with 9000 rpm and I'm
guessing 4 erpms per rpm, you get an impedance of around 0.9 Ohm. The ''gain'' in voltage headroom for making rpms is about 2 * 0.9Ohm * I_phase_fw. So at
100A phase you have an effective 180V extra for making more rpms... (and for blowing up all your stuff too :D I am thinking about disabling all error
current checks once it goes into the field weaking range)

Problem for me is, my own motor only makes 4V extra on top of 80, it'll be almost impossible to see the effect, so testing it will be challenging...
That's good news as 180 is about 80 more then I need :) I think... I understand you are busy but its no rush I will be lucky to be driving the car this year and if I can increase the top speed in the future that's great.

I have a x5304 with ~250 uh inductance and .183 ohms resistance. I can ship it to you for free if you think It will help you.
I measured the leaf motor with something like 280 uH phase to phase with my cheep meter so the controller is measuring close if not right on the money and the leaf resistance is .01 ohms phase to phase.
 
Thanks for the kind offer Arlin but shipping a heavy motor back and forth, it'll be easier to let you try it out once I have something.

What I think I'll do is try out the fieldweakening with my little RC motor, with added external inductors. My view on how field weakening works,
it has nothing to do with reducing the field of the permanent magnets inside the motor. I think what happens is that a 90 degree rotated phase
current component, together with the 90 degree rotation from the inductance (it being winding or external) will reduce the voltage as
seen by the controller...

So, adding 100uH to a 5uH RC motor wil give me a high current high speed high inductance motor to test with...
 
Lebowski said:
Thanks for the kind offer Arlin but shipping a heavy motor back and forth, it'll be easier to let you try it out once I have something.
...
I was thinking you could keep it.
 
Lebowski said:
it would be interesting to see the calibration data from the hall sensors (as shown in the hall sensor menu) ?
Shoot I closed it already

I have to change a couple things as with no throttle at a stop some times it jitters and goes in and out of drive 3. I raised the E-rpm transition to drive 3 to 200 but I will try raising it more. There is likely a few other settings I can adjust. I will try to make up the proper wires tomorrow night and run it at 220v and set it up the rest of the way to make sure its smooth. I just want to make sure sensorless is as good as it can be as well in case I ever need it.
I will post the data from the halls asap.
 
Arlo1 said:
Lebowski said:
it would be interesting to see the calibration data from the hall sensors (as shown in the hall sensor menu) ?
Shoot I closed it already

I have to change a couple things as with no throttle at a stop some times it jitters and goes in and out of drive 3. I raised the E-rpm transition to drive 3 to 200 but I will try raising it more. There is likely a few other settings I can adjust. I will try to make up the proper wires tomorrow night and run it at 220v and set it up the rest of the way to make sure its smooth. I just want to make sure sensorless is as good as it can be as well in case I ever need it.
I will post the data from the halls asap.

For this, one thing indeed is to try to increase the transition erpm to drive 3, like you mentioned (500 maybe ?). Another thing affecting this is in the filter menu, option e. The speed signal
inside the chip is quite noisy, it is filtered (with option e) before comparing it with the transition erpm. Option e should be around 200 to 300 msec.
 
did you hear the noise in the video at 2:23 ? That is the recovery working :D After you pressed the setup all lights are on for about a second or so, after
which the chip resets. Since you have the motor standstill detection off the chip goes and tries to recover the motor, which is the chirpy noise at 2:23. After that
you can power the motor again.... remember with the older versions you had to wait for the motor to spin down all the way to standstill ?
 
Lebowski said:
did you hear the noise in the video at 2:23 ? That is the recovery working :D After you pressed the setup all lights are on for about a second or so, after
which the chip resets. Since you have the motor standstill detection off the chip goes and tries to recover the motor, which is the chirpy noise at 2:23. After that
you can power the motor again.... remember with the older versions you had to wait for the motor to spin down all the way to standstill ?
Yup sorry I should have mentioned that more clearly in the video. But recovery is cool I pushed the reset button like 10 times trying it out with throttle and without. Its very cool.

Scared me the first time but seems good.
 
Lebowski, when using the new gate drivers from Avago, the ACPL-336J/337J, a mute time on the input is needed after a DESAT event, to reset the fault output and to re-enable the gate driver output. This required mute time can be as long as 4.2ms where the input must be low.

Is a hard reset of the dsPIC the only way to have it stop PWM at the outputs for those 4.2ms?

The ACPL-333J had an automatic fault output reset that would reset the fault output after no more than 40µs so this mute time is a new thing with the new generation gate drivers from Avago.
 
Ok I played around tonight. I found the amps used to spin the motor at full throttle went down at I increased the PWM frequency as well they went down at I increased the Dead time. So I hooked up the scope and found the RPM was going down a very small amount when the amperage was going down. I will post data for that tomorrow.

While playing I had one time when a setting might have been off?? But something latched up and blew my meter (circuit breaker poped then reset) and smoke come out of my meter and fried my god test leads. I tested for a short form - to + with it powered down and it was fine so I run it again and it seemed ok.
I still need to send the fault info out to a board to shut things down in a bad event I thin I will try to design that asap.

But here is the Hall sensor numbers. Its a 8 magnet motor
I set the transition from 2-3 really high so I could here how smooth the halls work and they are pretty rough. Maybe the UVW is not correct??
I don't know how to make sense of the numbers.
If I set the transition from Hall to sensorless at say 2000 erpm it spins up then its like a turbo when the sensorless kicks in.
Also with higher PWM frequency it seems to slow it self down like a brake is applied when I let go of the throttle and it slows down faster with higher PWM frequency. I tested up to 20khz
Code:
   save the following HEX lines in a text file, including the '*' termination char
acter                                                                           
                                                                                
0x08FA  0x06BB  0x0E74  0x0024  0x0003  0x000C  0x7FBC  0x00AF                  
0x0000  0x002C  0x8000  0x0130  0x00A9  0x01A1  0x038A  0x0398                  
0x038A  0xAAAA  0xAAAA  0xAAAA  0x0BB8  0x1770  0x008F  0x0D05                  
0x0003  0xF62C  0x0690  0x1000  0x0000  0x0000  0xFFFF  0xFFFF                  
0xFFFF  0x0054  0x03AB  0xFFFF  0xFFFF  0x0370  0x00CB  0x021E                  
0x0000  0x05A8  0x0258  0x0064  0xFFFF  0xFFFF  0xFFFF  0xFFFF                  
0x0000  0x4CCD  0x000C  0x0000  0x00F0  0xFFFF  0xB333  0xFFF4                  
0x0000  0xFF10  0x0000  0x07AE  0x0018  0x0000  0x01E0  0xFFFF                  
0xF852  0xFFE8  0x0000  0xFE20  0x0003  0x0000  0x0078  0x0000                  
0x0000  0xFFFD  0x0000  0xFF88  0x0000  0x0000  0x003C  0x0003                  
0x0000  0x0000  0x0000  0xFFC4  0xFFFD  0x0000  0x0000  0x0000                  
0x00F0  0x000C  0x0000  0x0000  0x0000  0xFF10  0xFFF4  0x0000                  
0x0000  0x0000  0x647C  0x0161  0x0EDA  0x097B  0x0152  0x00F3                  
0x0411  0x0CA4  0x05B0  0x0024  0x0288  0x0042  0x0010  0x0E10                  
0x0000  0x012C  0x00C8  0x2328  0x03B6  0x6000  0x0152  0x05B2                  
0xFF00  0x8617  0xDC17  0xB117  0x3117  0x5B17  0x0617  0xFF00                  
0xFFFF  0xC519  0x764B  0x5482  0x41B3  0x35C3  0x2D7A  0x276B                  
0x22C9  0x1F1E  0x1C28  0x19B5  0x17A6  0x15E6  0x1463  0x1312                  
0x11EB  0x10E4  0x0FFB  0x0F28  0x0E6B  0x0DC0  0x0D23  0x0C94                  
0x0C10  0x0B97  0x0B27  0x0ABF  0x0A5F  0x0A05  0x09B1  0x0962                  
*                                                                               
                                                                                
                                                                                
a) save data to ROM for motor use
 
Still have to look through the settings but confidence '2' in the hall menu is extremely low, it's basically telling you the hall signals are random noise with a tiny bit of information mixed in. You can try calibrating again at a lower rpm but i think you need to put the hall signals on a scope to see whether they look like nice solid square waves... measure them as close to the controller ic as possible!
 
Lebowski said:
Still have to look through the settings but confidence '2' in the hall menu is extremely low, it's basically telling you the hall signals are random noise with a tiny bit of information mixed in. You can try calibrating again at a lower rpm but i think you need to put the hall signals on a scope to see whether they look like nice solid square waves... measure them as close to the controller ic as possible!
I have scoped the halls on the one side of the 4.7k resistors on the brain board. I will scope them on the brain input if I can get a chance before work.

It does start much better with hall sensor start up.
But it helps if I keep the transition to sensorless low.
I also calibrated it 2 times and watched the numbers and they were very close.
Its a small chance this sensor is programed for 5 polls and not 4 like it should be....
How do I understand the hall info?
 
I read your manual again and have some understanding of it. I might need to space the sensor closer to the magnet. I will see If I can try that. I will also scope it with 2 probes and compare all 3 outputs.

I need to get the confidence numbers up.

In your manual you can see a common number of 59 when subtracting the 2 nearest numbers and in my numbers the common number is not really there...
Hmm maybe I need to scope the UVW in relation to the wave out put... This Is tricky with the isolated brain power supply....
 
Yep, confidence has to go up, ideally all the way to 7. This afternoon I saw a goldenmotor with halls get a confidence of 7...

ideally the halls divide the 360 degrees of the motor into 6 sections, so 60 degree spacing. You are close there:
code 6 -> 8 degree
code 4 -> 68 degree
code 5 -> 127 degree
etc etc
so almost perfect 60 degree spacing.

code 6: this is binary 110 meaning hall 3 is a logic 1, hall 2 is a 1 and hall 1 is a 0.

I think the code table is close to perfect, but the low confidence tells me there's a lot of noise on the signals, When you're running the motor with hall info this noise is what makes it misbehave...
 
Futterama said:
Lebowski, when using the new gate drivers from Avago, the ACPL-336J/337J, a mute time on the input is needed after a DESAT event, to reset the fault output and to re-enable the gate driver output. This required mute time can be as long as 4.2ms where the input must be low.

Is a hard reset of the dsPIC the only way to have it stop PWM at the outputs for those 4.2ms?

The ACPL-333J had an automatic fault output reset that would reset the fault output after no more than 40µs so this mute time is a new thing with the new generation gate drivers from Avago.

I think so yes, the only way to stop the PWM is by keeping the controller IC reset.

But... if you almost had a catastrophic DESAT event, shouldn't you let the rider
know by means of lots of blinking warning lights and a disabled controller ?
 
Arlo1 said:
This Is tricky with the isolated brain power supply....

Pick up a cheap differential probe. You really need one for working on the voltages you are using. Pintek has some 25Mhz units which are $300-$400. There are also used Tektronix units which are in the same price range.
 
Lebowski said:
Yep, confidence has to go up, ideally all the way to 7. This afternoon I saw a goldenmotor with halls get a confidence of 7...

ideally the halls divide the 360 degrees of the motor into 6 sections, so 60 degree spacing. You are close there:
code 6 -> 8 degree
code 4 -> 68 degree
code 5 -> 127 degree
etc etc
so almost perfect 60 degree spacing.

code 6: this is binary 110 meaning hall 3 is a logic 1, hall 2 is a 1 and hall 1 is a 0.

I think the code table is close to perfect, but the low confidence tells me there's a lot of noise on the signals, When you're running the motor with hall info this noise is what makes it misbehave...
Yes can be noise or maybe the distance of the sensor also it was ~ 2300rpm when calibrated so maybe I will try lower.
 
Lebowski said:
But... if you almost had a catastrophic DESAT event, shouldn't you let the rider
know by means of lots of blinking warning lights and a disabled controller ?
For my RC car application, I will probably allow a few DESAT detections without shutdown in case they are somehow false triggers. If something really is totally wrong, the DESAT would trip immediately again, and my supporting PIC would detect this and then shutdown. All this info will of course be collected and sent to the remote device (smartphone).

The reason for the above is that during a race, a false triggered shutdown is unacceptable. Sure, my controller should not be false triggering any faults, it should be well tested, but in case I need to accept a few faults, maybe during the testing/tweaking phase, it is nice to know how to do this.
 
what you can do, disable throttle closed and motor standstill detection (both in the recovery menu). Then you can reset the controller on the fly and
have it apply power again after the reset, without having to wait for motor standstill or throttle closed. Then all you get is a short 'hickup'...
 
Back
Top