Nissan Leaf Motor test with DIY controller

Electric cars, trucks, ATVs, NEVs - things bigger than a motorcycle.
MPaulHolmes
10 mW
10 mW
Posts: 24
Joined: Jan 16, 2016 10:42 am

Nissan Leaf Motor test with DIY controller

Post by MPaulHolmes » Jan 26, 2016 5:57 pm

Hello, I finally got my Nissan Leaf motor working with my homemade controller:
https://www.youtube.com/watch?v=qzlLh8xxx1g
I'm just so happy I wanted to share. haha

The software is field oriented control. I can't wait to get this thing in a car.

SlowCo
10 kW
10 kW
Posts: 610
Joined: Jan 05, 2015 5:43 pm
Location: The Netherlands

Re: Nissan Leaf Motor test with DIY controller

Post by SlowCo » Jan 26, 2016 6:12 pm

Congratulations.

Another member on here has a similar project:
https://endless-sphere.com/forums/viewt ... 30&t=63982

okashira
100 kW
100 kW
Posts: 1014
Joined: Nov 17, 2014 6:45 pm
Location: Houston, TX

Re: Nissan Leaf Motor test with DIY controller

Post by okashira » Jan 26, 2016 6:46 pm

MPaulHolmes wrote:Hello, I finally got my Nissan Leaf motor working with my homemade controller:
https://www.youtube.com/watch?v=qzlLh8xxx1g
I'm just so happy I wanted to share. haha

The software is field oriented control. I can't wait to get this thing in a car.
What software? Your own code?
If so, can your code support an IPM motor properly?
"Peace out - I'm done."
-- Bernhard Riemann, 1859

edisonmotors.net
Tesla Model S 18650 cells - like new - and custom packs from Tesla cells for sale. Any shape Any power Any capacity.
PM me or search my threads.

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

Re: Nissan Leaf Motor test with DIY controller

Post by Arlo1 » Jan 26, 2016 6:52 pm

Cool and congrats.
My Leaf motor controller build. viewtopic.php?f=30&t=63982&p=963227#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
http://www.undergroundelectrics.ca/

User avatar
oatnet
100 MW
100 MW
Posts: 2929
Joined: Apr 26, 2007 3:03 pm
Location: SoCal, USA

Re: Nissan Leaf Motor test with DIY controller

Post by oatnet » Jan 26, 2016 8:59 pm

This is great, thanks for sharing!

-JD
Member 117 of 26,000+

153v DUNE BUGGY © 164v Vectrix E-Moto © 72v Norco A-line/x5403 © 60v Specialized Enduro Comp/BMC © 72v x5tracycle © 48v TF IO/BMC © 36v Kepler FrictionDrive © Spot-Welding a123 © Pelican Front Packs © Vectrix Battery Replacement © MORE !!


Image大鸡巴 Motors
Knowledge is acquired through experience, everything else is just information - Albert Einstein
"Cheater?" I'm not competing, I'm Commuting!

User avatar
liveforphysics
100 GW
100 GW
Posts: 14497
Joined: Oct 29, 2008 1:48 am
Location: Santa Cruz, CA, USA

Re: Nissan Leaf Motor test with DIY controller

Post by liveforphysics » Jan 26, 2016 9:38 pm

Nice capacitor choice.

Do you have a design phase current?
Each carcinogen vapor exposure includes a dice roll for cancer.

Each mutagen vapor exposure includes a dice roll for reproductive genetic defects in your children.

Each engine start sprays them into a shared atmosphere which includes beings not offered an opportunity to consent accepting these cancer experiences and defective genetics life experiences.

Every post is a free gift to the collective of minds composing the living bleeding edge of LEV development on our spaceship.

MPaulHolmes
10 mW
10 mW
Posts: 24
Joined: Jan 16, 2016 10:42 am

Re: Nissan Leaf Motor test with DIY controller

Post by MPaulHolmes » Feb 02, 2016 4:19 pm

Ya, it's my own code. I did it from scratch. I was tempted to look at the microchip FOC code, but wanted a personal challenge just by starting with the formulas. I didn't know it was an interior permanent magnet motor until a few days ago. It's not a big deal to modify Id and Iq to account for that. I'll probably do it this weekend. I made a really fast square root based from Andre Lamothe's tricks of the game programming gurus, and is accurate to +/- 0.0001 or so, so it won't take very many extra cycles to do the IPM modification.

I'm hoping for short periods of 400ampRMS per phase with the 600v 600amp powerex IGBTs. I made my own liquid cooling, so hopefully this will be practical. I think it will be OK. I've done a DC controller with an identical power section, and one guy tested his with the peak motor amps set to 515 per IGBT (each IGBT had its own hardware overcurrent protection and desaturation detection and current monitoring. It would of course be about the same for all 3, but I was just being paranoid)
Here's AC the code:
https://github.com/MPaulHolmes/AC-Controller

Here's the instructable:
http://www.instructables.com/id/200kW-A ... ctric-Car/

Just yesterday I finally fixed case where you need the initial index pulse to know the absolute position of the motor. I haven't uploaded the update though. I'll do that tonight I think.

MPaulHolmes
10 mW
10 mW
Posts: 24
Joined: Jan 16, 2016 10:42 am

Re: Nissan Leaf Motor test with DIY controller

Post by MPaulHolmes » Feb 03, 2016 5:47 pm

Here's a test of the controller on an AC induction motor. He has it doing battle against a DC motor. The DC motor spins the AC motor, and then you "regen" to fight against the DC spin. The phase current gets up to 360amp.
https://youtu.be/GR2rcev1Mlo

okashira
100 kW
100 kW
Posts: 1014
Joined: Nov 17, 2014 6:45 pm
Location: Houston, TX

Re: Nissan Leaf Motor test with DIY controller

Post by okashira » Feb 03, 2016 6:27 pm

MPaulHolmes wrote:Here's a test of the controller on an AC induction motor. He has it doing battle against a DC motor. The DC motor spins the AC motor, and then you "regen" to fight against the DC spin. The phase current gets up to 360amp.
https://youtu.be/GR2rcev1Mlo
Did you test your IPM code yet on the Leaf motor? Notice any difference? :)
"Peace out - I'm done."
-- Bernhard Riemann, 1859

edisonmotors.net
Tesla Model S 18650 cells - like new - and custom packs from Tesla cells for sale. Any shape Any power Any capacity.
PM me or search my threads.

MPaulHolmes
10 mW
10 mW
Posts: 24
Joined: Jan 16, 2016 10:42 am

Re: Nissan Leaf Motor test with DIY controller

Post by MPaulHolmes » Feb 03, 2016 7:17 pm

I won't have time to attempt it until the weekend. dang job!

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

Re: Nissan Leaf Motor test with DIY controller

Post by Arlo1 » Feb 03, 2016 8:45 pm

I did get part way with my own code a few years back I am definitely interested in spending more time on the code now.
My Leaf motor controller build. viewtopic.php?f=30&t=63982&p=963227#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
http://www.undergroundelectrics.ca/

Bowser330
1 µW
1 µW
Posts: 4
Joined: Feb 19, 2016 7:23 pm

Re: Nissan Leaf Motor test with DIY controller

Post by Bowser330 » Feb 19, 2016 7:25 pm

Bumping for updates on this 200kw DIY controller & $500 Leaf motor

MPaulHolmes
10 mW
10 mW
Posts: 24
Joined: Jan 16, 2016 10:42 am

Re: Nissan Leaf Motor test with DIY controller

Post by MPaulHolmes » Feb 20, 2016 12:41 am

I'll hopefully get another video tomorrow. The software has been updated quite a bit, and now is a lot smoother when it hits zero. No more sudden jerky stops due to the magnets. I finished a controller and sent it to someone who has a Leaf motor. They are going to put it in a home made dune buggy sort of thing. He's the type that doesn't mind destructive tests, and will probably test some accelerations with the phase current set to around 550 or 600amp peak. It's liquid cooled, so it might not mind that for short periods.

I also finished a couple of the AC boards and sent them today to someone else who has some Tesla motors and battery packs that they are going to experiment with! I'll let him talk about that though if he wants to. I don't want to volunteer too much info.

I also just sent in some new boards including a resolver to encoder board that has a built in pot so you can quickly figure out the specs of an unknown resolver. The car companies are TERRIBLE about telling the necessary information. I couldn't get anything out of the company that makes the resolver for the Leaf. But now all their secrets have been laid bare. haha.

I also just sent in a new AC control/driver board that is (almost) all surface mount and one sided, so assembly will be a TON easier:
http://i419.photobucket.com/albums/pp28 ... roller.png

It also has the resolver to encoder on board so you can do any old motor interface type. I also added CANbus and voltage monitoring and a 2nd temperature monitor and a brake input, so you can regen without having to use the throttle in a wig wag configuration (wig wag: positive throttle is "go forward", negative throttle is regen, or go in reverse when you run out of regen).

SlowCo
10 kW
10 kW
Posts: 610
Joined: Jan 05, 2015 5:43 pm
Location: The Netherlands

Re: Nissan Leaf Motor test with DIY controller

Post by SlowCo » Feb 20, 2016 8:29 am

Bowser330 wrote:Bumping for updates on this 200kw DIY controller & $500 Leaf motor
Then also read about E-S member Arlo's inverter build:

https://endless-sphere.com/forums/viewt ... 30&t=63982
and:
https://endless-sphere.com/forums/viewt ... 30&t=76025

MPaulHolmes
10 mW
10 mW
Posts: 24
Joined: Jan 16, 2016 10:42 am

Re: Nissan Leaf Motor test with DIY controller

Post by MPaulHolmes » Feb 25, 2016 11:29 pm

I just got the field oriented control "interior permanent magnet" correction working with the leaf motor. Basically, with a high "saliency" motor, you use Id = 0, Iq = current magnitude. But for buried magnets, , there's also some of the torque from reluctance torque. I guess that's the stator pulling toward the steel laminations between the magnets (I think that's how it works). At any rate, to get the best torque per amp, you start with a current magnitude, and break it up into Id and Iq, where Id is negative. The formula, found here
at around the 22 minute mark:
https://www.youtube.com/watch?v=bZwLFpXhFbI

But instead of all that crap I think you can just run through all Id from 0 down to -sqrt(currentMagnitude). The goal was to find the best torque for the fixed magnitude. To quantify best torque (because who the heck has a torque measuring thing), I started the motor at 0 rpm, and checked what caused the motor to accelerate until the motor ran out of voltage in the shortest time (so, during that whole time, currentMagnitude was constant).

Then, I tried again with a fixed magnitude of 23amp, and found that the ideal Id was about half of the ideal Id for 12amp. Here's a video:
https://www.youtube.com/watch?v=VTn4fKNVbGc

okashira
100 kW
100 kW
Posts: 1014
Joined: Nov 17, 2014 6:45 pm
Location: Houston, TX

Re: Nissan Leaf Motor test with DIY controller

Post by okashira » Feb 26, 2016 12:48 am

MPaulHolmes wrote:I just got the field oriented control "interior permanent magnet" correction working with the leaf motor. Basically, with a high "saliency" motor, you use Id = 0, Iq = current magnitude. But for buried magnets, , there's also some of the torque from reluctance torque. I guess that's the stator pulling toward the steel laminations between the magnets (I think that's how it works). At any rate, to get the best torque per amp, you start with a current magnitude, and break it up into Id and Iq, where Id is negative. The formula, found here
at around the 22 minute mark:
https://www.youtube.com/watch?v=bZwLFpXhFbI

But instead of all that crap I think you can just run through all Id from 0 down to -sqrt(currentMagnitude). The goal was to find the best torque for the fixed magnitude. To quantify best torque (because who the heck has a torque measuring thing), I started the motor at 0 rpm, and checked what caused the motor to accelerate until the motor ran out of voltage in the shortest time (so, during that whole time, currentMagnitude was constant).

Then, I tried again with a fixed magnitude of 23amp, and found that the ideal Id was about half of the ideal Id for 12amp. Here's a video:
https://www.youtube.com/watch?v=VTn4fKNVbGc
I think the terminology is NO saliency = Id = 0
salieicy (ie IPM) then you have ID |=0

clearly you understand how it works , just poking at your vocabulary :-D
"Peace out - I'm done."
-- Bernhard Riemann, 1859

edisonmotors.net
Tesla Model S 18650 cells - like new - and custom packs from Tesla cells for sale. Any shape Any power Any capacity.
PM me or search my threads.

MPaulHolmes
10 mW
10 mW
Posts: 24
Joined: Jan 16, 2016 10:42 am

Re: Nissan Leaf Motor test with DIY controller

Post by MPaulHolmes » Feb 26, 2016 1:06 am

haha! Oops. It's just that the K is super big when Id = 0, so I thought that meant "super duper saliency". I got a 1.2 gpa in high school, so I missed a lot of the vocabulary. LOL. I guess I could have googled saliency. Another way to look at it is, if I can hold the line and stay consistent with my wrong usage of the word, and it catches on, maybe in 500 years it really will mean what I thought.

Bowser330
1 µW
1 µW
Posts: 4
Joined: Feb 19, 2016 7:23 pm

Re: Nissan Leaf Motor test with DIY controller

Post by Bowser330 » Mar 08, 2016 2:43 am

Any updates Paul? Any feedback from the beta testers? How many Amps can be shoved into the leaf motor?

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

Re: Nissan Leaf Motor test with DIY controller

Post by Arlo1 » Mar 08, 2016 10:00 am

Bowser330 wrote: How many Amps can be shoved into the leaf motor?
Lots.

My measurements show 10 mohm and ~230uH phase to phase.
My Leaf motor controller build. viewtopic.php?f=30&t=63982&p=963227#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
http://www.undergroundelectrics.ca/

okashira
100 kW
100 kW
Posts: 1014
Joined: Nov 17, 2014 6:45 pm
Location: Houston, TX

Re: Nissan Leaf Motor test with DIY controller

Post by okashira » Mar 08, 2016 10:33 am

Arlo1 wrote:
Bowser330 wrote: How many Amps can be shoved into the leaf motor?
Lots.

My measurements show 10 mohm and ~230uH phase to phase.
Did you post 0.0008 H before? That's what I had in my spreadsheet for cap sizing.
"Peace out - I'm done."
-- Bernhard Riemann, 1859

edisonmotors.net
Tesla Model S 18650 cells - like new - and custom packs from Tesla cells for sale. Any shape Any power Any capacity.
PM me or search my threads.

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

Re: Nissan Leaf Motor test with DIY controller

Post by Arlo1 » Mar 08, 2016 11:00 am

okashira wrote:
Arlo1 wrote:
Bowser330 wrote: How many Amps can be shoved into the leaf motor?
Lots.

My measurements show 10 mohm and ~230uH phase to phase.
Did you post 0.0008 H before? That's what I had in my spreadsheet for cap sizing.
Colossus is 8uH the leaf motor is 230-240uH
You might have mixed the 2 up.
Colossus is wound for 50v the leaf motor is wound for 360v
My Leaf motor controller build. viewtopic.php?f=30&t=63982&p=963227#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
http://www.undergroundelectrics.ca/

okashira
100 kW
100 kW
Posts: 1014
Joined: Nov 17, 2014 6:45 pm
Location: Houston, TX

Re: Nissan Leaf Motor test with DIY controller

Post by okashira » Mar 08, 2016 1:15 pm

Damn, you made me go find it.

https://endless-sphere.com/forums/viewt ... ce#p863407

I am sure you posted elsewhere it's 800 uH too
"Peace out - I'm done."
-- Bernhard Riemann, 1859

edisonmotors.net
Tesla Model S 18650 cells - like new - and custom packs from Tesla cells for sale. Any shape Any power Any capacity.
PM me or search my threads.

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

Re: Nissan Leaf Motor test with DIY controller

Post by Arlo1 » Mar 08, 2016 1:20 pm

okashira wrote:Damn, you made me go find it.

https://endless-sphere.com/forums/viewt ... ce#p863407

I am sure you posted elsewhere it's 800 uH too
Sorry post corrected. That was a bad measurement with the rusty phase wires attached that go to the inverter.

Look at the motor data spread sheet from miles. https://endless-sphere.com/forums/viewt ... 30&t=65757

I keep all info I can updated there.
My Leaf motor controller build. viewtopic.php?f=30&t=63982&p=963227#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
http://www.undergroundelectrics.ca/

okashira
100 kW
100 kW
Posts: 1014
Joined: Nov 17, 2014 6:45 pm
Location: Houston, TX

Re: Nissan Leaf Motor test with DIY controller

Post by okashira » Mar 08, 2016 1:23 pm

Arlo1 wrote:
okashira wrote:Damn, you made me go find it.

https://endless-sphere.com/forums/viewt ... ce#p863407

I am sure you posted elsewhere it's 800 uH too
Sorry post corrected. That was a bad measurement with the rusty phase wires attached that go to the inverter.

Look at the motor data spread sheet from miles. https://endless-sphere.com/forums/viewt ... 30&t=65757

I keep all info I can updated there.
Cool, thanks.
I need to get measuring the spark ev motor. I am afraid how low it might be
"Peace out - I'm done."
-- Bernhard Riemann, 1859

edisonmotors.net
Tesla Model S 18650 cells - like new - and custom packs from Tesla cells for sale. Any shape Any power Any capacity.
PM me or search my threads.

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

Re: Nissan Leaf Motor test with DIY controller

Post by Arlo1 » Mar 08, 2016 1:57 pm

okashira wrote:
Cool, thanks.
I need to get measuring the spark ev motor. I am afraid how low it might be
What voltage does it run?

I would not worry :)
My Leaf motor controller build. viewtopic.php?f=30&t=63982&p=963227#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
http://www.undergroundelectrics.ca/

Post Reply