Blog

Beckhoff XTS Part 4: Movers

 Beckhoff XTS Part 4: Movers

In previous entries of this blog series, we went over how to configure, activate, and run code on a Beckhoff XTS system. Running the starter project is great to ensure the system is wired and configured correctly, but to truly get the most out of our XTS system we need to understand how to control the movers for our specific application.

This blog will go over the Mover function block that comes with the base starter project. We will see how to configure the movers properly and what methods we have at our disposal to use with our system. This blog will continue to use the Beckhoff XTS_Base GitHub and the large XTS starter kit

Beckhoff XTS Series

Movers

Movers are the software representation of the physical XTS movers. The mover object built into the base project is a great starting point since it comes with a lot of useful methods for controlling the mover behavior. 

Declaring Movers

In the previous entry in this blog series, we made sure to update the number of movers to match the physical movers in our system. In the MAIN program, we can see that the movers are declared with the line.

Mover : ARRAY[0..GVL.NUM_MOVERS - 1] OF Mover;

As mentioned in the previous section, this NUM_MOVERS should be exactly equal to the number of physical movers in the XTS system. Additionally, the axis references of these mover objects should be linked to the motion axes. If you haven’t already done that see this section

Configuring Movers

Like most drives, the movers need to have a set of parameters and to go through an enable process before they can run. The base project already does both things for us. In the MAIN program the code starting at line 52 is where the parameter set is applied to all of the movers configured in our system. 


FOR i := 0 TO GVL.NUM_MOVERS - 1 DO
Mover[i].MotionParameters := ParameterSet;
END_FOR

The lines starting at line 46 define the parameter set, which includes acceleration, deceleration, jerk, velocity, and direction. 

                                    
ParameterSet.Jerk     := 1E5; // mm/s3
ParameterSet.Acceleration := 1E4; // mm/s2
ParameterSet.Deceleration := 1E4; // mm/s2
ParameterSet.Velocity   := 1E3; // mm/s
ParameterSet.Direction   := mcDirectionPositive;

Line 72 is where the movers are enabled 


FOR i := 0 TO GVL.NUM_MOVERS - 1 DO
Mover[i].Enable();
END_FOR

and a few lines down in line 87 is where their Ready property is checked to see if they got enabled properly. 


FOR i := 0 TO GVL.NUM_MOVERS - 1 DO
IF Mover[i].Ready = FALSE THEN
allMoversEnabled := FALSE;
END_IF
END_FOR

Additionally, the movers must be assigned to a track. This happens starting at line 144 by calling ActivateTrack and passing in the track the mover is to be assigned to. 

FOR i := 0 TO GVL.NUM_MOVERS - 1 DO
Mover[i].ActivateTrack(Track[1]);
END_FOR

For the basic starter project, all movers are assigned to track 1. If your application has multiple tracks, this is where you can specify which movers belong to which track. A few lines down at line 153 is where the logic checks the mover’s IsTrackReady property to make sure they’re properly assigned to their track. 

allMoverTracksEnabled := TRUE;
FOR i := 0 TO GVL.NUM_MOVERS - 1 DO
IF (NOT Mover[i].IsTrackReady) THEN
allMoverTracksEnabled := FALSE;
END_IF;
END_FOR

To stop the movers, the logic will need to call the Halt method. This is already implemented in line 286 of the base starter project. 

FOR i := 0 TO GVL.NUM_MOVERS - 1 DO
Mover[i].Halt();
END_FOR

Once the movers are stopped, they can be disabled using the Disable method. Again, this is already implemented in line 348. 

FOR i := 0 TO GVL.NUM_MOVERS DO
Mover[i].Disable();
END_FOR

It’s worth noting that if you have a vertically mounted track, disabling the movers will often let them succumb to gravity. It could be worth implementing something that gets the movers off the curved sections before disabling them. 

Many of these XTS library objects have methods named Cyclic or CyclicLogic that need to be called every scan in order to function properly, so check those are getting called correctly if any issues come up. For our movers, this happens at line 408. 

FOR i := 0 TO GVL.NUM_MOVERS - 1 DO
Mover[i].Cyclic(GroupRef);
Mover[i].AxisReference.ReadStatus();
END_FOR;

The logic also calls the ReadStatus method of the mover’s internal axis reference to ensure the status values are up to date. 

Now we’ve gone over a lot of the configuration that these movers need. We can enable them, assign a parameter set to them, assign them to tracks, stop them and disable them. We’re also calling the Cyclic method that ensures our commands get processed properly. Now it’s time for the fun part, getting the movers to move around the track. 

Mover Logic

The mover objects come with four main methods that will help control their movement throughout the track. Here’s a quick description of each of the methods. 

SetVelocity

SetVelocity is a method of the mover object. It will immediately change the velocity of the mover to the commanded velocity (in mm/s).

MoveVelocity

MoveVelocity is a method of the mover object. It will command a mover to run at the commanded velocity (in mm/s) until it receives another command.

MoveToStation

MoveToStation is a method of the mover object. It will command a mover to go to the commanded station. Note that there’s no velocity input for this method, so the mover will go at its existing velocity, which was likely last given by SetVelocity or MoveVelocity. The mover will stop once it reaches the commanded station.

MoveToPosition

MoveToPosition is a method of the mover object. It will command a mover to go to the inputted position (in mm). Similar to MoveToStation, there is no velocity input so this will use the mover’s existing velocity.

The MoveToStation function is particularly useful, but first we have to understand what a station is. We will go over stations in the next entry in this blog series.

If you’d like help with the next steps for your XTS system, DMC is proud to be a Beckhoff System Integrator and has worked on multiple XTS projects and applications. Learn more about our Beckhoff partnership and contact us for your next project.

Ready to take your Automation project to the next level? Contact us today to learn more about our solutions and how we can help you achieve your goals.

Comments

There are currently no comments, be the first to post one.

Post a comment

Name (required)

Email (required)

CAPTCHA image
Enter the code shown above:

Related Blog Posts