Looking For Motion Instructions

PLC Pie Guy

Member
Join Date
Jun 2013
Location
Halifax
Posts
1,144
Hey Folks.

Version 33. L18ERM
Kinetex5500

We are working on a little servo project here. Iv done a few very basic machines using mostly the MAM for the majority of my moves.

This time, We need to add a second step to the process.
I need to start a move.
Lets say the entire move is 1000 counts.
I want to take over that move with another instruction at any point during the MAM and have the first MAM simply go to a done state and the second one seamlessly controls the motion now. The second instruction is going to say, travel XYZ counts then stop. Just say 200 for example.

I'm trying this with simply an MAM followed by an MAM but it seems to accumulate both moves giving me a total move greater than I expected.

I can do this successfully with stopping between the first and second MAM easily and accurately enough but that is killing my cycle time. I was hoping with the second MAM set to "Merge" it would do what I seek. Not the case. Or will it do what I want and I'm simply not setting it up correctly?

Iv been toying with the MCLM instructions as a pair, "Initial move" and "TakeOverMove" and toying with them in conjunction to my regular MAM instructions. Using the MAM as an initial move then a take over with the MCLM instruction. They may not be what I need though. I feel I might be barking up the wrong tree with the MCLM instructions but the descriptions kind of make me think they would do what I seek..


Any suggestions on what instruction or instructions I might use to accomplish my task?

Start Incremental move - If Event Happens, Run to New Target, same speed, same everything. Just a new stopping point.

Thanks for any pointers.
 
I don't do much with motion, but glancing through the instruction help it appears that if you are doing incremental moves you would indeed need to use MCLM:
The Merge for coordinated motion operates differently from a merge on an MAM. For the MCLM, any uncompleted motion at the point of the merge is discarded. For example, assume that you have a single axis MCLM programmed in incremental mode from a starting absolute position = 0 and with the programmed incremental distance = 4 units. If a merge occurs at an absolute position of 1 and the merge is another incremental move of 4 units, the move completes at a position = 5.

If this example occurs on a MAM programmed in incremental mode, the final position = 8.

If your second move was absolute then a merge in MAM would simply transition from the first instruction to a move to the specified point, but an incremental mode MAM will always be added to the commanded end position of the current move, not the current position.
 
MCLM is used for coordinated motion, think robot
Merge function handles the speed change if any between moves not position
Incremental moves are additive and move a defined distance regardless of where they start from. You're first move is 1000 and second is 200 end result is 1200 units.
You could try using absolute moves instead, move type 0. The second MAM with terminate the first and move to an absolute position
 
You're describing how incremental moves work in ControlLogix: when you execute an Incremental MAM on on an axis that's already in motion, the incremental move distance is added to the already-in-progress end position, not the already-in-progress current position.

That happens whether the in-progress MAM is incremental or absolute.

To get what you want, you can calculate the desired stop point relative to the original stop point, and use an incremental MAM with Merge enabled and a negative Position argument.

I tested this with some virtual axes to be sure my recollections and recommendations were accurate.

MAM#1 is an incremental MAM with a target position Position_Target_1 of 1000.

MAM#2 is triggered when the .ActualPosition > 600.
The rung that executes MAM#2 first calculates the .Position argument as

Code:
Position_Target_2:= (Axis.ActualPosition + Stop Distance) - Position_Target_1

Consequently, MAM#2 is an incremental MAM with a target position Position_Target_2 of -200.

The axis runs from 0 to 800 and stops.

In your application I suppose you'll want the axis to stop at the original target if the triggering event happens within (stopping distance) counts of the original target, so account for that in your logic.

Remember also that the Motion Axis Stop command will interrupt a MAM, but it decelerates at a fixed speed, rather than adjusting its speed to decelerate over a fixed distance.
 
Last edited:
I thank you for the replies.

Ill be back at this this morning. I think I know what I need to do now based on the answers provided.
I will follow up wit my results later.


Thank you all.
 
I thank you for the replies.

Ill be back at this this morning. I think I know what I need to do now based on the answers provided.
I will follow up wit my results later.


Thank you all.

So looking a little more at this now I see a potential problem with the target.


Looking at Kens example. I see exactly how that's working now. My issue, is that the old machine we are working on isn't so precise. Its a drag chain and chain wear is already an issue.

The idea of me running 1000 counts, then interrupting with the event, is so I can cycle the machine from its last stopped point, detect a pin on the moving die and use that pin to initiate a move to a specified count and stop. I know the pin is always 200 counts to the target perfectly, but the center to center isn't always 1000 between dies on the drag chain. It varies. So the absolute target of 1000 given from the original MAM isn't relevant after the event fires the second MAM. It could be 100000 for sake of this experiment.
I need the second MAM to simply run 200 counts from whatever position it is when its issued.

Ill be experimenting with this some more this AM and Il post my results.

Hope this makes sense.
 
Thanks for that explanation !

Could you use a Motion Axis Jog (MAJ) instruction instead of a the-target-distance-doesn't-matter Incremental MAM ?

You could stop that MAJ with an MAS after a timeout, or a cancel button, or after a distance has been traveled without sensing that pin on the die.

If you start an axis running with an MAJ then execute an Incremental MAM with the merge function enabled and the merge speed set for "current", then the axis will stop after the incremental distance specified in the MAM.

The screenshot attached to this post is an example using virtual axes on a 1756-L61 v20. The positive direction constant speed motion was started by an MAJ, then I simply toggled a "Stop" bit at an arbitrary position to execute an incremental MAM with "Merge" enabled at the current speed. The motion axis stops at position = 889 units just because of when I happened to toggle the bit.

MAM_stops_MAJ.png
 
Yesterday was a good day with this.
An interesting day. I had this thing doing all sorts of motions, even run backwards at one point!


It did work out well.
I ended up using as discussed, the two MAM instructions. The big learning point here for me, was that after the MAM gave the initial target position, that I was able to give it a negative and subtract from the original target to define the new target. Once I realized this from the help of the forum, I was able to manipulate the math to give me the result I was looking for. Luckily, my work partner is better at math than I. I can always understand it, but making up a formula I find sometimes the hurdle.

Now that our math and logic is working, we get the machine cycle up about 6 units per minute from my original logic of MAM, run, stop, then jog to the pin, stop again.

Now we have discovered our next challenge. Making all the pins the exact same length! Some are slightly longer than others and it relates to the accuracy of our stopped position. Just flags the prox sooner. So, all new pins now are needed from the machine shop instead of the random bolts that have been in this old machine for ever.

I thank you all for replying with such great advice!
 
Last edited:
Thanks for that explanation !

Could you use a Motion Axis Jog (MAJ) instruction instead of a the-target-distance-doesn't-matter Incremental MAM ?

You could stop that MAJ with an MAS after a timeout, or a cancel button, or after a distance has been traveled without sensing that pin on the die.

If you start an axis running with an MAJ then execute an Incremental MAM with the merge function enabled and the merge speed set for "current", then the axis will stop after the incremental distance specified in the MAM.

The screenshot attached to this post is an example using virtual axes on a 1756-L61 v20. The positive direction constant speed motion was started by an MAJ, then I simply toggled a "Stop" bit at an arbitrary position to execute an incremental MAM with "Merge" enabled at the current speed. The motion axis stops at position = 889 units just because of when I happened to toggle the bit.

I might go to this actually. It just seems like it might be a bit simpler perhaps. As the MAJ would not need a target position. Then the MAM would always be 200. It takes the math out of the picture. I like this approach.
 
Which part number of input module are you using ?

You might be able to automatically compensate for different sized pin sizes if you have a fast input module that supports change-of-state (all 1756 series 24V DC inputs do).

You could set up the Input module for change-of-state on just the input point wired to the pin sensor. Configure an Event task that is triggered by the Input change of state of that module, and use both the rising edge and the falling edge to capture the .ActualPosition of the motion axis.

The difference between those will tell you the distance from the center of the pin to the end, which you can use to adjust the distance you want the axis to travel after the falling edge of the pin sensor input is seen.
 

Similar Topics

I've been banging my head against a wall for about a week now with a problem that seems to be a logical impossibility. The situation is this...
Replies
11
Views
4,673
Hi , Where i can find Mitsubishi PLC Card end of line & replacement model details. i am looking for Q02CPU replacement model. Please advice. thanks
Replies
2
Views
143
I have Allen Bradley plcs, I have had Circuit breakers and other automation equipment in the past. There's no solid buyers local. How much do you...
Replies
2
Views
216
can anyone has a good program to learn plc programming online. i have the basic looking into improve my skills thanks
Replies
1
Views
149
I want to monitor a couple signals in a place where there is no PLC but there is ethernet. I know I can use an AENTR or Flex I/O and a module but...
Replies
21
Views
803
Back
Top Bottom