2022-01-12 06:29 AM
Hi, I am currently developing position control using MCSDK and have stumbled upon a problem I cannot fix. Whenever the motor is positioned at some specific points it is not possible to start it up without it spinning out of control. I'm using a
What I have found is that whenever Com U = low, Com V = high and Com W = low the motor starts to spin very fast in one direction, and do not stop. Meaning if I restart the program while the motor have these signals, it is inevitable. Often the motor stand still for a second (no movement at all) before going berserk.. At some of these points it can recover and move away before losing control if there is no load, but seems to fail if I give it even a little resistance.
Has anyone encountered a similar problem?
2022-01-12 06:52 AM
Hello @RBrec.1 ,
Could you test first the MCSDK with speed mode in order to be sure that your motor is correctly connected. From what you describe, it sounds like your phases are not properly connected. Be careful that in sensor mode, phase order does matter. Encoder signals connection order is also important.
Only once you are able to properly control your motor in speed mode, you can try to generate your project for positioning control. Do not forget to load the positioning control UI from the pilot to have access to the positioning control command.
Regards
Cedric
2022-01-12 08:00 AM
Hi @cedric H, thank you for reply
I have changed to speed control and implemented a simple ramp up/down test. I have also tried every combination of the three motor phases with both configurations of the two encoder signals. The only difference seems to be the change in direction if the correct combination of the encoder is used (it doesnt spin at all if the wrong combination is used), and that the points where the motor spins out of control changes. E.g. U = low, V = high, W = low, but nevertheless, it still do not work. Any other suggestions? At this point I believe the problem is more in general, considering that it fails for both speed and position.
Best regards
2022-01-12 08:36 AM
Could you provide the version of the MCSDK you are using ?
Did you try to profile your motor with the profiler tool ?
Cedric
2022-01-12 09:01 AM
@cedric H
I am using version 5.Y.3 (5.5.3?). The motor was profiled using the software. I also removed C3, C5 and C7, as well as R181 from the IHM08 board as sugggested in the user manual and info window for the profiler.
Best regards
2022-01-12 11:28 PM
I'm sorry, version 5.Y.2 is the one I'm using.
2022-01-13 01:58 AM
@cedric H
To maybe complement the problem I can explain more in detail. Following the example in the position control application note from your website, the encoder index is aligned at first
After this I enter the while loop, where I start the motor again, give a position command and stop when it arrives there. The problem seems to be the first StartMotor command above. If the encoder is aligned successfully, the position control can start from any of the trouble-points mentioned earlier withouth any problem, again and again. This makes me suspect that something is not properly initialized the first time I call the StartMotor command, which I know is the problem itselft (It doesnt get stuck in the while loop in line 2..).
I also previous tried to initialize the motor and encoder everytime I pushed a button, and it worked just fine if it got past the initial encoder alignment. The problem is only whenever the motor has some specific position when the program is started.. Maybe this helps.
Best regards
2022-06-14 12:28 AM
Hello,
I confirm I observed similar issue with:
In some rare cases, right after my system starts (reset of the Nucleo F401RE), the motor starts spinning very fast and out of control. While this occurs, I read no error flag and a frozen low speed of 10E-3 or so (read via UART and undocumented ASPEP protocol, so not 100% confident about this).
I could not check the phase levels.
This happens both in torque mode and in speed mode, and only after the first call to MC_StartMotor1() (done through ASPEP/MCP protocols and UART, calling MCP_START_MOTOR command).
I first proceed to current ramp for encoder alignment.
Motor was profiled with MCSDK tools and can be correctly controlled in other cases.
There is a gearbox with a little play between the load and the motor, in case it would be a cue.
I'm definitely looking for a solution or a workaround as this makes my robot prototype very dangerous.
2022-06-14 12:38 AM
Hello !
Just to check if I understood correctly: you mean that the alignment sometimes never completes ? ("It doesnt get stuck in the while loop")
And that's the MC_StartMotor1() at line 1 that trigger the out-of-control spinning ?
2022-06-14 01:31 AM
That is correct. Starting at the specific hall sensor configuration mentioned above resulted in out-of-control spinning when starting the first time. The only theory I have is that there is an overflow or underflow somewhere, resulting in a big value jump. The motor did spin very smooth so the motor driver must work fine, but when a high precision position control is needed, that doesnt help. It is a pretty weird bug I assume every motor would encounter at some point, but I was not able to solve it. The MCSDK was later abandoned for some other reasons too, so I have nothing else to say than good luck. But please, if either you or anyone else (or ST some time in the future) solve it, feel free to leave a comment. :D