Measuring the Speed of a DC Motor from its Encoder
21 ビュー (過去 30 日間)
古いコメントを表示
Hi everyone, I am pretty new at this. I made a Simulink project that can control the direction of the motor and the PWM of the motor. What I wanted to do is to read encoder and measure the speed from it. I tried some algorithms I found on the internet but they don't work. When I increase/decrease the speed, the output of the algorithm changes absurdly. I would really apreciate any help. Thank you.
Note: I tried reading encoders from Analog input and Digital Input. Nothing changes.
Blocks:![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1011950/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1011950/image.png)
Output(60 PWM):
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1011955/image.png)
Output(90 PWM):
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1011960/image.png)
Output(120 PWM):
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1011965/image.png)
0 件のコメント
回答 (1 件)
Shang-Chuan Lee
2022 年 6 月 10 日
Hi Vedat,
We have many resources to help you get started on controlling servo motor using Arduino Hardware. You may refer to this motor control example for more information. https://www.mathworks.com/help/supportpkg/arduino/ref/servo-control.html
To measure the encoder signal such as speed and angle, we have Arduino hardware support package - Encoder block to help you measure incremental position and direction of rotating motor.
This link provides you an overview of running Simulink models on Ardunio boards.
Best regards,
Shang-Chuan Lee
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!