Simulate tachometer varying refresh rate

4 次查看(过去 30 天)
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

回答(1 个)

Mathieu NOE
Mathieu NOE 2022-3-17
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 个评论
Darren DeBattista
Darren DeBattista 2022-3-17
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 2022-3-18
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" .

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Electrical Block Libraries 的更多信息

标签

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by