IPM Motor - Auto-setup

Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: IPM Motor - Auto-setup

Post by Pete9008 »

Romale wrote: Tue Jun 06, 2023 7:01 pm I ran all the recent tests in the old way with the button at the very top of the interface
Could you post your latest JSON parameter file?

Edit - Also are you still getting the ERR_LORESAMP error reported? If so the sin/cos setup may need adjusting. Noticed a comment in the code

Code: Select all

else //SINCOS
   {
      //Offset assumed 3.3V/2 - 2048
      //on my hardware, min is 0.465V, max is 2.510v, so offset is 1.4875v, or 1846
      //this should be a parameter?
      adc_set_injected_offset(ADC1, 2, sincosoffs);
      adc_set_injected_offset(ADC1, 3, sincosoffs);
   }
The fixed sincosoffs may be wrong for your hardware - worth checking? If it is wrong let me know and I'll add a parameter so that it can be adjusted.
User avatar
Romale
Posts: 441
Joined: Fri May 20, 2022 4:16 pm
Location: Romania
Has thanked: 204 times
Been thanked: 45 times

Re: IPM Motor - Auto-setup

Post by Romale »

Pete9008 wrote: Tue Jun 06, 2023 7:18 pm Could you post your latest JSON parameter file?
I've done this a few posts before
evil neodymium :twisted:
User avatar
Romale
Posts: 441
Joined: Fri May 20, 2022 4:16 pm
Location: Romania
Has thanked: 204 times
Been thanked: 45 times

Re: IPM Motor - Auto-setup

Post by Romale »

Pete9008 wrote: Tue Jun 06, 2023 7:18 pm Also are you still getting the ERR_LORESAMP error reported?
The fixed sincosoffs may be wrong for your hardware - worth checking? If it is wrong let me know and I'll add a parameter so that it can be adjusted.
yes. my sincosoffs are not equal to the ones that are by default. after all, I have a chip and not a resolver, and there is a different value of the upper and lower thresholds of the sine wave
evil neodymium :twisted:
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: IPM Motor - Auto-setup

Post by Pete9008 »

Romale wrote: Tue Jun 06, 2023 7:48 pm I've done this a few posts before
Found it, all looks fine.

Can't think of anything else to try at the moment but will let you know if I do.
User avatar
Bigpie
Posts: 1585
Joined: Wed Apr 10, 2019 8:11 pm
Location: South Yorkshire, UK
Has thanked: 74 times
Been thanked: 299 times

Re: IPM Motor - Auto-setup

Post by Bigpie »

Screenshot 2023-06-15 at 7.32.11 pm.png
Resolver Check working for me in auto tune. Turns out, it helps to set the inverter to use a resolver.

Will hook up some some voltage next
VW Beetle 2003
Outlander front generator
Prius Gen 3 inverter (EVBMW logic board)
Outlander charger
3x Golf GTE batteries
Chademo Charging
Outlander water heater
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: IPM Motor - Auto-setup

Post by Pete9008 »

Bigpie wrote: Thu Jun 15, 2023 6:35 pm Resolver Check working for me in auto tune.
That's great! :D
Bigpie wrote: Thu Jun 15, 2023 6:35 pm Will hook up some some voltage next
Look forward to hearing how you get on (let me know if there is anything I can do to help).
User avatar
Bigpie
Posts: 1585
Joined: Wed Apr 10, 2019 8:11 pm
Location: South Yorkshire, UK
Has thanked: 74 times
Been thanked: 299 times

Re: IPM Motor - Auto-setup

Post by Bigpie »

Pretty sure I've got a dead inverter, not getting any output, with known working firmware, though getting PWM at the transistors. Bought another so will test when that arrives in a few days.
VW Beetle 2003
Outlander front generator
Prius Gen 3 inverter (EVBMW logic board)
Outlander charger
3x Golf GTE batteries
Chademo Charging
Outlander water heater
User avatar
Ev8
Posts: 801
Joined: Sat Jan 30, 2021 11:05 am
Has thanked: 41 times
Been thanked: 149 times

Re: IPM Motor - Auto-setup

Post by Ev8 »

A little late to the party i know, just got round to trying this out and fall at the first hurdle, manual run doesn’t engage any contactors so even though bus voltage is nice and high because it was pre charged at inverter startup the second you select a test mode and engage manual run rather than engage the main contactor then test it tries to test and throws error messages
User avatar
Ev8
Posts: 801
Joined: Sat Jan 30, 2021 11:05 am
Has thanked: 41 times
Been thanked: 149 times

Re: IPM Motor - Auto-setup

Post by Ev8 »

:Original manual run mode never used to engage the main contactor either if I remember, I always had to bypass it with a jump lead! Unfortunately that contactor is no longer so easy to access!
User avatar
Bigpie
Posts: 1585
Joined: Wed Apr 10, 2019 8:11 pm
Location: South Yorkshire, UK
Has thanked: 74 times
Been thanked: 299 times

Re: IPM Motor - Auto-setup

Post by Bigpie »

if you start normally, then go to manual mode, that used to work
VW Beetle 2003
Outlander front generator
Prius Gen 3 inverter (EVBMW logic board)
Outlander charger
3x Golf GTE batteries
Chademo Charging
Outlander water heater
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: IPM Motor - Auto-setup

Post by Pete9008 »

You're right, there appears to be no way to get the contactors to close in manual mode, sorry about that! I've just got leds on my test rig and hadn't noticed what they were doing in manual mode.

I'll have a look through the code to see what the options are, probably add a new command, but afraid it probably won't be till the weekend :(
User avatar
Ev8
Posts: 801
Joined: Sat Jan 30, 2021 11:05 am
Has thanked: 41 times
Been thanked: 149 times

Re: IPM Motor - Auto-setup

Post by Ev8 »

Bigpie wrote: Thu Jul 13, 2023 11:02 am if you start normally, then go to manual mode, that used to work
That used to work because if left the precharge relay on so you had to be careful about drawing much current as it would all be through the precharge resistor hence me bridging with a jump lead,

I did try all combinations of trying to go from run mode to manual I didn’t find anything that helped
User avatar
Ev8
Posts: 801
Joined: Sat Jan 30, 2021 11:05 am
Has thanked: 41 times
Been thanked: 149 times

Re: IPM Motor - Auto-setup

Post by Ev8 »

Pete9008 wrote: Thu Jul 13, 2023 11:32 am You're right, there appears to be no way to get the contactors to close in manual mode, sorry about that! I've just got leds on my test rig and hadn't noticed what they were doing in manual mode.

I'll have a look through the code to see what the options are, probably add a new command, but afraid it probably won't be till the weekend :(
No problem, sorry it took me so long to getting round to trying it out!
RetroZero
Posts: 702
Joined: Tue Oct 29, 2019 2:48 pm
Location: France
Has thanked: 311 times
Been thanked: 38 times
Contact:

Re: IPM Motor - Auto-setup

Post by RetroZero »

Good this has come up in the thread. On one side, it's good that in manual run the precharge acts like a fuse (been there, blown it) . On the other, when trying to find syncoffs and you hone in on the point of 0 offset (Max amps) in manual run, a jumper cable has to be used. So in the world of "I wish for all the bells and whistles", is there a way to add a submenu in manual run to allow for contactors to close AND have a drop down menu allowing for max amp setting??
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: IPM Motor - Auto-setup

Post by Pete9008 »

RetroZero wrote: Fri Jul 14, 2023 8:24 am Good this has come up in the thread. On one side, it's good that in manual run the precharge acts like a fuse (been there, blown it) . On the other, when trying to find syncoffs and you hone in on the point of 0 offset (Max amps) in manual run, a jumper cable has to be used. So in the world of "I wish for all the bells and whistles", is there a way to add a submenu in manual run to allow for contactors to close AND have a drop down menu allowing for max amp setting??
A current limit is already there in the test mode, if the current on any phase exceeds the value of the maxtesti parameter then the test is aborted and the PWM is shutdown. :)

@Bigpie - not sure whether it helps at all but I've now almost got all the dev software setup on a laptop (soo much easier with an up to date version of Linux, all the stuff that caused problems last time with the gcc, openocd and codeblocks installs just works now!) so could potentially call over sometime and help debug it?

Not had a look at the contactor stuff yet but hope to over the weekend.
User avatar
Bigpie
Posts: 1585
Joined: Wed Apr 10, 2019 8:11 pm
Location: South Yorkshire, UK
Has thanked: 74 times
Been thanked: 299 times

Re: IPM Motor - Auto-setup

Post by Bigpie »

You're welcome to call over any time you're free. Not had chance to get back to it yet, maybe this weekend, I'll adjust the gain to get the correct voltage.
VW Beetle 2003
Outlander front generator
Prius Gen 3 inverter (EVBMW logic board)
Outlander charger
3x Golf GTE batteries
Chademo Charging
Outlander water heater
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: IPM Motor - Auto-setup

Post by Pete9008 »

Makes sense, see how you get on with the udc mod first. If it looks like the auto setup code still needs work we can sort something out then.
User avatar
Bigpie
Posts: 1585
Joined: Wed Apr 10, 2019 8:11 pm
Location: South Yorkshire, UK
Has thanked: 74 times
Been thanked: 299 times

Re: IPM Motor - Auto-setup

Post by Bigpie »

Screenshot 2023-07-14 at 2.47.31 pm.png
Motor doesn't spin in forward test mode though.
Screenshot 2023-07-14 at 2.49.16 pm.png
VW Beetle 2003
Outlander front generator
Prius Gen 3 inverter (EVBMW logic board)
Outlander charger
3x Golf GTE batteries
Chademo Charging
Outlander water heater
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: IPM Motor - Auto-setup

Post by Pete9008 »

:D

Try giving it a bit of positive manualid, say 10-20A?

Edit - that was quick, thought you might get to it over the weekend!
User avatar
Bigpie
Posts: 1585
Joined: Wed Apr 10, 2019 8:11 pm
Location: South Yorkshire, UK
Has thanked: 74 times
Been thanked: 299 times

Re: IPM Motor - Auto-setup

Post by Bigpie »

While in forward test?

I got a bit curious and took a break from work
VW Beetle 2003
Outlander front generator
Prius Gen 3 inverter (EVBMW logic board)
Outlander charger
3x Golf GTE batteries
Chademo Charging
Outlander water heater
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: IPM Motor - Auto-setup

Post by Pete9008 »

Yep, the manualid value is used in both the forward and bidir tests (seemed the simplest way to allow it to be adjusted to suit the motor, a free motor should be happy with fairly low current but if there is a gearbox on it it will need a lot more to cope with the extra drag).
Bigpie wrote: Fri Jul 14, 2023 2:04 pm I got a bit curious
You and me both!
User avatar
Bigpie
Posts: 1585
Joined: Wed Apr 10, 2019 8:11 pm
Location: South Yorkshire, UK
Has thanked: 74 times
Been thanked: 299 times

Re: IPM Motor - Auto-setup

Post by Bigpie »


Works, ish, but is jerky. Am I supposed to get the offset output?
VW Beetle 2003
Outlander front generator
Prius Gen 3 inverter (EVBMW logic board)
Outlander charger
3x Golf GTE batteries
Chademo Charging
Outlander water heater
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: IPM Motor - Auto-setup

Post by Pete9008 »

Looking good, that's pretty much exactly what I'd expect :D

Afraid at the moment the actual process for working out syncofs is still manual, see viewtopic.php?p=56418#p56418. It should be possible to automate it in the future if it gives a good enough results though.

It will be a bit jerky, particularly at lower currents, as it's just running on id so will be very susceptible to cogging. Worth plotting the two angles and seeing if it improves at higher currents. With the HSG 20A was plenty, on your motor you might benefit from a bit more.

Once again, thanks for giving it a try :)

Edit - Actually thinking about it it should be fairly simple to calculate it. When I have a look at the contactor stuff I'll add another spot value, syncerror, that is updated when running the bidir test and contains the calculated syncofs error.
User avatar
Bigpie
Posts: 1585
Joined: Wed Apr 10, 2019 8:11 pm
Location: South Yorkshire, UK
Has thanked: 74 times
Been thanked: 299 times

Re: IPM Motor - Auto-setup

Post by Bigpie »

This is cool, thanks by the way.

My testangle doesn't seem to be working
Screenshot 2023-07-14 at 6.52.59 pm.png
Screenshot 2023-07-14 at 6.54.06 pm.png
Also, my UDC gain sometimes needs to be 6.15 (roughly what id expect), some times 24. only change is powering off and back on :s
VW Beetle 2003
Outlander front generator
Prius Gen 3 inverter (EVBMW logic board)
Outlander charger
3x Golf GTE batteries
Chademo Charging
Outlander water heater
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: IPM Motor - Auto-setup

Post by Pete9008 »

Am I reading that right, testangle looks fine, its angle from the resolver that doesn't seem to be working?

Is the 2nd plot in bidir mode?

Might be worth playing with the burst lengths to see if you can get rid of some of the steps in the plot?

Edit - udc sounds like a software rather than hardware issue but not sure what it could be, do all the other analogue inputs work?
Post Reply