2021-06-18 12:15 AM
Hi
I want to make a position control with a B-G431B-ESC1.
I use a motor with an encoder with 1024 PPR.
Motor profiler ended with no problem.
I started a project in motor control workbench Ver. 5.Y.1.21203 setting the encoder in motor settings and in speed sensing.
I tryied to generate the code but i get following errors:
Type Time Motor Id Message
UNK 09:07:29 A0 is used in: Encoder Interface Timer( TIM2 ).CH1, Bus Voltage feedback ADC( ADC1 ).ADC12_IN1
UNK 09:07:29 A1 is used in: Encoder Interface Timer( TIM2 ).CH2, Phase current feedback OPAMP( OP1/OP2/OP3 ).ChU NoInv
Any help?
Thanks
2021-06-18 02:47 AM
Motor control workbench -> Digital I/O -> Encoder interface -> Timer= TIM4 CH1=B6 CH2=B7
2021-06-18 04:09 AM
Thanks
Now it compile but i have another issue.
I set in drive settings control mode as "Position control".
I generate the code, compile with Stm32CubeIDE and upload.
However in Motor Pilot 5.Y.1 i only find control mode "Torque" an "Speed" but not "Position".
How can i set the position of the motor?
Thanks
2021-06-18 04:40 AM
There is no ui for position control.
Position control example in "MC_SDK_5.Y.1\Projects\NUCLEO-F303RE\Demonstration\PositionControl\Src\main.c".
2021-06-21 09:48 AM
The question has been set only to the "STM32 Motor Control" topic (the question is only about the STM32 MC SDK).
Best regards
2021-06-23 12:31 AM
I am having a Similar problem and I hope someone could help as I don't even know how to debug my issue.
I have taken all the steps above and I'm trying to run speed control loop but as I try to do speed control with quadrature encoder rather than sensor-less mode, the motor doesn't turn. it makes some constant noise and it doesn't move at all.
the same experiment works if I change the speed sensing block's properties to sensor-less but if I choose quadrature encoder it just makes some noise and no motion. I have tested the encoder and all signals look correct on the scope. When I turn the motor by hand I can see under "Measured Speed" that it is being measured correctly.
Here are some screenshots of my settings
Any advice is greatly appreciated.
2021-06-23 01:43 AM
Have you tried to switch encoder A and B wires?
Encoder rotation direction should match motor rotation direction.
2021-06-23 07:23 PM
I have, In fact even if I remove the encoder wires the behavior is the same, which is very strange.
2021-06-23 07:49 PM
I looked at the phase signals on the scope and all phases seem to turn on and off at the same time. (hence the rotor is locked)
here is PhaseA vs Phase B
Phase A vs Phase C looks exactly the same
2021-06-23 07:54 PM
One major question for me is how does this hole pipeline find out the alignment between encoder and stator? I initially thought "Encoder Align" button would do it (maybe by using the estimator internally to find the alignment?) but pressing that applies some voltage to the motor for like 1 second and stops (it doesn't move the shaft at all). Also the Z signal from the encoder doesn't seem to be used in the ControlWorkbench/generated code(this is another thing I would have thought is necessary for alignment.)