arduino simulink control dc motors

1 Ansicht (letzte 30 Tage)
john white
john white am 15 Mär. 2019
Bearbeitet: john white am 16 Mär. 2019
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:

Antworten (0)

Communitys

Weitere Antworten in  Power Electronics Control

Kategorien

Mehr zu Arduino Hardware finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by