Introduction to Motion Direct Commands
In our last document, we added two virtual axis. If you have not done so already, please visit this page to add the two virtual axis before we continue. I will be assuming you are using a spare processor that is not attached to any machinery. Once your virtual axis are set up, please download to the processor. Go to Remote Run Mode.
In this example, I will demonstrate how the motion direct commands work by issuing a simple jog instruction. If you choose to use these commands on an actual servo, ensure the motion will not cause any damage to equipment or personnel!
In the Controller Tag database, you will notice that tags have been created for our virtual axis. Expand VirtualAxis1 by pressing the “+” next to the tag.
Find the tag for the actual position. In the first section, we will be looking at this position as we run through the motion direct commands to ensure our axis is responding.
Opening the Motion Direct Commands
In the Controller Organizer window (at the left), right click on VirtualAxis1, and we will open the “Motion Direct Commands”.
You will see the command list appear for our motion direct commands. Normally, if this were an actual axis, you would want to clear any faults or shutdown conditions with the MASR (Motion Axis Shutdown Reset), and MAFR (Motion Axis Fault Reset) commands. On an actual axis, you would then issue an MSO command (Motion Servo On). Since we are working with a virtual axis, however, the MSO command will not be functional since we don’t need to turn on an actual servo drive.
Execute a Command
To test the motion direct commands, we will simply perform a jog. In your command list, locate the MAJ (Motion Axis Jog) command. We will set the speed at 100 units per second for this demonstration, then execute the command.
You will see the actual position is now increasing with an actual velocity of near 100 (which was our setting) and the average velocity is also 100 (or close to 100).
To stop the axis, issue an MAS (Motion Axis Stop) command.
You will see that your velocity has gone to zero, and the position is no longer changing.
Other commands work very similar. You can use the help file if you need more information on how the other commands work. By using the motion direct commands on a virtual axis, you can experiment with the operation of various commands. This will help you get a good understanding of how the commands work before using them in logic.
You can execute a Motion Axis Home (MAH) command to return the axis values to the home position.
Next, you can move on to try the Motion Axis Move command!
— Ricky Bryce