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 »

Has it still got the gearbox on it? If so it's likely to need a fair bit more current (in simulation it needed 50A-100A to get reasonable accuracy when driving a load).

Forgot to say - thanks for trying the test code!
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 »

no. I disassembled the part where the gearbox is. there's just the motor and that's it. I also have the ability to slowly rotate the motor with my hands.

So what is the correct order of my actions for testing?

thank you for your contribution to the software of this project))
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: Wed May 31, 2023 1:29 pm So what is the correct order of my actions for testing?
The steps to go though are detailed earlier in the thread starting from here viewtopic.php?p=56416#p56416

Let me know where your results start to differ from mine.

It's always possible that I've done something silly in the code and it isn't even going into manual mode properly in the F103 version??
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 »

it's just described everywhere that the motor will rotate slowly. this is what I expected, not paying attention to whether the system writes any messages. it definitely switches to the startup mode, since when any ID current is indicated, the sound of pwm operation appears. a little later I will return home and continue these experiments
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 »

The resolver mode shouldn't start any PWM but just allows the motor angle to be monitored/plotted while turning the motor manually. It's just there to allow the operation of the resolver/encode/sin cos chip to be verified before any volts are applied to the motor.

The phase check mode briefly enables PWM but just uses it drive a fixed test voltage pattern onto the motor phases (not enough to move the motor). It watches what the currents do and then returns a message to the web interface to indicate whether the CT connections are correct or not.

Of the 4 modes only the two test spin modes (forward and bidir) will actually try to turn the motor and should only be run once you know the CT connections are right.
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 »

in general, either I'm not doing it right, or it doesn't work. I reached 50 amrer manual id current, the motor did not move, only squeaked louder. at the same time, the battery current has increased to 4 amps, and the motor current can be seen in the screenshot. after each new value, only the message "set ok" appeared, but none of those messages that should indicate the correctness of the connections. in the rotation check mode, the motor also does not rotate. if I add the position of the throttle stick at any moment, then the motor starts to rotate as usual. at the same time, the system does not issue any messages.
Screenshot_20230531-185026.png
Screenshot_20230531-185011.png
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 »

do not pay attention to the manual start "off", it always appears after clicking the "update" button at the top of the settings to display the real values. in fact, the inverter is started in manual mode, this can be seen by the status and current on each of the sensors.
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: Wed May 31, 2023 2:31 pm The resolver mode shouldn't start any PWM but just allows the motor angle to be monitored/plotted while turning the motor manually. It's just there to allow the operation of the resolver/encode/sin cos chip to be verified before any volts are applied to the motor.

The phase check mode briefly enables PWM but just uses it drive a fixed test voltage pattern onto the motor phases (not enough to move the motor). It watches what the currents do and then returns a message to the web interface to indicate whether the CT connections are correct or not.

Of the 4 modes only the two test spin modes (forward and bidir) will actually try to turn the motor and should only be run once you know the CT connections are right.
this clarifies a lot. I'll check it again now. I didn't know that I needed to run a graph of the angle position. however, it is worth noting that since my angle settings are approximately correct (the motor is working normally), but in the "forward rotation" option, it still stood in place from 50 amps.
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 »

so. I realized my mistake. I started the inverter in manual mode in the usual NEW way, which Johu added instead of the old one that was not working. and it was necessary to launch the OLD version with the button at the top. However, there was no rotation in any of the modes, although in the bidir mode the motor oscillated back and forth. However, I did not figure out how to get graphs by phases and sine/cosine of the chip.
Screenshot_20230531-191410_1.png
here is such a strange answer I received in the phase check mode at a current of manual id = 20 amperes
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 »

Screenshot_20230531-192606_1.png
Screenshot_20230531-192530_1.png
Screenshot_20230531-192438_1.png
I got progress!
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 »

the first test is for 50 amps. he slightly shifted the position of the rotor and subsequent tests already showed the phases differently. Question: depending on the position of the rotor, the phase test gives different values, how do I know that the phases are connected correctly or incorrectly?
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 »

The phase check test doesn't use manual id at all so it shouldn't make any difference. I think it's the rotor position that makes the difference (changes the magnitude of the individual phase currents a little)

Looks like I may need to adjust some of the thresholds in the code, just need to figure out which :?

Edit - actually your last test gave the pattern for correct CT phasing, the inductance is believable too :) Just need to work out what thresholds are needed to get repeatable results.

Edit2 - Might be worth manually adjusting the rotor position and rerunning the test a few times to get an idea as to how often you get the correct ^vv v^v vv^ sequence
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 »

I have turned the rotor again and now it is no longer possible to run the phase check with any current. there is always an overload message. in normal mode, the motor still works adequately.
Attachments
Screenshot_20230531-194910_1.png
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: Wed May 31, 2023 4:54 pm
Edit2 - Might be worth manually adjusting the rotor position and rerunning the test a few times to get an idea as to how often you get the correct ^vv v^v vv^ sequence
I will definitely check by rotating the motor step by step.
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 »

Looks like the thresholds that work on the HSG motor I have here are a bit marginal on yours. I may need to add some more debug/monitoring code to work out what's going on, or add more parameters to allow some adjustment.
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 »

I must have broken everything. after trying to start the rotation mode, I always get an overcurrent message when trying to check the phases. even restarting the controller did not give a result. I scrolled the motor through the steps of the entire revolution and always when checking the phases with any current id, I receive an overload message. in normal mode, the motor still works adequately.
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 »

Udc is reading right isn't it? If it's reading low then it could cause that problem.
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: Wed May 31, 2023 5:16 pm Udc is reading right isn't it? If it's reading low then it could cause that problem.

reading voltage with an accuracy of 0.3 volts! the current sensors are also calibrated
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 »

Thought it would be but worth checking.

I've probably been a bit too cautious with the current trip level (think it was set to 25A). I'll make if configurable via a parameter (and probably a couple of other thresholds too). Afraid it won't be till tomorrow now though.

Can't think why it won't spin the motor though, when I'm making the above changes I'll have another look through the code changes to see whether something got messed up when porting it back to fixed point arithmetic.
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 »

along with the overcurrent, I get a wandering error LORESAMP, probably my chip does not fit into the settings. I will try to connect the native resolver later
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 »

Updated files now on github.

I found one bug which may explain some of the variable results. If you tried to spin the motor before running a phase check it would fail, now fixed. Have also improved the way some of the maths was done to make it more insensitive to motor inductance.

There are now 4 parameters that can be adjusted (hopefully not needed though):
maxtestud : (should default to 10V) this is the maximum voltage that will be applied to the motor during the test. If using on a very high inductance motor (>3mH) it may need increasing.
mintesti : (should default to 15A) - the code will ramp up the motor volts until this current is seen on the motor, it will then continue to use that voltage for the remaining tests. If the current is not high enough by the time maxtestud is reached a low current error will be returned. If you repeatedly get 0's reported in the phase check result it might be worth winding this up a little.
maxtesti : (should default to 40A) - if the motor current, on any phase, exceeds this at any point the test will be terminated and an over current error will be returned. If you repeatedly get the over current error and you are happy to drive a bit more current into the motor during the test then wind this up a bit.
testdetlev ; (should default to 200) - this is the minimum level at which a v or ^ is reported. At levels less than this a 0 is reported. Shouldn't need altering, just there to see whether it can be increased a bit on real motors (seemed to need to set it lower than expected in simulation).

Just to clarify on the spin tests. They should both spin the motor VERY slowly at a fixed speed (throttle should have no effect). They are just there to set up syncofs and the speed needs to be slow enough to allow the web plot to give good resolution (higher speeds will also cause greater angle lag which would reduce syncofs accuracy). The idea is that you use this to set up syncofs and once that's done then use run mode to do a more normal test spin with throttle control.

The bidirectional test will only spin the motor by ONE ELECTRICAL revolution. On a 4 pole pair motor this will only be 90degrees.
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 »

Now I'm on a business trip abroad. almost two thousand km. only on my return will I be able to check the updated code. maybe someone else will test during this time
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 »

No problem, thanks for trying it yesterday. Have a good trip!
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 »

in general, something broke in the new firmware version. at first I had the newest 5.27 foc and everything worked and I also saw all the parameters. then I downloaded your "corrected" one and as soon as I clicked refresh at the top of the page, absolutely all the fields disappeared with the parameter. the behavior was like that of a WiFi module not connected to the controller. to make sure of the real firmware problem, I installed 5.27 again and all the settings fields immediately appeared!
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 »

Not sure what's going on there. My guess is that this may be to do with the changes Johannes has made to the parameter formats in 5.27 and that while it's possible to go forward to the new format there are issues if you try to go back.

What happens if you put the standard 5.24r build on now, does that do the same thing?
Post Reply