Simulate tachometer varying refresh rate

3 vues (au cours des 30 derniers jours)
Darren DeBattista
Darren DeBattista le 17 Mar 2022
Commenté : Mathieu NOE le 18 Mar 2022
Hi,
I am simulating a DC motor controller. The real application will use an optical tachometer, where the measured period of the pulses is used to calculate the motors angular velocity. Since the angular velcoity is calculated with every pulse width measure, the refresh rate of the angular velocity measurement will vary, ie higher refresh rate at higher angular velocity and vice-versa.
Is there a way to simulate this on mathlab?
Thanks

Réponses (1)

Mathieu NOE
Mathieu NOE le 17 Mar 2022
hello
why not using a counter ? sampled at a high (fix) frequency rate.
This simulink code attached is a demo (Fs = 100 kHz, adapt to your needs)
the output is the frequency (or RPM if you prefer, multiply by 60 the freq output)
All the best
  2 commentaires
Darren DeBattista
Darren DeBattista le 17 Mar 2022
Hi,
Thank you for your reply. What you sent works and gave the output I wished for though I'm finding the following issues;
  1. My simulation needs to have variable step size. Your file is not working when I set variable step size, even if manually place the step size in the counter. I also tried to use a counter block intead of the accumulator you made, though the enable block at its output keeps outputing zero.
  2. In my simulation, I have the motor model which will output its angular velocity as a continous signal. So I need this signal to be converted to a tachometer output (ie, to the same output as your file). ANy idea on how to make this? (using a VCO maybe?)
Thanks again.
Mathieu NOE
Mathieu NOE le 18 Mar 2022
hello
a techometer is always built around a (fast) counter - so it's fixed sampling rate.
a variable step size simulation / solver is IMHO just a simulation / computation time saving tool
if you want to turn that into a prototype control system is gonna be anyway fixed sampling process.
so IMHO your code could / should have multiple rates ( fix ) as this is going to be how it will work in "real" .

Connectez-vous pour commenter.

Catégories

En savoir plus sur Simulink dans Help Center et File Exchange

Tags

Produits


Version

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by