Using Servo Block with Simulink IO

조회 수: 4 (최근 30일)
Jeff Dillon
Jeff Dillon 2019년 7월 29일
댓글: Jeff Dillon 2020년 4월 1일
Simulink IO currently supports the PWM output block in Normal mode, but I need to control a servo. The PWM output is at 1Khz, but a servo typically uses 50Hz. Is there any way to change the PWM frequency? My servos don't recogize 1Khz. I'm currently using a second Arduino to down convert 1Khz PWM to 50 Hz, but of course slows down the real time simulation.

답변 (1개)

Arun Kumar
Arun Kumar 2019년 9월 25일
Hi Jeff,
With Simulink IO, it is not possible to change the PWM frequency.
But for changing PWM frequency in external mode or deploy to hardware, there is a workaroud.
Use this Simulink library to change frequency on Arduino AVR boards. Note that this workaround will not work for Arduino ARM boards like Due/MKR1000.
Request for supporting variable PWM frequnecy on arduino is under consideration.
  댓글 수: 3
Arun Kumar
Arun Kumar 2020년 3월 31일
Hi Jeff,
The feature is available in R2020a.
Jeff Dillon
Jeff Dillon 2020년 4월 1일
Thank you! I downloaded 2020a and see the new frequency parameter for the PWM block, very nice.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Arduino Hardware에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by