Convert step output to sine output

3 ビュー (過去 30 日間)
Aldiaz Nabil Faekar
Aldiaz Nabil Faekar 2015 年 5 月 17 日
回答済み: Marcos Gritti 2015 年 5 月 17 日

Hi, does anyone knows how to convert step to sine waves? its going to used on dc motor positioning. i used arduino simulink for run the motor. i have trouble for its acceleration. errors comes high then the motor cannot accelerate smoothly. Then i have to convert the errors/PWM from high variables to "incremental" variables without losing to much rise time(represent with red line). maybe this pictures can describe clearly. anyone have the solution about this?

All the answers will be appreciate. Thanks alot

Aldiaz

  2 件のコメント
Image Analyst
Image Analyst 2015 年 5 月 17 日
Do you have to start with the step, or can you just generate the sine wave with sin() immediately and not even worry about creating the step function?
Star Strider
Star Strider 2015 年 5 月 17 日
Yours is actually a linear control problem. You need a mathematical model of your motor, and then design your control system around it to meet your requirements.

サインインしてコメントする。

回答 (1 件)

Marcos Gritti
Marcos Gritti 2015 年 5 月 17 日
If i don't misunderstood, you want to smooth the input signal to the motor? If it is, you can add a low pass filter between the signal source and the motor.
function output = lowpassfilter(input, tau)
persistent lastvalue;
if isempty(lastvalue) || isnan(lastvalue)
lastvalue = 0;
end
dt = 0.1;
lastvalue = lastvalue*(1-dt/tau) + dt*input/tau;
output = lastvalue;
end
This function correspond to a first order lowpass filter, where dt is the sampling time and tau is the filter constant.
Hope that this help you.

カテゴリ

Help Center および File ExchangeArduino Hardware についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by