How would I be able to code coordinates into a single set of instructions to direct the motion of the Delta X Robot?

1 次查看(过去 30 天)
s = serialport('COM5',115200,'Timeout',1,'DataBits',8,'StopBits',1,'Parity','none','FlowControl','none');
writeline(s,"IsDelta")
writeline(s,"IsDelta")
readline(s)
writeline(s,"G28")
writeline(s,'M204 2000')
readline(s)
s1={'G01'}
s11={' '}
s2={'Z','X','Y'}
s3={'-390','-78,-55,-32.5,-11.5,12,34.5,57,80,103.5','58'}
A = strcat(s1 ,s11,s2,s3)
writeline(s,'G01 A')

回答(1 个)

Walter Roberson
Walter Roberson 2022-2-2
s = serialport('COM5',115200,'Timeout',1,'DataBits',8,'StopBits',1,'Parity','none','FlowControl','none');
cmd = "IsDelta" + newline + "IsDelta" + newline + "G28" + newline + "M204 2000" + newline;
s1={'G01'}
s11={' '}
s2={'Z','X','Y'}
s3={'-390','-78,-55,-32.5,-11.5,12,34.5,57,80,103.5','58'}
A = strcat(s1 ,s11,s2,s3)
cmd = cmd + A + newline;
write(s, cmd, 'char');
readline(s)
readline(s)
This is not certain to work. The robot might need time to react between the time you send IsDelta and the time you send G28, or after you send M204 and before the next part.
But possibly what you are looking for is just taking what you have now and replacing the
writeline(s,'G01 A')
with
writeline(s, A);

类别

Help CenterFile Exchange 中查找有关 ROS Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by