lamboom

Transfer position control from a MC_SyncMoveAbsolute to a MC_MoveAbsolute RESOLVED

3 posts in this topic

Hi..  Still Trying to make this Position curve:

Tsunami_bmp.png.4ce55afb6994a9cd277eb0f8

Pay no attention to the glitch (arrow)  it's a different system (Think of it as inches not volts) .. this pic just shows what I would like to do with the NJ and a linear motor .. It's like 3 parts. first is a cosine move from zero to peak-to-peak (2 * Amplitude) of a position data stream from a MC_SyncMoveAbsolute fb.  The position holds for a few seconds .. then an MC_MoveAbsolute ramps the position slowly back to zero.

How hard could it be ... :-)

Here's where I am so far:

596ecb73d8a31_Tsunami_013.jpg.5e63a48752

set variables and select for an OFFSET if required:

596ecc9240ee1_Tsunami_010.jpg.a2659d2e22

596ecb9ba3f48_Tsunami_011.jpg.d440b4e4b8

 

596ecdc8f28dd_Tsunami_014.thumb.jpg.1575

Equation (6) generates the cosine position move .. the trick is to stop the equation when the max positive peak is reached.  IF-THEN tries to do that (TLim is a small value 0.001mm)  to make sure it's possible for FSine_Tsunami to be larger than 2*TsunamiAMP .. T_Hold starts the TON, and TsunamiRun (the command that started the sequence) goes FALSE.   Line 10 does stop the equation at the right time ...  it's what happens next where all hell breaks loose.  The next trick is to HOLD that last position for 4 to 6 seconds.  This just won't happen because there is no way to stop line (6) of the ST.  No way to freeze a position while still using the MC_MoveAbsolute, stop using it, and transfer control to a MC_MoveAbsolute.    This is my Question ... :-)

596ecdb3c00d0_Tsunami_015.jpg.daf2fef326

Delay_Timer.Q goes FALSE because Tsunami_Run is now FALSE (Rung 21)  This messes up the axis control by the MC_SyncMoveAbsolute fb. and the linear motor jumps negative a little; However, 4 seconds later, the MC_Move Absolute kicks in (RUNG 31) and returns the linear motor to zero (or Offset, if selected):

596ecdb9af318_Tsunami_016.thumb.jpg.0ec6

Everything gets Reset by rung 33 & 34

596ecdc47f54f_Tsunami_017.thumb.jpg.cbb0

Sooo.. this program doesn't work, and is certainly not the best way to make the position curve..   The one thing I could really use help with, is how to jump out of an ST equation for a Global Variable that's being generated by the MC_SyncMoveAbsolute .. hold the selected last position.. and transfer control to a MC_MoveAbsolute, to ramp back to zero or Offset.

Regards, Michael

Update:  this same post on PLCs.net has over 2200 views .. and, I did get some good help there (equation (6) for example .. unfortunately methinks there are no Omron engineers visiting PLCs.net very often.    Most Omron Engineers are very busy, and I can see why.  You do have to do some serious training at Omron schools, and years of internship .. there must be very few Omron Engineers out there.  I didn't know this, when i started the Omron project... sorry)

 

 

 

 

Edited by lamboom

Share this post


Link to post
Share on other sites

UPDATE ... This works... Sort of:

597219309fb82_Tsunami_019.jpg.78ed6c27db

597219aeb9d64_Tsunami_018.jpg.ec2008f042

59721956bbe3e_Tsunami_020.jpg.aff95d9168

The ST and the MC_SyncMoveAbsolute fb start at the same time, when the peak + is reached, StateTracker is incremented to #1), Stop_Tsunami goes TRUE, (rung 32), TCosine_Start goes FALSE (rung 29), and T-Hold goes TRUE (rung 30).  FB_SyncMove is disabled:

597219973aa6f_Tsunami_021.jpg.387d21ee0a

After 6 seconds of Hold, increment State Tracker to#2, which  enables Tsunami_ReturnRamp Fb, returning position back to zero:

59721ba72d48f_Tsunami_022.jpg.2147a5e17a

Tsunami sequence ends, MC_Stop is activated, and StateTracker is reset back to #0

59721e1775c9b_Tsunami_023.thumb.jpg.5064

 

This works nicely .. but it isn't with a flaw .. somewhere..   For TsunamiPer longer than 0.3 seconds, everything works as it should.  Shorter than 0.3 seconds, (higher velocites, and decelleration ...  The linear motor's slider, when first stopped at the peak + position ... doesn't HOLD, it moves quickly negative to the hard stop...and there's a FAULT ..

Could this be due to the way MC_SyncMoveAbsolute is "Switched Off" ?     

Here's a trace from the LinMot drive:

597232e3b8cbb_Tsunami_025.jpg.a4fcd33d26

Not too bad.. 0.4 sec. rise time to peak of 60mm... But look at what happens at an attempt at 80mm in 0.4 sec:

5972336087f01_Tsunami_027.jpg.9fb17daeaf

It does it... but control fails at the transition to "Hold" ... so much for holding,  .... YET, the NJ has no problem keeping control of a 154mm sine wave at 0.4 sec. period ..... To be continued  :-)

5972349b2abcb_Tsunami_028.jpg.408c9e30c8

 

 

Edited by lamboom

Share this post


Link to post
Share on other sites

The fix is two fold: 

1) the equation for only 1/2 cosine wave, is not practical, in that in one cpu cycle the position can go from + PeakMax to zero... The position equation must have a few extra points past peak + position ... so, this part of the equation:  SIN(Pi * Sine_Time ....  should be SIN(2 * Pi * Sine_Time ....  or at least 1.1  ...Just to let the IF-THEN statement catch the peak, before it drops to zero.

2) Best to use the ST version of incrementing the StateTracker variable rather then ladder in the adding of different cosine waves in series...  The ST: Inc(StateTracker) will get you out of an ST series, and into another ST series if needed.   But then, you already knew that if you took the Omron classes ... :-)    

Thanks for looking .... Regards, Michael

Edited by lamboom

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now