move function to move a Tool

3 views (last 30 days)
sia
sia on 22 Jun 2013
Hi,
i wanna write a function, within i can command the tool to move from a to b.
Can you guys help me, i dont have any idea!
THX

Answers (2)

sia
sia on 22 Jun 2013
hi,
i have found this solution but i miss the command to run the engine. I should say that my tool is a milling, which is on an engine. and the milling can move in x,y, and z direction.
function move = Goel_position (x, y, z)
Vx = 0.036; %speed cm/s
Vy = 0.036;
Vz = 0.036;
X_runTime = (x - Xtsp)/ Vx; % Xtsp first position
Y_runTime = (y - Ytsp)/ Vy;
Z_runTime = (z - Ztsp)/ Vz;
while(X_runTime)
end
while(Y_runTime)
end
while(Z_runTime)
end
end
i wanna that the engine move while the runtime is true. how can i do it?

Jan
Jan on 22 Jun 2013
I've answered in the other forum (just for information of other readers):
We cannot know or guess how the tool is connected to your computer. This is a detail you have to find out at first.
The WHILE loops look strange: WHILE loops run as long as a condition is TRUE. But in the posted code, the condition is a constant time, which will not change it's state from TRUE to FALSE magically.
Please read the help text of while:
help while
And most of all you need any clear instructions about how the tool can be controlled. Ask your teacher, professor or read the manuals. But the forums cannot help you in this point.

Categories

Find more on Simulink in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!