Page 37 of 40

Re: IPM Motor Simulation and FOC Software

Posted: Sun Feb 12, 2023 3:37 pm
by Pete9008
Following some problems identified by Zieg a bug in the simulator has come to light (well not quite the simulator, more the configuration of the simulator).

Essentially if the motor current goes above around 435A using the standard param_prj.h the simulator correctly models ADC saturation :(

This causes all sorts of apparent stability issues as the software tries to cope with the bad readings.

Essentially this is simulating the behaviour of the inverter correctly but the default file is for a Prius inverter which has a lower range on the CTs, not normally a problem on the Prius but if the same file is used on a Leaf setup without revisions you get adc saturation and stability problems.

To fix change the lines in the param_prj.h file (the one in the same directory as the IPMMotorSim.pro file) from

Code: Select all

    PARAM_ENTRY(CAT_INVERTER,il1gain,     "dig/A",   -100,   100,    4.7,    27  ) \
    PARAM_ENTRY(CAT_INVERTER,il2gain,     "dig/A",   -100,   100,    4.7,    28  ) \
to

Code: Select all

    PARAM_ENTRY(CAT_INVERTER,il1gain,     "dig/A",   -100,   100,    1,    27  ) \
    PARAM_ENTRY(CAT_INVERTER,il2gain,     "dig/A",   -100,   100,    1,    28  ) \
and rebuild the project. This should fix it in the simulator.

I'll update the default file on github to fix this. Edit - done

Sorry about this, virtually all my testing has been at around 300A motor currents :oops:

As an aside, anyone who is using a Prius inverter in real life and pushing the currents up (@Bigpie) may be seeing this effect in real life too unless they have modified the logic board to change the current input scaling factor!

Edit - It would be better to set these values to match those in your actual install, that way the simulator will accurately reproduce adc saturation at the same point that will happen in real life in the car.

Re: IPM Motor Simulation and FOC Software

Posted: Tue Feb 14, 2023 8:40 am
by johnspark
Hi all, I am trying to build the software, so far I have these screens:
image.png
image.png
just wondering what I am doing wrong,

Kind regards,

johnspark

Re: IPM Motor Simulation and FOC Software

Posted: Tue Feb 14, 2023 9:20 am
by Pete9008
You should just need to open the project (.pro) file. It looks like you may be trying to import the project which is normally only used for non qt projects.

Edit - sorry, misinterpreted the above, it looks like it is kit that is missing. Qt should have set up a default kit that suited your computer when it was installed and it should just pick that up and use it when you first open the project. When you look at the available kits (manage kits button) what are the options shown?

Re: IPM Motor Simulation and FOC Software

Posted: Tue Feb 14, 2023 10:53 am
by johnspark
Thank you Pete9008,

so I managed to find a kits page and got this:
image.png
wondering what to do next,

Kind regards,

johnspark

Re: IPM Motor Simulation and FOC Software

Posted: Tue Feb 14, 2023 11:13 am
by Pete9008
Yep, no valid kits. Looks like you might be missing the toolchain, see if this helps? https://forum.qt.io/topic/109793/no-s ... ve-this

Not sure what's happened there, the qt install always used to include it all by default. If going into the management tool it is also worth checking that qtcharts are included (there is another post about that somewhere above).

I need to do a clean install sometime to check the install instructions are right but don't have a suitable machine at the moment.

Re: IPM Motor Simulation and FOC Software

Posted: Tue Feb 14, 2023 3:08 pm
by Zieg
Pete9008 wrote: Tue Feb 14, 2023 11:13 am

I need to do a clean install sometime to check the install instructions are right but don't have a suitable machine at the moment.
Having just gone through it the other day, I can say I believe the instructions are generally right, but the module selection (including charts) might need a bit of a tweak. Perhaps I could try to make myself useful and propose a revision to the instructions? I can do a clean install with another computer so as not to impact what I've already done on my primary machine. Will take a shot at it later today.

Re: IPM Motor Simulation and FOC Software

Posted: Tue Feb 14, 2023 3:17 pm
by Pete9008
Thanks, that would be great :)

If you could capture a screen shot or two they could be added to the wiki instructions too (your forum login should work there, or if you're not happy doing that post them here and I can copy them over) ?

Btw - I would suggest disabling Android support (unless you need it for anything else), it really bloats the install!

Re: IPM Motor Simulation and FOC Software

Posted: Tue Feb 14, 2023 9:03 pm
by johnspark
So here is the next screen, (I guess the screens I find can be added to the how to instructions later on):


kind regards,

johnspark
image.png

Re: IPM Motor Simulation and FOC Software

Posted: Tue Feb 14, 2023 9:11 pm
by Pete9008
I think you need to expand the Qt section at the bottom first.

Edit - I tend to go for the Long Term Support (LTS) rather than the latest version too but it's not critical, just personal preference.

Re: IPM Motor Simulation and FOC Software

Posted: Tue Feb 14, 2023 9:27 pm
by Zieg
I've got a bunch of screenshots taken over the last couple hours, just need to figure out how to format them right. I've done trial and error on several install methods and so far the best approach is actually to add charts after the fact.

Re: IPM Motor Simulation and FOC Software

Posted: Tue Feb 14, 2023 9:32 pm
by Pete9008
Fantastic! Just been doing a little digging and found this https://forum.qt.io/topic/127564/qt ... enance/16 , seems there are two places charts are listed in the maintenance tool and the one within the Qt tree is the one to go with. Does that agree with what you found?

Re: IPM Motor Simulation and FOC Software

Posted: Tue Feb 14, 2023 9:35 pm
by Zieg
Yeah, it does. I made some edits to the wiki but when I tried to add the pictures I couldn't get them placed properly before having to get up to take care of baby. I'll post them here once I'm back at my PC so they can be evaluated, and possibly copied over by someone who knows what they're doing :)

Re: IPM Motor Simulation and FOC Software

Posted: Tue Feb 14, 2023 9:39 pm
by Pete9008
That rules me out then ;) That wiki post is the only one I've ever done (and it still bugs me that I couldn't get the formatting to look right in the table of contents!)

Seen your changes, all looks good. If you want to stick any captures here I'll have a go at copying them over tomorrow (although I doubt I'll be able to do any better).

Thanks!

Edit - I seem to remember the trick with images was to turn off float over text or wrap round text (can't remember exact phrase) which defaults back to on each time an image is added. With it turned off the images stay where you put them.

Re: IPM Motor Simulation and FOC Software

Posted: Tue Feb 14, 2023 10:34 pm
by Zieg
Aha, thank you! That did the trick. I've uploaded four of what I think are the most helpful screengrabs (one of which just shows the git commandline in case people aren't familiar with how that looks).

Adding charts after the fact via the maintenance tool doesn't feel like the most streamlined approach , but of all the installation methods I tried , it did result in the smallest footprint.

Re: IPM Motor Simulation and FOC Software

Posted: Tue Feb 14, 2023 10:38 pm
by Pete9008
That's much better, thank you.

What size did you get the install down to, how much difference did it make?

Edit - will need to go in and tweak it myself tomorrow too, while looking at your changes I spotted half a dozen typos in my bit :oops:

Re: IPM Motor Simulation and FOC Software

Posted: Tue Feb 14, 2023 11:10 pm
by Zieg
Still >3Gb unfortunately. Some attempts were >4Gb. If there's a more compact way to achieve this I'd definitely like to know!

Re: IPM Motor Simulation and FOC Software

Posted: Wed Feb 15, 2023 10:37 am
by Pete9008
3GB doesn't sound too bad, see https://openinverter.org/forum/view ... 1#p49245 , 215G for a full install!

I'm sure you could get it down a bit more by going down the custom install route but there is too much chance of breaking something. Your method gives 95% of the benefits while keeping a nice simple install, so thanks for taking the time to work out the best combination :)

Edit - think you've done well to keep it down to 3G, just checked and both my installs and they're nearer 8GB. I quite like Qt but it does seem to take up a lot of space!

Re: IPM Motor Simulation and FOC Software

Posted: Sat Feb 18, 2023 2:38 am
by johnspark
So I have now added QT charts:
image.png
Thank you Pete (and also for LTS)

I have this for kits:
image.png
and this for build:
image.png
image.png (5.24 KiB) Viewed 19811 times
sorry guys, I looked at wiki but could not find instructions for QT.


Kind regards,

Johnspark

Re: IPM Motor Simulation and FOC Software

Posted: Sat Feb 18, 2023 4:17 am
by Zieg
Hm, it says 5.15 there.. does that match the version of Qt you have installed?

Re: IPM Motor Simulation and FOC Software

Posted: Sat Feb 18, 2023 3:33 pm
by Pete9008
Sorry, I probably confused things by mentioning LTS.

Zieg is correct in that the version of charts installed needs to match the version of the rest of the install. Given the missing kits it's probably worth uninstalling and doing a clean install from scratch. The instructions (complete with Zieg's install guide and screenshots) are here https://openinverter.org/wiki/IPM_Motor_Simulator

Re: IPM Motor Simulation and FOC Software

Posted: Wed Feb 22, 2023 3:30 pm
by Pete9008
Ev8 wrote: Sat Oct 29, 2022 7:05 pm Ok I dug out some spare motor parts, only tested with stationary rotor in one position but these are Lexus rx400h transaxle

Mg2
image.png
image.png (234.66 KiB) Viewed 19348 times
@Ev8 - any idea what the size and weight of MG2 is?

Re: IPM Motor Simulation and FOC Software

Posted: Wed Feb 22, 2023 8:54 pm
by Ev8
Will weigh that spare rotor and stator tomorrow

Re: IPM Motor Simulation and FOC Software

Posted: Thu Feb 23, 2023 11:31 am
by Ev8
Okay rotor diameter 160mm 80mm deep 10.1kg
Stator approx 270 od to outside of lamination’s x 71mm 20.9kg

Re: IPM Motor Simulation and FOC Software

Posted: Thu Feb 23, 2023 11:35 am
by Pete9008
Ev8 wrote: Thu Feb 23, 2023 11:31 am Okay rotor diameter 160mm 80mm deep 10.1kg
Stator approx 270 od to outside of lamination’s x 71mm 20.9kg
Fantastic information, thank you!

That actually looks like a possibility for what I'm thinking about (viewtopic.php?p=53431#p53431) :)

What torque do you think you make from it and do you believe the simulator results you get for it match the real world?

Re: IPM Motor Simulation and FOC Software

Posted: Thu Feb 23, 2023 12:18 pm
by Ev8
Not sure on how the torque compares to real life as wasn’t sure how the gear parameter in the sim actually works, but yes it’s plenty torquey, can spin the wheels in 3rd gear on an approx 14-1500kg car, obviously mg1 is in their helping also but the sim doesn’t credit it with much torque and i say that matches reality