cancel
Showing results for 
Search instead for 
Did you mean: 

B-G431B-ESC1 Encoder Problem

Gmatt.1
Associate II

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

12 REPLIES 12
erno.1
Associate II

Motor control workbench -> Digital I/O -> Encoder interface -> Timer= TIM4 CH1=B6 CH2=B7

Gmatt.1
Associate II

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

erno.1
Associate II

There is no ui for position control.

Position control example in "MC_SDK_5.Y.1\Projects\NUCLEO-F303RE\Demonstration\PositionControl\Src\main.c".

Laurent Ca...
Lead II

The question has been set only to the "STM32 Motor Control" topic (the question is only about the STM32 MC SDK). 

Best regards

saghl.1
Associate II

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

0693W00000BbkbzQAB.png0693W00000BbkbuQAB.png0693W00000BbkbpQAB.png0693W00000BbkbkQAB.pngAny advice is greatly appreciated.

erno.1
Associate II

Have you tried to switch encoder A and B wires?

Encoder rotation direction should match motor rotation direction.

I have, In fact even if I remove the encoder wires the behavior is the same, which is very strange.

saghl.1
Associate II

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

0693W00000BbrBFQAZ.jpgPhase A vs Phase C looks exactly the same

saghl.1
Associate II

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.)