Can you please tell me how to combine these G-codes and be able to run Delta X Robot through MatLab program? Thanks.
1 次查看(过去 30 天)
显示 更早的评论
(X,Y,Z)
%แถวที่1
writeline(s,'G01 Z-390')
writeline(s,'G01 X-78 Y58')
writeline(s,'G01 X-55 Y58')
writeline(s,'G01 X-32.5 Y58')
writeline(s,'G01 X-11.5 Y58')
writeline(s,'G01 X12 Y58')
writeline(s,'G01 X34.5 Y58')
writeline(s,'G01 X57 Y58')
writeline(s,'G01 X80 Y58')
writeline(s,'G01 X103.5 Y58')
%แถวที่2
writeline(s,'G01 X-78 Y33')
writeline(s,'G01 X-55 Y33')
writeline(s,'G01 X-32.5 Y33')
writeline(s,'G01 X-11.5 Y33')
writeline(s,'G01 X12 Y33')
writeline(s,'G01 X34.5 Y33')
writeline(s,'G01 X57 Y33')
writeline(s,'G01 X80 Y33')
writeline(s,'G01 X103.5 Y33')
%แถวที่3
writeline(s,'G01 X-78 Y11.5')
writeline(s,'G01 X-55 Y11.5')
writeline(s,'G01 X-32.5 Y11.5')
writeline(s,'G01 X-11.5 Y11.5')
writeline(s,'G01 X12 Y11.5')
writeline(s,'G01 X34.5 Y11.5')
writeline(s,'G01 X57 Y11.5')
writeline(s,'G01 X80 Y11.5')
writeline(s,'G01 X103.5 Y11.5')
0 个评论
回答(1 个)
Walter Roberson
2022-2-2
You can write the code more compactly;
coordinates = [
"Z-390", "X-78 Y58", "X-55 Y58", "X-32.5 Y58", "X-11.5 Y58", ...
"X12 Y58", "G01 X34.5 Y58", "G01 X57 Y58", ...
and so on
];
for K = 1 : length(coordinates)
writeline(s, "G01 " + coordinates(K));
end
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Robotics 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!