フィルターのクリア

arduino simulink control dc motors

2 ビュー (過去 30 日間)
john white
john white 2019 年 3 月 15 日
編集済み: john white 2019 年 3 月 16 日
Hi
I want to control 3 dc motors with encoders so I have used simulink and arduino (3arduino boards)
I used matlab function block in simulink area for controlling method and for writting the voltage of the dc motors and for the reading the position and velocity of encoders
in fact I have used 3 matlab function but when I run the simulink it showed error the code that I have wriiten in matlab function to read the position and velocity is:
function [count1 count2 count3 speed1 speed2 speed3]=fcn
a1=arduino('com3','due','Libraries','RotaryEncoder');
a2=arduino('com5','uno','Libraries','RotaryEncoder');
a3=arduino('com6','uno','Libraries','RotaryEncoder');
encoder1=rotaryEncoder(a1,'D2','D3',4000);
encoder2=rotaryEncoder(a2,'D2','D3',4000);
encoder3=rotaryEncoder(a3,'D2','D3',48);
count1=readCount(encoder1);
speed1=readSpeed(enocder1);
count2=readCount(encoder2);
speed2=readSpeed(encoder2);
count3=readCount(encoder3);
speed3=readSpeed(encoder3);
end
and the errors are:

回答 (0 件)

コミュニティ

カテゴリ

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