cancel
Showing results for 
Search instead for 
Did you mean: 

Using timer 3 to read hall sensors

SLori.1
Associate II

I’m trying to use the timer3 ch1 ch2 ch3 of stm32g4 to read the hall sensors of motor but selecting this config under workbench 5.y. the motor doesn’t work. The default hall sensors timer is timer2. Any idea?

23 REPLIES 23
cedric H
ST Employee

From what I saw, the workbench generated your IOC correctly. The timer 3 is properly configured.

I will not be able to reproduce your issue as it occurs on your custom hardware.

Are you able to probe the signals at pin level C6, C7, and C8 ?

Cedric

Yes the signal arrives correctly to the pins, is correct assume that the hall signals are read correctly since that the variable hall speed is update correctly when I move the rotol manually? Many thanks Il giorno venerdì 1 ottobre 2021, ST Community ha scritto:
SLori.1
Associate II

Yes i see the three hall signals on the pins, seems correctly.

BR

SLori.1
Associate II

In attached my hw, has been replicated the same schematic per three motor on the same board.

thanks

BR

cedric H
ST Employee

Hello,

Do you have a working setup with a genuine IHM16 and a Nucleo-G431 board ?

It would be a good starting point.

Now to answer your question, if when rotating a motor manually you see the speed moving, I would say that timer and interrupt linked to the timer are well configured.

Regards

Cedric

SLori.1
Associate II

Yes, it work well but has TIm2 Pin,

Can you check if there is an hardware problem?

If the hall speed is read correctly why it is not use by firmware? the error is continously speed feedback when hall sensor are actived.

Thanks

BR

cedric H
ST Employee

It is very unlikely that your issue comes from the Timer3.

speed feedback error is generated by the Hall sensor if the pattern reads on the three pins is not legal.

It can occur if one of the three signal does not toggle, or if your placement angle is 60 instead of 120 or vice et versa.

Are you able with your working setup, to spin your motor with STO-PLL as primary sensor and HALL sensors as auxiliary sensor ?

Regards

Cedric

SLori.1
Associate II

Yes it runs but with a bad start (first screen attached last week) , i have already tried to switch 120 and 60 degree without resolve the problem.

BR

cedric H
ST Employee

To be honest I do not really understand why you tried both 120 and 60 deg.

If you have a working setup with ST boards, you must apply the same Motor Hall sensors configuration (placement and electrical angle).

Those parameters are motor dependent, so must be identical from one board to another one.

So, If your placement angle is OK, with ST board, keep the same for your custom board.

Now, if you still have speed feedback error with a correct sensors placement, then the reading of the three Hall sensor pins is not correct.

This probably comes from your hardware, but checking custom hardware is out of the scope of this forum.

Regards

Cedric

SLori.1
Associate II

Yes, i have taken the same configuration that worked on eval and changes the pins using workbench 5.Y.2.

ok, how can i ask to ST support?

Thanks

BR