2021-09-24 02:30 PM
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?
2021-09-27 01:27 AM
Hello,
The question is vast !
The first thing I would try is to generate a project with sensorless (STO-PLL) as primary sensor, and Hall sensor as auxiliary sensor.
With this project build with SDK 5.Y.2, you will be able to plot the angle generated by the STO-PLL algo, and the Hall sensor algo.
The signals name are STO_PLL_EL_ANGLE and HALL_EL_ANGLE.
Attach to this thread a screen shot of this plot containing the two angles, and based on it I will have more clues to help you.
Regards
Cedric
2021-10-01 05:39 AM
Hi,
thank you for your answere, in attached your request:
Thanks
BR
2021-10-01 06:17 AM
In attached another print screen where seems that are read by MCU and sent to the PC firmware but not use by FOC algorithm, consider that i'm rotating the motor by hand (very slow):another where i'm rotating the motor around 1000rpm:
thanks BR
2021-10-01 06:32 AM
Hello,
Is your motor spinning fine with the STO-PLL as primary sensor ? the shape of your angle is not what I expected.
Please have a look at the following thread :
The image I post is done with an oscilloscope based on 5.4.7. but I do expect the same curve with the 5.Y.2 with the new mPilot.
So the first thing is to have a clean STO_PLL_ANGLE shape.
Now regarding the Hall sensors, the first thing I would advise you to do is to set a break point in the SPD_TIM_M1_IRQHandler function inside the stm32g4xx_mc_it.c in order to check that when you manually rotate your rotor, your timer interrupt is properly triggered. You have to be sure that each transition of the three hall sensors signals are able to trigger the timer interrupt.
Regards
Cedric
2021-10-01 06:54 AM
The first answere is no.
I'm not able to debug application only flashing the compiled program, in any case it should think it about generating the code as it happens if you select the timer2.
Thanks
2021-10-01 07:03 AM
Sorry, but I should have started from here :
Could you tell me which boards do you use ?
Cedric
2021-10-01 07:07 AM
Sorry you, i have replicated the IHM16M1 board but with the all sensors on TIMER 3 C6 C7 and C8.
Thanks
2021-10-01 07:11 AM
Could you attach the IOC file that has been generated in your project directory.
I will check that the timer 3 is properly configured.
Cedric
2021-10-01 07:28 AM