cancel
Showing results for 
Search instead for 
Did you mean: 

B-G431B-ESC1 - Encoder Connection Problem

mckmk
Associate II

Hi everyone,

I recently purchased the B-G431B-ESC1 kit. I did a sensorless experiment with the ST motor control workbanch and it worked as expected. However, when I want to test with the encoder, the rotor remains locked and does not rotate after alignment.

From the Digital I / O part, the encoder pins were initially connected to pins TIM2 A0 and A1. I corrected them according to the diagram and connected them to pins B6 and B7 of the TIM4 timer.

When I watched the function LL_TIM_GetCounter (pHandle-> TIMx), I saw that the encoder counts the pulses. So the MCU can read the encoder.

Despite all this, I did not understand why the motor shaft was locked.

I was working with STEVAL SPIN32F0 before and it was working with Encoder without any problems.

9 REPLIES 9
cedric H
ST Employee

Hello,

One potential root cause can be the proper connection of the three phases.

With encoder setup, you have to respect the phases U,V, W of your motor and to connect them accordingly.

Be sure also to not swap Encoder A,an B input.

Regards

Cedric.

mckmk
Associate II

Thank you for your answer.

I've tried all the phase combinations of the motor. I also moved the A and B phases of the encoder, but it didn't.

Thank you for your answer.

I've tried all the phase combinations of the motor. I also moved the A and B phases of the encoder, but it didn't.

mckmk
Associate II

I still haven't solved the problem.

Gigi
ST Employee

​Ciao mckmk

The first important thing to understand if the counter of the timer is updating according to the movement of the encoder. So you can capture it in a variable and show it in the live watch.

Second point is the number of ppr is correctly set... so for instance if you make a full turn you can take a look at the value of the counter.

Another  easy test can involve DAC putting in output the Observer and the Measured angles when you run the motor in sensorles mode with the encoder set as auxiliary. But I don't know if in the board that you are using the DAC channels are available. This can help a lot.

Ciao

Gigi

mckmk
Associate II

I am able to indicate that the number of pulses in the encoder is measured correctly. So my board can read the enoder correctly.

I bought two of these boards. Yesterday I tried the spare board and it worked.

However, I connected the motor to the electronic load and in the fourth test, the TVS diode and L7986 in the entrance blew up. The current protection of this board cannot be set down to 100A. Perhaps there are errors that need to be fixed on this board.

Thank you.

ISyrk.1
Associate

Hello!

I have same problems with encoder. counter in TIM4 counts encoder steps with error in some cases.

I made experiments without V+ connected, power was only through USB port.

  1. If motor in STOP state It counts steps correct.
  2. If motor in RUN state (press "Start" button) It counts steps with errors:
    1. I rotate motor shaft for one revolution. It counts less steps than in STOP state
    2. I rotate shaft clockwise and counterclockwise for a small angle near "Zero" position, but "Electic Angle" variable accumulates its

value constanly (on pic 1)0693W000000Tr0qQAC.jpg

I wondered this "magic" and used oscilloscope..

In RUN state:

0693W000000Tr2XQAS.jpg

Red line is V=0, Yellow line is signal on "Encoder A" pad on the board. with no encoder connected

In STOP state signal on this pad is correct.

My both kits has the same problem.

What should I do to fix this problem?

GCate
Associate

Hi all,

I'm seeing a similar issue. I attached a 540 sensored R/C motor to the board (in my case 3 hall sensors). When I turn manually the motor I can see that the edges of the hall sensors are detected as expected but when I try to run the motor one of the hall sensor channel does not perform as expected.

I did many tests that I don't want to list here, I jump directly to the conclusions.

I did a very simple set up where there was no motor phases connected (just the hall sensors). I modified the firmware in a way that the 6 PWM TIM1 channels are driven with 50% duty cycle. What I observed is that:

  • when TIM1.CH2 is enabled and the hall sensor 1 (PB6 TIM4.CH1) is high then the PB6 line (and only the PB6 line) is the 'quasi' negation of TIM1.CH2 (and not TIM1.CH2N because I can see the deadtime). I said 'quasi' because the 0 level is not really 0V but 1V.
  • when TIM1.CH2 is enabled and the hall sensor 1 is low then PB6 stay low.
  • If I disable only TIM2.CH2 and I let all the other channels active and I turn manually the motor all the hall sensors works correctly.

So, conclusion are that TIM1.CH2 disturbs PB6 input but only when PB6 is high.

I tried to disconnect all the analogic circuits from the TIM1.CH2 pin (I removed the pre drivers and the capacitors to the 10V) but the problem is still there. I tired on 3 boards, same problem. I checked on the STM32G micro errata sheet but there are no reported issues on TIM1/TIM4.

GianPaolo

GCate
Associate