Timer PWM ETR functionality: ADC remap and ETR filter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-04-17 1:44 AM
I have been working on a motor control project for a three phase BLDC motor. So far I have implemented the center aligned PWM output over Timer1 of STM32F303CB. I want to add a current limiting feature such that the PWM gets halted when a current beyond threshold is read.
I came across the ETR functionality through ADC remap of the MCU. I have configured the clearing source to be ETR and clear channels enabled. Questions I have:-
- Is the existing configuration for timer1 as shown in the figure correct? If not what are the required changes.
- Can I connect my current sensor and set an ADC watchdog for a throshold of current and further trigger the ETR.
- If yes what is the role of clear source filter. Will it act as a filter for my ADC channel?
- From the reference manual I found out that the ADC remap is ORed with the ETR. Does is mean I still need to provide an ETR source?
Thanks in advance
Attached is the STMCube configuration and snippets of material I found from reference manuals.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-09-11 2:51 AM
Dear Svish.2
Do you have still this problem to solve?
Best regards
Laurent Ca...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-09-11 2:10 PM
Assume yes. What can go wrong of you provide an "unsolicited" answer?
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-09-17 12:04 AM
Dear @Laurent Ca... ,
Thank you for the concern on the problem that I HAD.
Yes the issue is resolved.
Regards
Shwetank Vishnu.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-09-23 5:45 PM
Dear @Community member
We have just decided to try to satisfy as many as possible all the contributors of this forum (the tag "STM32 Motor Control").
Best regards
Laurent Ca...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-09-24 2:28 PM
Hi Laurent,
> We have just decided to try to satisfy as many as possible all the contributors of this forum (the tag "STM32 Motor Control").
I've noticed, and I invite that.
As you've seen, many posts are initially wrongly formulated, of the "it does not work" type, with insufficient details given, and ultimately abandoned.
However, this one is different, Even if Shwetank Vishnu said he does not have the problem anymore, it is ultimately a case of inadequate documentation, and as such, it deserves a concise answer for others who may come across this thread in search for answer for a similar question.
Ultimately, it boils down to two items:
- the ETR input to the timer module appears to have input from multiple sources - GPIO and several ADCs. While the quoted narrative from RM says, they are ORed, it does not say, where - is it at the very input of the TIM module, or is it after the filter/prescaler unit? It is very much the same question as I put in https://community.st.com/s/question/0D50X0000B9vdy2/in-f3-comparator-output-to-timer-input-channel-connects-exactly-where - and, it is best to be answered in the very same manner as @Vincent Onde proposed there: by adding a simple diagram.
- this is a question of much broader impact, which was never addressed by ST: is it guaranteed, that an AF signal, if NONE of the associated pins in GPIO are assigned to it, is stuck to 0? (a subquestion is, what happens if multiple pins are associated to it).
While both these questions deserve to be answered in the RM - and the latter in *all* RMs (except the ancient 'F1 perhaps), I also recommend to describe the particular issue of timers "safeguarding" using other modules' signals, in a separate Application Note - of course accompanied by concise and comprehensive examples in clean C.
You may have heard of my call for "dozens of appnotes"...
Jan
To:
@Laurent Ca...
and
@Imen DAHMEN as "Documentation Moderator In Charge"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-09-25 12:35 AM
Dear @Community member
Please open new posts for any issues you have.
Adding new issues in an existing one is not the strategy I intend to impulse to the forum "STM32 Motor Control".
But I am not going to use "double talk" (means "langue de bois") to avoid answering you although I will do it in a very general way.
Advanced functions in motor control applications are relatively recent in ST.
Now due to the results obtained, improving the support for our customers becomes a priority in order to become the best in class with a big leadership.
Therefore, I hope you will see in the coming weeks big improvements in all of the areas you mentioned.
Best regards
Laurent Ca...
