Arduino - Simulnik serial data speed

Hi all,
I want to read data from incremental encoder using arduino and simulink. I have programmed the external interrupt zero in order to get thew pulses from the encoder and send them to simulink via serial communication. It works but, it's slow, I reduced the time on block sample time in serial receive block but it's still slow. When the motor turns one revolution, simulink is stil receiving data, and after some time I get all values. How can I improve the data communication in order to get a good response in real time?
PD: I set the baud rate till the maximum value (115200 bauds) but it's still slow.

댓글 수: 2

thoughtGarden
thoughtGarden 2015년 10월 9일
You might try writing code on the Arduino itself to handle the encoder interrupts and calculations, then send updated values via Serial at say 30Hz. Your simulink model would only be updated at 30Hz, but it's likely that is sufficient.
111
111 2016년 4월 6일
tank you

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

답변 (1개)

Madhu Govindarajan
Madhu Govindarajan 2015년 10월 9일

0 개 추천

Have you looked at this post - http://www.mathworks.com/matlabcentral/fileexchange/39354-device-drivers. It works with the Simulink support package

카테고리

도움말 센터File Exchange에서 Arduino Hardware에 대해 자세히 알아보기

질문:

2013년 6월 21일

댓글:

111
2016년 4월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by