2021-10-11 10:10 PM
I am planning to us the STM32F103 MCU for BLDC motor control. No encoder, only the usual three Hall sensors. I am attempting to use the XOR gate in Timer channel 1 that combines the rising and falling edges of all three Halls (Ref. Manual RM0008, page 332). See the enclosed diagram, where the red lines indicate the signal flow used for this feature (Ref. Manual RM0008, p. 382, Fig. 125).
Question: how is the Timer's Edge Detector configured to detect both rising and falling edges? I cannot find a reference for timers. (only for external triggers - ETR).
Thank you for your feedback!
2021-10-12 12:48 AM
> Question: how is the Timer's Edge Detector configured to detect both rising and falling edges?
You mean, for input capture within the same timer? In 'F103, there's no such option, but in newer STM32 (probably all except 'F1xx) there is.
The description in subchapter Interfacing with Hall sensors of RM0008 provides the intended usage mode: the 3 inputs are connected to an "interfacing" timer, e.g. TIM3, which is free running and where the "both edge" TI1F_ED signal is used as input to Slave-mode Controller in Reset mode; then one of the channels set to output mode provides a delay, after which the OCxREF from that channel is used as TRGO, which in turn is input as TRGI to the timer which actually controls the motor (TIM1).
You can use something similar as a workaround, if you want to capture both edges of incoming signal (xored or not); you don't need to actually have the "interfacing" timer running, you can set TRGO directly to Reset in TIMx_CR2.MMS.
JW
2021-10-12 01:45 AM
Hello @Kmax18 ,
I invite you to download the MCSDK-5.4.7 here
In this version, the STM32F1 is still supported, and you will be able to generate a project with the support of the Hall sensors.
Once the IOC is generated, you can open it with cubeMX and analyze how it is configured.
Please note that the STM32F1 is not recommended for new designs and its support ends with version 5.4.7
Hope it helps.
Cedric
2021-10-12 01:52 AM
2021-10-12 02:01 AM
Hello,
If you want to control two BLDC motors with one MCU, I would recommend you a STM32G4 MCU.
All the MCUs that are supported by the MCSDK have the required hardware to support the Hall sensors.
Cedric.