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

Electric Motors and Controllers
Tomdb
10 W
10 W
Posts: 94
Joined: Apr 03, 2014 7:47 am
Location: Warwickshire

Re: Lebowski's motor controller IC, schematic & setup, new v

Post by Tomdb » May 26, 2017 1:53 pm

Got something really weird happening.
4 months a go I was super happy to finally have the controller working.


Come back to it a month or two ago, for some reason the IC was broken.

Ordered some new ones and built the setup in my garage, now it does not want to spin properly. and again shows overflow on the FOC calc a few times.

With this setup it wont even spin up propperly. Can anyone have a quick look for something completely off, ran through the setup and auto completing most of it. Will probably look at purchasing an known working board to figure out if I have a big mistake in my board or there are other issues?

Code: Select all

version:293_
0x0133	0xFFFF	0xFFFF	0x0281	0x0281	0xFFFF	0xFFFF	0x0000
0x0001	0xFFFF	0xFFFF	0xFFFF	0xFFFF	0x0C80	0x25DB	0x7FBC
0x7D2E	0x0030	0x0261	0x5289	0x00B9	0x022C	0xFFFF	0xFFFF
0xFFFF	0xFFFF	0x795E	0x0010	0x8AB8	0x000A	0x0000	0x07AE
0x0018	0x0000	0x01E0	0xFFFF	0xF852	0xFFE8	0x0000	0xFE20
0x0000	0x4CCD	0x0018	0x0000	0x01E0	0xFFFF	0xB333	0xFFE8
0x0000	0xFE20	0xF965	0xFF07	0xFFFF	0xFFFF	0x2141	0xFFFF
0xFFFF	0xFFFF	0xFFFF	0xFFFF	0xFFFF	0xFFFF	0xFFFF	0xFFFF
0xFFFF	0xFFFF	0x0305	0x12D6	0x0408	0x0040	0x0033	0x0013
0xFFFF	0x0000	0x0045	0x0022	0x03EE	0x03EF	0x03EE	0x0EA5
0x0581	0x001E	0x06E2	0x0005	0x08B9	0xFFF8	0x0C7F	0xF000
0x0000	0x0000	0x1000	0x0000	0x0000	0x0001	0x03FE	0x00F5
0x026B	0x0117	0x000D	0x0117	0x008B	0x0350	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	0x02D9	0x25E2	0x00E9	0x0241	0x008B	0x0080
0x0226	0x0301	0x0013	0x0010	0x0E10	0x03E8	0x03B6	0x6000
0x0053	0x00C0	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	0x0000	0x0000	0x0005	0x0000
0x0000	0x0000	0x0000	0x0000	0x0000	0x0000	0x0000	0x0000
0x0000	0x0000	0x0000	0x0000	0x0000	0x0000	0x0000	0x0000
0x0000	0x0000	0x0000	0x0000	0x0000	0x0000	0x0000	0x0000
0x0000	0x0000	0x0000	0x0000	0x0000	0x0000	0x0000	0x0000
0x0000	0x0000	0x0000	0x0000	0x0000	0x0000	0x0000	0x0000
0x0000	0x0000	0x0000	0x0000	0x0000	0x0000	0x0000	0x0000
0x0000	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	*

kywalda
10 mW
10 mW
Posts: 22
Joined: Apr 29, 2016 2:22 pm

Re: Lebowski's motor controller IC, schematic & setup, new v

Post by kywalda » May 26, 2017 2:09 pm

Arlo1 wrote: Or just set the battery regen amps to something the fuse and battery can handle?

There is no reason to need to set it really high... Maybe the current sensors are not set properly?
This is what I had before. But there was a kind of "rumpling-speed". With regen battery current of 80A is was between 25 and 35 km/h. Above and below that speed there was a constant "negativ torque". But in this speed area the controller detected an over current and switched off regen for some millis and then on again and again. This feels like "rumpling".
When I decreased the current setting this "rumpling speed" also decreased to 15 to 25 km/h. So I tried to increase the current. At 300A it was beyond the speed I could reach with this motor.

Maybe it is only wrongly marked in the setup menu. That "regen battery current" in reality is "regen phase current"...

Tomdb
10 W
10 W
Posts: 94
Joined: Apr 03, 2014 7:47 am
Location: Warwickshire

Re: Lebowski's motor controller IC, schematic & setup, new v

Post by Tomdb » May 26, 2017 2:44 pm

I just noticed that the first schematic dictates a rough estimation for the RC filter for the current sensors,

My current setup is 1k resistor and 10nf cap

However im just running 4K Hz pwm so I would need to be at a 4K resistor instead of a 1K, would this make a big difference?

Tomorrow I will strip the wiring out and solder all my connections, except the pcb ones to ensure those are not causing any issues.

User avatar
Arlo1
100 GW
100 GW
Posts: 8492
Joined: Apr 26, 2009 10:36 pm
Location: Nanaimo BC Canada
Contact:

Re: Lebowski's motor controller IC, schematic & setup, new v

Post by Arlo1 » May 26, 2017 2:54 pm

Tomdb wrote:I just noticed that the first schematic dictates a rough estimation for the RC filter for the current sensors,

My current setup is 1k resistor and 10nf cap

However im just running 4K Hz pwm so I would need to be at a 4K resistor instead of a 1K, would this make a big difference?

Tomorrow I will strip the wiring out and solder all my connections, except the pcb ones to ensure those are not causing any issues.
The math for the current delay is based on the comutation frequency not the PWM frequency. I would keep the 1000ohm resistors.
My Leaf motor controller build. https://endless-sphere.com/forums/viewto ... 27#p963227
My YSR build http://www.youtube.com/watch?v=BRo8r5g4NBg
RC and most types of Lithium batteries you MUST know your individual cell voltages charging and discharging.
Don't keep them were you cant afford smoke or fire!
Never above 4.2v never below 2.7v EVER!!!
HI power controller design. Game Changer

Tomdb
10 W
10 W
Posts: 94
Joined: Apr 03, 2014 7:47 am
Location: Warwickshire

Re: Lebowski's motor controller IC, schematic & setup, new v

Post by Tomdb » May 26, 2017 4:01 pm

So my setup with 1K R and 10nF resistor is fine.

Will keep debugging my setup.
If all else fails I will have a play with the Rinehart PM150DX I got laying around

User avatar
Arlo1
100 GW
100 GW
Posts: 8492
Joined: Apr 26, 2009 10:36 pm
Location: Nanaimo BC Canada
Contact:

Re: Lebowski's motor controller IC, schematic & setup, new v

Post by Arlo1 » May 27, 2017 2:13 am

I use 1000ohm resistors and 10nf on the current sensors.

The less of the dampening the better for timing. The RC filter causes a delay in the current sensor info which will cause the timing to retard a bit.
This will increase as your erpms increase. But you need a bit of a filter to get rid of some of the noise.

If you have problems start with the basics.. Do your PWM test mode with no power on the DC buss and work back up to a running system.

Also make sure the current sensors are calibrated properly as I find mine runs much better when I do.

Keep an eye on the voltage at the brain. I had about 5 resistors fail on the input to the brain (was using a 10 ohm) now I just soldered it to get rid of the resistor failures. The brain will measure 5v when you check it powered up but it drops when you try to run a motor which can cause a brownout.
My Leaf motor controller build. https://endless-sphere.com/forums/viewto ... 27#p963227
My YSR build http://www.youtube.com/watch?v=BRo8r5g4NBg
RC and most types of Lithium batteries you MUST know your individual cell voltages charging and discharging.
Don't keep them were you cant afford smoke or fire!
Never above 4.2v never below 2.7v EVER!!!
HI power controller design. Game Changer

User avatar
Lebowski
1 GW
1 GW
Posts: 3110
Joined: Jun 28, 2011 1:38 am
Location: beautiful Zurich, Switzerland

Re: Lebowski's motor controller IC, schematic & setup, new v

Post by Lebowski » May 27, 2017 2:38 am

Tomdb wrote:Got something really weird happening.
4 months a go I was super happy to finally have the controller working.


Come back to it a month or two ago, for some reason the IC was broken.

Ordered some new ones and built the setup in my garage, now it does not want to spin properly. and again shows overflow on the FOC calc a few times.

With this setup it wont even spin up propperly. Can anyone have a quick look for something completely off, ran through the setup and auto completing most of it. Will probably look at purchasing an known working board to figure out if I have a big mistake in my board or there are other issues?

Code: Select all

version:293_
0x0133	0xFFFF	0xFFFF	0x0281	0x0281	0xFFFF	0xFFFF	0x0000
0x0001	0xFFFF	0xFFFF	0xFFFF	0xFFFF	0x0C80	0x25DB	0x7FBC
0x7D2E	0x0030	0x0261	0x5289	0x00B9	0x022C	0xFFFF	0xFFFF
0xFFFF	0xFFFF	0x795E	0x0010	0x8AB8	0x000A	0x0000	0x07AE
0x0018	0x0000	0x01E0	0xFFFF	0xF852	0xFFE8	0x0000	0xFE20
0x0000	0x4CCD	0x0018	0x0000	0x01E0	0xFFFF	0xB333	0xFFE8
0x0000	0xFE20	0xF965	0xFF07	0xFFFF	0xFFFF	0x2141	0xFFFF
0xFFFF	0xFFFF	0xFFFF	0xFFFF	0xFFFF	0xFFFF	0xFFFF	0xFFFF
0xFFFF	0xFFFF	0x0305	0x12D6	0x0408	0x0040	0x0033	0x0013
0xFFFF	0x0000	0x0045	0x0022	0x03EE	0x03EF	0x03EE	0x0EA5
0x0581	0x001E	0x06E2	0x0005	0x08B9	0xFFF8	0x0C7F	0xF000
0x0000	0x0000	0x1000	0x0000	0x0000	0x0001	0x03FE	0x00F5
0x026B	0x0117	0x000D	0x0117	0x008B	0x0350	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	0x02D9	0x25E2	0x00E9	0x0241	0x008B	0x0080
0x0226	0x0301	0x0013	0x0010	0x0E10	0x03E8	0x03B6	0x6000
0x0053	0x00C0	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	0x0000	0x0000	0x0005	0x0000
0x0000	0x0000	0x0000	0x0000	0x0000	0x0000	0x0000	0x0000
0x0000	0x0000	0x0000	0x0000	0x0000	0x0000	0x0000	0x0000
0x0000	0x0000	0x0000	0x0000	0x0000	0x0000	0x0000	0x0000
0x0000	0x0000	0x0000	0x0000	0x0000	0x0000	0x0000	0x0000
0x0000	0x0000	0x0000	0x0000	0x0000	0x0000	0x0000	0x0000
0x0000	0x0000	0x0000	0x0000	0x0000	0x0000	0x0000	0x0000
0x0000	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	*
Just looking at the hex, the phase current is set for only 20 A ? With 2.8mV/A sensors that only a few LSB's of the ADC...
You need to enter more realistic numbers in the erpm menu (especially regen ramp). Also I would to 1000 and 1500 for the
transition erpms, 800 and 1000 is a bit close together. the FOC measurement current is way too low for your current sensors.
(10A is only 4 lsb's of the ADC).

What I would do, in the main menu give '!', reset and do all menu's again but with reasonable current numbers everywhere.

Tomdb
10 W
10 W
Posts: 94
Joined: Apr 03, 2014 7:47 am
Location: Warwickshire

Re: Lebowski's motor controller IC, schematic & setup, new v

Post by Tomdb » May 27, 2017 3:01 am

Thanks Lebowski, I will give that a try.

Need to figure out what changed to make it all of a sudden not work because I need a reliable solution. So to reset all values you enter "1" is that one of the many secrets this chip has? :)

User avatar
Lebowski
1 GW
1 GW
Posts: 3110
Joined: Jun 28, 2011 1:38 am
Location: beautiful Zurich, Switzerland

Re: Lebowski's motor controller IC, schematic & setup, new v

Post by Lebowski » May 27, 2017 3:05 am

Tomdb wrote:Thanks Lebowski, I will give that a try.

Need to figure out what changed to make it all of a sudden not work because I need a reliable solution. So to reset all values you enter "1" is that one of the many secrets this chip has? :)
It is not a 1 but an exclamation mark. This is the normal way to trigger an update. Before it updates it wipes the complete settings memory, so it is a way to start with a clean slate. After '!' a reset will terminate the update and bring it back to normal funtional mode, but with the settings menu wiped.

User avatar
Arlo1
100 GW
100 GW
Posts: 8492
Joined: Apr 26, 2009 10:36 pm
Location: Nanaimo BC Canada
Contact:

Re: Lebowski's motor controller IC, schematic & setup, new v

Post by Arlo1 » May 27, 2017 5:48 am

Tomdb wrote:Thanks Lebowski, I will give that a try.

Need to figure out what changed to make it all of a sudden not work because I need a reliable solution.
If your current sensors are 2.8mv/a you will find the magnetic hysteresis of the sensors them selves might be a few amps so only having a current limit of 20 amps is way to low. Mine wont even run until I set it for 100amps + and my current sensors are 950a sensors.

You need to set the phase amps to a realistic number then do all the auto completes. When I auto complete the current menu after setting the phase amps to 100-200 amps then current sensor calibration and FOC calibration will see this and do the calibrations at a current related to the limits of the current menu. I set mine up that way to get a good current sensor calibration then I do the FOC at the most current the chip will measure the inductance at and save it and go back and set the current to what I plan to run (750 amps+) then I auto complete everything again but I don't bother with the current sensor calibration because it seems to be less reliable at higher currents.

Either way when I run the motor even with the wheels in the air I need to set at least 100 phase amps.
My Leaf motor controller build. https://endless-sphere.com/forums/viewto ... 27#p963227
My YSR build http://www.youtube.com/watch?v=BRo8r5g4NBg
RC and most types of Lithium batteries you MUST know your individual cell voltages charging and discharging.
Don't keep them were you cant afford smoke or fire!
Never above 4.2v never below 2.7v EVER!!!
HI power controller design. Game Changer

Tomdb
10 W
10 W
Posts: 94
Joined: Apr 03, 2014 7:47 am
Location: Warwickshire

Re: Lebowski's motor controller IC, schematic & setup, new v

Post by Tomdb » May 27, 2017 7:04 am

Lebowski and Arlo1,

thank you for this kind advise. I could have also realized this myself since I have been busy building a BMS with current shunt. But as I did not write the software I had no clue on wat size of ADC we are running. :roll: (weak excuse :D )

She spins real good once in mode 3, need to fine tune the start. So now again at a point where without a proper vehicle or load bench little testing can be done.

If you want to have a look at the settings that made her spin see below.

Code: Select all

version:293_
0x0133	0xFFFF	0xFFFF	0x0241	0x013A	0x0400	0x0750	0x0000
0x0400	0xFFFF	0xFFFF	0xFFFF	0xFFFF	0x0D20	0x25DB	0x7FBC
0x7D2E	0x0030	0x0143	0x5424	0x0060	0x0430	0xFFFF	0xFFFF
0xFFFF	0xFFFF	0x795E	0x0008	0x8526	0x000A	0x0000	0x07AE
0x0018	0x0000	0x01E0	0xFFFF	0xF852	0xFFE8	0x0000	0xFE20
0x0000	0x4CCD	0x0018	0x0000	0x01E0	0xFFFF	0xB333	0xFFE8
0x0000	0xFE20	0xF965	0xFF07	0xFFFF	0xFFFF	0x2141	0xFFFF
0xFFFF	0xFFFF	0xFFFF	0xFFFF	0xFFFF	0xFFFF	0xFFFF	0xFFFF
0xFFFF	0xFFFF	0x05CD	0xF196	0x03A1	0x0060	0x0033	0x0000
0xFFFF	0x0000	0x01A3	0x00D1	0x03F7	0x03F9	0x03F6	0x0EA5
0x0581	0x002D	0x06E2	0x0005	0x0CB9	0xFFF8	0x0D1F	0xF000
0x0000	0x0000	0x1000	0x0000	0x0000	0x0039	0x03C6	0x013A
0x0218	0x068F	0x0053	0x0577	0x02BB	0x0350	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	0x02D9	0x288C	0x0082	0x0201	0x02BB	0x0080
0x0226	0x0301	0x0013	0x0010	0x0E10	0x03E8	0x03B6	0x6000
0x01F7	0x00C0	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	0x0000	0x0000	0x0005	0x1000
0xD8A4	0x0002	0x0000	0x01EB	0x0150	0x0000	0x0012	0x0014
0x0000	0x0000	0xFFFF	0xFFFF	0x0000	0xFFFF	0x0000	0x2800
0x011F	0x0000	0x0000	0xFA27	0xFFF6	0x0000	0x0EB4	0x0000
0x0000	0x0000	0x0000	0xFFFF	0xFF8F	0x01A2	0xFFD7	0x2800
0x06CA	0x0000	0x0000	0xFA27	0x0003	0x0000	0x010F	0x0000
0x0000	0x0000	0x0000	0xFFFF	0xFF1E	0xFE65	0xFFAA	0x2800
0x011A	0x0000	0x0000	0xFA27	0xFFF5	0x0000	0x05ED	0x0000
0x0000	0x0000	0x0000	0xFFFF	0xFD07	0x0195	0xFF8B	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	*
quick youtube video

Volttan
1 mW
1 mW
Posts: 13
Joined: Sep 29, 2016 11:44 am
Location: Sokołów Podlaski Poland

Re: Lebowski's motor controller IC, schematic & setup, new v

Post by Volttan » May 31, 2017 6:26 am

2.91 works on these settings almost perfectly, it only needs a little help at startup. He can only break the synchronization when the throttle is opened quickly

Code: Select all

version:291_                                                                    
0x7EB8  0x0000  0xFFFF  0xFFFF  0x795E  0x0020  0xBC77  0x5368                  
0x038A  0x000A  0x0000  0x07AE  0x0018  0x0000  0x01E0  0xFFFF                  
0xF852  0xFFE8  0x0000  0xFE20  0x0000  0x4CCD  0x0018  0x0000                  
0x01E0  0xFFFF  0xB333  0xFFE8  0x0000  0xFE20  0xFAB5  0xFF06                  
0xFFFF  0xFFFF  0x2916  0xFFFF  0xFFFF  0xFFFF  0xFFFF  0xFFFF                  
0xFFFF  0xFFFF  0xFFFF  0xFFFF  0xFFFF  0xFFFF  0x0228  0xAED3                  
0x026F  0x0137  0x009D  0x009D  0x03EB  0x0019  0x0005  0x0000                  
0x0033  0x1111  0xFFFF  0x7FBC  0x0000  0x0433  0x0219  0x03FB                  
0x03FA  0x03FA  0x0BB7  0x0474  0x0024  0x0592  0x0006  0x0E19                  
0xFFFE  0x0910  0x1000  0x0000  0x0000  0xFFFF  0xFFFF  0xFFFF                  
0x0088  0x0313  0x0004  0x0000  0x10CD  0x00D7  0x0985  0x011E                  
0x0418  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  0x02EB  0x1705  0x0102                  
0x0137  0x02CC  0x0067  0x01BD  0x026F  0x000F  0x00BA  0x0E10                  
0x0000  0x03E8  0x03B6  0x6000  0x050A  0x009B  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                  
0x0000  0x0000  0x0005  0x2080  0x0002  0x0000  0x0000  0x0000                  
0x0003  0x0000  0x7FBC  0x0000  0x0000  0x0000  0x0000  0xFFFF                  
0x0000  0xFFFF  0x0000  0x8000  0x0435  0x0000  0x0000  0x0000                  
0x0000  0x0000  0x0000  0x0000  0x0000  0x0000  0x0000  0xFFFF                  
0x0000  0x0000  0x0000  0x2000  0xAA04  0x0008  0x0000  0x0000                  
0x0000  0x0000  0x008A  0x0000  0x0000  0x0000  0x0000  0xFFFF                  
0x000A  0xFFF8  0x0009  0x1400  0x03B8  0x0000  0x0000  0x0E7E                  
0x0064  0x0000  0x076F  0x0000  0x0000  0x0000  0xFFFF  0xFFFF                  
0x0452  0xFF9E  0x0032  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  *                                                   
2.93 is set alike, but here I have a lot of problems with the start, as already stated, you have to gently operate with the throttle. The motor is spinning and suddenly stops at a battery current of about 8A

Code: Select all

version:293_                                                                    
0x00F9  0x0331  0x051C  0x026F  0x026F  0x009D  0x009D  0xFFFF                  
0xFFFF  0xFFFF  0xFFFF  0xFFFF  0xFFFF  0x0AA0  0x1EA3  0x7FBC                  
0x7D2E  0x0030  0x02EF  0x42C0  0x011A  0x016D  0x0007  0x11C6                  
0x001E  0x2AF8  0x795E  0x0020  0xB607  0x000A  0x0000  0x07AE                  
0x0018  0x0000  0x01E0  0xFFFF  0xF852  0xFFE8  0x0000  0xFE20                  
0x0000  0x4CCD  0x0018  0x0000  0x01E0  0xFFFF  0xB333  0xFFE8                  
0x0000  0xFE20  0x024A  0x011B  0x001E  0x0017  0xFFFF  0xFFFF                  
0xFFFF  0xFFFF  0xFFFF  0xFFFF  0xFFFF  0xFFFF  0xFFFF  0x0000                  
0xFFFF  0xFFFF  0x01FB  0x00C0  0x03EB  0x0019  0x0005  0xFFFF                  
0x0103  0x0000  0x0433  0x0219  0x03FA  0x03FA  0x03FA  0x0BB7                  
0xFFFF  0x0024  0x0592  0x0006  0x0E99  0xFFFC  0x0A9F  0x1000                  
0x0000  0x0000  0xFFFF  0xFFFF  0xFFFF  0x0063  0x02ED  0xFFFF                  
0xFFFF  0x10CD  0xFFFF  0x0985  0x011E  0x0418  0x0258  0x0064                  
0xFFFF  0xFFFF  0x0200  0x1642  0xFFFF  0xFFFF  0xFFFF  0xFFFF                  
0xFFFF  0xFFFF  0xFFFF  0xFFFF  0xFFFF  0xFFFF  0x0005  0x0000                  
0x0064  0xFFFB  0x0000  0xFF9C  0xFFFF  0xFFFF  0xFFFF  0xFFFF                  
0xFFFF  0xFFFF  0x02EB  0x1597  0x00FA  0x0103  0x0599  0xFFFF                  
0xFFFF  0x026F  0x000F  0x00BA  0x0E10  0x03E8  0xFFFF  0x6000                  
0x050A  0x009B  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  0x0000  0x0000  0x0005  0x2000                  
0x77ED  0x0000  0x0000  0x1051  0xFFFD  0x0000  0xFEBF  0x0000                  
0x0000  0x0000  0x0000  0x0000  0x0006  0x0000  0x0008  0x1200                  
0x619A  0x0000  0x0000  0x1051  0x03EB  0x0000  0x0013  0x0000                  
0x0000  0x0000  0xFFFF  0x0000  0x0001  0x0000  0x0000  0x1200                  
0x5C8C  0x0000  0x1320  0x1116  0x03EB  0x0000  0x004F  0x0000                  
0x0000  0x0000  0xFFFF  0x0000  0x0000  0xFFFF  0x0000  0x1200                  
0x6C1F  0x0000  0x1F18  0x0DE4  0x03EB  0x0000  0x0027  0xFFF6                  
0x0000  0x0000  0xFFFF  0x0000  0x0001  0xFFFF  0xFFFF  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  *   

User avatar
Lebowski
1 GW
1 GW
Posts: 3110
Joined: Jun 28, 2011 1:38 am
Location: beautiful Zurich, Switzerland

Re: Lebowski's motor controller IC, schematic & setup, new v

Post by Lebowski » May 31, 2017 10:41 am

Hi Volttan,

Had a looks at the hex files. In 2.93 the recovery menu is not filled out (not autocompleted) . Also in the erpms menu you should enter a small number for 'accept reverse below' and give reasonable numbers for the regen ramping (like 500, 800). Finally I recommend you to set the transition erpms higher (now you have 100 and 500) to 600 and 1000...

Volttan
1 mW
1 mW
Posts: 13
Joined: Sep 29, 2016 11:44 am
Location: Sokołów Podlaski Poland

Re: Lebowski's motor controller IC, schematic & setup, new v

Post by Volttan » Jun 01, 2017 4:17 am

Lebowski wrote:Hi Volttan,

Had a looks at the hex files. In 2.93 the recovery menu is not filled out (not autocompleted) . Also in the erpms menu you should enter a small number for 'accept reverse below' and give reasonable numbers for the regen ramping (like 500, 800). Finally I recommend you to set the transition erpms higher (now you have 100 and 500) to 600 and 1000...

Hi

I set as you suggested, unfortunately no change.
I think there is something wrong with the current measurement, just why it works much better on 2.91, board is the same i just replaced the chip

Code: Select all

                                                                           
version:293_                                                                    
0x00F9  0x0331  0x051C  0x040E  0x040E  0x007E  0x007E  0x0019                  
0x1000  0xFFFF  0xFFFF  0xFFFF  0xFFFF  0x0A80  0x1EA3  0x7FBC                  
0x7D2E  0x0030  0x02DD  0x433E  0x0112  0x0177  0x0007  0x11C6                  
0x001E  0x2AF8  0x795E  0x0020  0xBB8C  0x000A  0x0000  0x07AE                  
0x0018  0x0000  0x01E0  0xFFFF  0xF852  0xFFE8  0x0000  0xFE20                  
0x0000  0x4CCD  0x0018  0x0000  0x01E0  0xFFFF  0xB333  0xFFE8                  
0x0000  0xFE20  0x024A  0x011B  0x001E  0x0017  0x2916  0xFFFF                  
0xFFFF  0xFFFF  0xFFFF  0xFFFF  0xFFFF  0xFFFF  0xFFFF  0x0000                  
0xFFFF  0xFFFF  0x020B  0x4890  0x0687  0x0033  0x001F  0x0014                  
0x0103  0x0000  0x0433  0x0219  0x03FB  0x03FB  0x03FB  0x0BB7                  
0x0474  0x0024  0x0592  0x0006  0x0E99  0xFFFC  0x0A7F  0x1000                  
0x0000  0x0000  0xFFFF  0xFFFF  0xFFFF  0x0063  0x02ED  0xFFFF                  
0xFFFF  0x10CD  0x00D7  0x0985  0x011E  0x0418  0x0258  0x0064                  
0xFFFF  0xFFFF  0x0200  0x1642  0x0003  0x0000  0x0078  0x0000                  
0x0000  0xFFFD  0x0000  0xFF88  0x0000  0x0000  0x0005  0x0000                  
0x0064  0xFFFB  0x0000  0xFF9C  0x000C  0x0000  0x00F0  0xFFF4                  
0x0000  0xFF10  0x02EB  0x157F  0x00F2  0x0137  0x0599  0x0067                  
0x01BD  0x026F  0x000F  0x00BA  0x0E10  0x03E8  0x03B6  0x6000                  
0x050A  0x009B  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  0x0000  0x0000  0x0005  0x2000                  
0x552F  0x0000  0x0000  0xF2B8  0x000F  0x0000  0x0235  0x0000                  
0x0000  0x0000  0x0000  0x0000  0x000A  0x0000  0xFFFB  0x1400                  
0x0E38  0x0000  0x2330  0xF6FE  0x005B  0x0000  0x1625  0x12CA                  
0x049E  0x0000  0xFFFF  0x0000  0xFB70  0x05E3  0x0027  0x1400                  
0xA07E  0x0000  0x2178  0xF70C  0x004C  0x0000  0x14AA  0x0DFC                  
0x0464  0x0000  0xFFFF  0x0000  0xFB74  0x04F3  0x004C  0x1200                  
0xA807  0x0000  0x1818  0x04EB  0x0687  0x0000  0x0017  0x005A                  
0x0000  0x0000  0xFFFF  0x0000  0x0001  0x0001  0xFFFF  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  * 
Last edited by Volttan on Jun 01, 2017 1:51 pm, edited 1 time in total.

User avatar
izeman
10 GW
10 GW
Posts: 4500
Joined: Jun 21, 2011 8:25 am
Location: vienna, austria
Contact:

Re: Lebowski's motor controller IC, schematic & setup, new v

Post by izeman » Jun 01, 2017 6:59 am

Volttan wrote:... just why it works much better on 2.91 chip is the same i just replaced the chip
you are replacing chips? you can up/downgrade the firmware. no need for several chips. or am i misunderstanding something here?

User avatar
Arlo1
100 GW
100 GW
Posts: 8492
Joined: Apr 26, 2009 10:36 pm
Location: Nanaimo BC Canada
Contact:

Re: Lebowski's motor controller IC, schematic & setup, new v

Post by Arlo1 » Jun 28, 2017 12:03 am

New code coming guys is REALLY awesome!

All my problems are solved....
My Leaf motor controller build. https://endless-sphere.com/forums/viewto ... 27#p963227
My YSR build http://www.youtube.com/watch?v=BRo8r5g4NBg
RC and most types of Lithium batteries you MUST know your individual cell voltages charging and discharging.
Don't keep them were you cant afford smoke or fire!
Never above 4.2v never below 2.7v EVER!!!
HI power controller design. Game Changer

Altair
100 W
100 W
Posts: 233
Joined: May 03, 2014 10:35 am
Location: Quebec, Canada

Re: Lebowski's motor controller IC, schematic & setup, new v

Post by Altair » Jun 28, 2017 7:41 am

WHOO HOOO !
Impressive to see this.
Thanks for the update, Arlo.

User avatar
Lebowski
1 GW
1 GW
Posts: 3110
Joined: Jun 28, 2011 1:38 am
Location: beautiful Zurich, Switzerland

Re: Lebowski's motor controller IC, schematic & setup, new v

Post by Lebowski » Jun 30, 2017 8:47 am

Just posted the toggle file for version 2.A0 . The changes:

- in the PWM menu, when you want to use the online L & R measurement, best to play with the pwm frequency until the autocompleted loop sample frequency is (just) below 25 kHz.

- even when you want to use the online R & L, you must run a FOC measurement (for the starting values for the online R and L). New is also that you can manually enter L and R values.

- the hall sensor menu has some new options:

Code: Select all

g) hall offset, forward: 0.00 deg
h) hall offset, reverse: 0.00 deg

0) reset hall statistics
#) display hall statistics
with g and h you can set the hall offset for forward and reverse... but what values to use ? The new transition method used actually knows the phase difference (between hall and sensorless) at the
moment of transition. It can runs statistics on these observed phase differences. Wit option 0) the statistical data gathering is reset. This needs to be (manually) done the first time the hall menu is used, and after every change of the hall offset (g and h). After the chip has seen a number of transitions option # can be used to display the statistics:

Code: Select all

 forward
count: 19
average: 4.07 deg
std-dev: 2.32 deg

 reverse
count: 16
average: -5.80 deg
std-dev: 2.62 deg
what it shows here is that it saw 19 transitions while in forward mode. The average error was 4.07 degrees, with a standard deviation of 2.32 degrees (ain't floating point nice :D ). To bring the average down to 0 it's value must be added to the corresponding offset value. After this the statistics needs to be reset as it will now start seeing a new set of different errors (as the offset was changed).
The standard deviation is a measure for how reliable the offset is. Large standard deviations can occur at high transition erpm under various levels of accelleration, in combination with (analog) delay in the hall sensors or at the input of the controller IC. If the values are large, try to lower the transition erpm and/or reduce the RC combination at the hall input pins.

new in this version is a first attempt at measuring the motor R and L while the motor is in normal use. The setup menu options are:

Code: Select all

a) use online Kv, L and R measurement: yes

 make sure f_sample is below 25kHz !

b) autocomplete
c) #data points for online impedance measurement: 16384
d) reset data collection
e) current data collection, R: 9.9 A
f) current data collection, L: 2.4 A
g) speed data collection: 5.98 k-erpm
h) inject extra current : yes
Options a) turns this new feature on or off, option b autocompletes the menu.

The measurement works by taking lots of measurement points and running statistics (it uses a minimum least square curve fitting method). Measurement points take a long time to process , at full speed it can take around 500 to 1000 point a second. A measurement point is only taken when:
- torque current is larger than option e)
- the 90-degree shifted torque current is larger than option f)
- motor speed is larger than option g)
- it must be in drive 3, but not in fieldweakening
- the data point cannot be too similar to already taken data points (meaning: at constand speed, torque etc it will maybe take 50 points and then wait for speed, torque etc to change)
Since the 90-degree shifted torque current is typically lower than option f) (except when changing throttle position, but even then it is not likely to exceed f), an extra bit of current to help with the measurement can be injected. This is turned on or off with option h). The RMS value for the injected current is as specified under f. The injection of the current should not be noticable. Power use should be negligible.

The amount of data points used for the R&L calculation is specified under c). Lower values make the R&L track faster but introduces more noise and make the values less reliable. The very first time it will take about 2000 point to initialise. After that the L&R as reported in the FOC menu and chip status menu will start changing, reflecting the measured values. Best is to run the motor under varying conditions for a few minutes until the R and L start changing, then press setup for the online save. This saves all the collected data point statistics, meaning next time you power up from cold it will not need to go through the 2000 initialisation points but it will start from the situation when the online save was done.

The status menu now includes the L and R values for debug purposes.

In the save menu, the 'online parameter save; option is no longer turned off automatically. This makes it easier to do hall statistics (which can only be viewed after they have been online-saved by pressing setup in motor mode)

Animalector
10 kW
10 kW
Posts: 791
Joined: Mar 17, 2012 4:50 pm
Location: Mareeba - Queensland

Re: Lebowski's motor controller IC, schematic & setup, new v

Post by Animalector » Jun 30, 2017 4:13 pm

Great work. I love how your making it all smarter and automagic.

Andy

Volttan
1 mW
1 mW
Posts: 13
Joined: Sep 29, 2016 11:44 am
Location: Sokołów Podlaski Poland

Re: Lebowski's motor controller IC, schematic & setup, new v

Post by Volttan » Sep 19, 2017 2:27 pm

Thanks Bas




Altair
100 W
100 W
Posts: 233
Joined: May 03, 2014 10:35 am
Location: Quebec, Canada

Re: Lebowski's motor controller IC, schematic & setup, new v

Post by Altair » Sep 19, 2017 2:41 pm

Smoothness AND power!
Qualities that are usually mutually exclusive with I.C. engined bikes.

User avatar
Arlo1
100 GW
100 GW
Posts: 8492
Joined: Apr 26, 2009 10:36 pm
Location: Nanaimo BC Canada
Contact:

Re: Lebowski's motor controller IC, schematic & setup, new v

Post by Arlo1 » Sep 19, 2017 9:44 pm

Yup Lebowski has done some great work with this little dspic chip. Its helped many in the EV world make some very cool projects come to life!
My Leaf motor controller build. https://endless-sphere.com/forums/viewto ... 27#p963227
My YSR build http://www.youtube.com/watch?v=BRo8r5g4NBg
RC and most types of Lithium batteries you MUST know your individual cell voltages charging and discharging.
Don't keep them were you cant afford smoke or fire!
Never above 4.2v never below 2.7v EVER!!!
HI power controller design. Game Changer

User avatar
Lebowski
1 GW
1 GW
Posts: 3110
Joined: Jun 28, 2011 1:38 am
Location: beautiful Zurich, Switzerland

Re: Lebowski's motor controller IC, schematic & setup, new v

Post by Lebowski » Oct 15, 2017 1:02 pm

new manual for 2.A1 added. See the update file thread for the to

bradleyk
10 mW
10 mW
Posts: 24
Joined: Jul 17, 2014 4:25 am
Location: Brisbane, Australia

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

Post by bradleyk » Nov 21, 2017 3:58 am

Woot, Just ordered two of these. Plan to put them in a smart car with zombies mosfet driver.

I have a question about the CAN bus. Can regen be controlled from the can bus? I couldn't see anything about it in the manual.

User avatar
Lebowski
1 GW
1 GW
Posts: 3110
Joined: Jun 28, 2011 1:38 am
Location: beautiful Zurich, Switzerland

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

Post by Lebowski » Nov 21, 2017 6:12 am

Yes, regen can be controlled via the CAN bus. As with the analog case, the CAN bus shares two throttle values which can independently be configured for power or regen (by choosing the sign of the throttle coefficients, negative for regen).

Post Reply