I have setup a motor (1 rotative axis mechanism) along with a robot. I want the motor shaft to rotate by the required amount whenever the 'Extrude' function is called (length of filament extruded is the argument it passes).
11-09-2023, 12:44 PM (This post was last modified: 11-15-2023, 10:49 PM by Alex.)
You can control any number of mechanism axes using a python script. I attached an example to control a conveyor in a roboDK station. You can apply the same logic to a rotative axis
(11-09-2023, 12:44 PM)Alex Wrote: You can take a look at the following example with a conveyor. You can apply the same logic to a rotative axis
Thank you! I was able to make the mechanism work when the script is simply called. However, when I try to run the script as thread, it says Python script interrupted. I have included the RDK file. Please let me know what has to be corrected to make it work.
How do you run the script as a thread? It seems to work when you run the 3D printing program.
To have a more realistic simulation I recommend you to adjust the speed of your mechanism to the robot speed and make the movement not blocking. Example:
OK I understand what you mean. However, you should run Extruder as a program call (default behavior), not as a thread.
If you run it as a thread, the next time that Extruder is called it forces to stop the previous execution. I recommend you to run it as a program call (default behavior) and make the MoveJ movement not blocking.