lamboom

MrPLC Member
  • Content count

    185
  • Joined

  • Last visited

Posts posted by lamboom


  1. I’m using a Omron NJ to manage a LinMot linear motor .. all is going very well; however, there have been a few times during this development phase when the actuator, or programming creates a fault, perhaps from a following error, or exceeding a limit.  The result is sometimes scary.  The actuator might accelerate into a hard stop.  Not a big deal, the ends are protected with Sorbothane, so it isn’t a big problem .. yet.  Once the system is correctly programmed, it shouldn’t ever accelerate an actuator into the hard stops.

    In spite of my newbie-ness  to Omron programming I’m aware of the need to employ error & fault action that will stop a run-away actuator in closed-loop control, rather quickly. Just how to do that.. has evaded my research.

    I’ve noticed:  “FaultHandler”  in the W507 & W508 Manuals. And, been quite frustrated to not find any reference to FaultHandler or FaultHandeler()  .. which kinda suggests it’s a program?… and also expected to get some clues in the "NJ Programming Best Practices V1.1”  

    so far… no luck.

    Perhaps I’m going about this all wrong..  The LinMot Driver Controller might be the way to go.. An error message from the NJ to the LinMot drive would quickly shut down movement in closed loop .. instead of turning the motor into a rail gun… :-)

    Any suggestions at how to do it with the NJ,  would be greatly appreciated.. Thanks Regards, Michael

    PS: here’s the progress so far, thanks to many out there, and on this forum ...

    https://www.youtube.com/embed/B0UGm9JTw3U?rel=0

     


  2. Thanks Nj Controls .. I posted this on PLCs.net Forum too.. just in case no one took me seriously here.. It's kinda a basic question.. :-)

    Turns out one shouldn't use C programming for a position control program from an HMI.. there are unintended consequences in the HMI for loops which are paused to await a condition before continuing.   This program is easily done in the Motion Controller, which has "wait for" conditions available in it's "user programs" (the ones you write)  The Red Lion uses programs that can be called from the HMI's pages. Those programs must be written in basic C.    Using loops that wait for position conditions which are initiated by the HMI, by sending parameters and a start command to a Driver/Controller .. is not recommended.    

    However, some of the suggestions I got on PLCs.net were to use 

    while ( !inPos )
    {
    // do nothing
    }

    for a wait .. but that could end badly.. but would work if all went well.

    Or:

    switch Step {
    
    case 0: if start then 
            issue Home();
            Step:=1;
            Break;
    
    case 1: if Homed then
            issue MoveAbsoluteToZero();
            Step:=2;
            Break;
    
    case 2: if Inpos then 
            issue Sinewave();
            Step:=3;
            Break;
    
    case 3: if Abort then 
            issue Stop;
            Step:=4;
            Break;
    
    case 4: if Stopped then 
            Step:=0;
            Break; 
    }

    Not exactly..but something similar should work.


  3. Anyone ever used a Wait-for digital tag in a C Program?

    I have to use C in the Red Lion Programs.. but, I'm not at all proficient in C (or anything else for that matter ..)

    Here’s a nice problem for basic C programming .. I really need to solve it .. but, so far ... can't ... sigh!:

    I have an actuator that will be commanded to make sine wave motion.  The program that does that, in the actuator’s driver-controller, requires the actuator to first be in a zero position.  Homing has already been done, so the drive knows where the actuator is.  I cannot modify the sine wave program; but, can command a Move Absolute program in the drive, to take the actuator to zero, if it isn’t already there.  When the actuator is at zero, it is “In position” and a digital tag will go True. If the Tag is False, the actuator is not at zero, it’s at some other position,  and only the Move Absolute program can return the actuator to zero.

    So, when launching this position command program, In a Red Lion G3 HMI, using only Basic C programming, how would you write a control program that would test the status of the actuator’s position, and, finding it at zero (the “InPos” tag is true) would start the Sine Wave program.  And, If the “InPos” Tag is false, would start the Move Absolute program, which would return the actuator to zero, and when the actuator is In Position, would start the Sine Wave program.

    Here’s the tricky part. It will take only a few milliseconds to start the Move Absolute program (if required) .. but how do you get the “C” control program you are writing, to wait until the actuator actually reaches zero, and the “inPos” tag goes true … which could take several seconds?

    I don’t believe there is a WaitFor function in “C” , and you cannot send either the Move Absolute, or the Sine Wave program more than once .. so, if a loop is used, it can loop only one time .. presumably with conditional delays. (however that's done)  You cannot use Sleep().. that would be cheating.. the full program must run in the least amount of time, and you do not know how far the actuator is from zero.

    You could use if (! InPos) or if (InPos) to qualify what programs to run .. but, where does the “Wait for In position”  fit into C Programming?  You might be able to use Continue .. but, ya still have to wait for “InPos” to go True…..before running the Sine Wave.       Thanks Much, Regards, Michael


  4. Perhaps I can help ..  I said earlier .."And, I'm going to Omron to get away from Siemens."  

    This implied no comparison between Omron NJ and Siemens S7-1200 .. they are quite different after all...  However, where they are NOT different, Is the complex and expensive manor that firmware upgrades are performed ...  I think Crossbow thought I was comparing the CPU's  :-)


  5. Thanks for the reply Joe

    PROBLEM SOLVED... The reason was not expected .. and worth sharing.    There were many good articles out there on how to manage the Windows Firewall .. but that wasn't the problem.

    There were two identical computers, each was to be able to communicate with the HMI (not at the same time)  One could do it, the other could not. The HMI's IP address is set by configuration software created by the PC, and downloaded to the HMI.   That IP address was 192.168.0.20    Neither of these two PC's had made the original download.   I looked at the LAN static IP address for both PC's, and it was 192.168.0.105

    Then I checked (using NetSetMan) the IP address of the PC's WiFi ... One was 192.168.0.19 (the PC that worked) ... and the other was 192.168.0.20 (the one that didn't work)

    Could there be a conflict?  Two different networks: one trying to communicate with to an IP address over LAN, which is the same as the PC's WiFi  DHCP IP Address?    REALLY?

    So I turned off the WiFi (little switch on the side of the PC),  Powered Cycled the PC ...  And The communication worked.

    Well, I liked having the WiFi active .. almost never turn it off   So, I re-sent the HMI configuration software with a new IP address for the HMI: 192.168.0.25  And now both PC's communicate just fine with the HMI.. with the WiFi on and working too... :-)

    PS.. I do have to turn the WiFi off when running a full Virus Scan with System Mechanic .. otherwise SM will crash .. but that's another story.

     


  6. This is a problem that shouldn't happen .. It may be due to a defective Network port in the PC.

    Basically, it's easy to connect to Red Lion G3 HMI's.. using USB, or Ethernet.   Unfortunately there is a flaw with the G315 processor.. and you cannot connect with newer PC's via USB .. and there is no FIX.   However, connecting via Ethernet should be quite easy .. and, I'm able to do it with several old and newer PCs' .. EXCEPT one:   A Dell Latitude E6410.  

    I don't need help with the Red Lion programming to enable Ethernet communication via TCP/IP ... That's kinda straight forward. (sorta)

    What I need help with is... what's wrong with my PC ..?  sniff!      I have two similar Dell's  .. one is an ATG model... I've set the fixed LAN IP address the same in both (192.168.0.105).. and I've set the HMI's Ethernet port (789) to an address in the same subset: 192.168.0.20  ...   The E6410 ATG communicates no problem.. the other E6410 ..communication fails.  Everything seems identical in both PC's (well... not totally .. the LAN cards might be different)

    Anyone ever had this connectivity problem where only one of two identical PC's can connect via Ethernet?

    Thanks Much...

    PS: perhaps a suggestion on troubleshooting a LAN Network card?

    OR..Firewall blocking the HMI connecting...  ?  


  7. INNO  .. You are awesome...     I just tried writing that program yesterday.  Tyler Corbett (Omron Engineer, Canada) told me about "SetVariable" yesterday.  I can't believe I missed that when I looked over the list of "Actions" in "Events and Actions" ... (I have that same problem when I'm looking for a specific item on a menu ... sigh!)     My first attempt WORKED!    .. I didn't try to make the NJ side variable to go FALSE when the page does away .. you just showed how to do that ..  my first job this morning, with coffee .. :-)      Life truly has meaning

    Tyler also presented some good info on going the other way.. where the NJ is controlling the pages on the NA HMI ... Nice!


  8. On Page 8 of NA Practices Guide ..Omron manual V422-E1-01 .. Last question:  "Is it possible to switch the screen from the PLC? Is it also possible to report the current screen from NA to PLC?"     Someone asks  a two question, question, and this is the only answer:

    "On the NJ, specify a String-type variable and assign it to “_HMI_CurrentPage”, a system variable that specifies the current screen. You can change the screen by entering the name of the destination screen in the variable assigned to the system variable. If the address values are directly linked with the page numbers as in NS series, you must write Visual Basic".


    This answer probably means something to someone who already knows how to do it ... but, it's not much help for me.  I get that you create a String-type variable: select STRING[256] under the Type column.. But, what does it mean to "assign it to this system variable: "_HMI_CurrentPage"  .. the answer seems only to answer the first question, and ignores the second question.. which is the one I'm interested in....  Do you know the answer to the second question?  :-)

    PS: I think it's in the NA's Variable Maping .... working on it...

    EDIT.... Nope.. nothing there.. that's just for calling pages from the NJ software...   I want to work with input variable data, and display of resulting variable data on that same page; because, the input data creates the output data.  an' I don't want to push some "Equals" button that activates an ST rung.. I want the ST rung to be auto activated by the "existence" of the current page ... "_HMI_CurrentPage"  or something like that....???   Thanks, Micheal


  9. More Example:

    DSC01505.jpg.b14b18a8b9fe3e9bbe0eed14553

    I’m going to make a Regular Wave, I input 85mm for a height, and 0.68 seconds for the wave period.  instantly, if something is already in the SCALE data input (200), the Full Scale Height in Feet (55.8), and the Full Scale period (9.62) would be quickly displayed in the data display windows… yet the axes hasn’t run yet  (Start Regular Waves) …   

    How can I get these Full Scale data displays to work before the axis is run?     

    PS:  You can see that they work fine, after the axis is run …. :-) .. thanks to memory of variable data….

     


  10. On 7/26/2017 at 6:58 AM, Crossbow said:

    You can make any variable you want in the HMI's global variables list.  And you can use a script to turn on and off when a page is displayed.  There's no 'automatic' variable that turns on.

    You sayin' I would have to use Visual Basic to create a script to make a special variable TRUE  ... hmmmm...  what's the indicator in software, that a particular "page" is "ON, or TRUE ?

    (remember I'm a bit of a newbie here.. sorry     FYI.. I did finally figure out the last 2 wave sequences, with some Tsunami help from "Dirt" on PLCs.net

    https://www.youtube.com/embed/B0UGm9JTw3U?rel=0

     


  11. Thanks Crossbow .. I remember reading something like that .. You have to map page numbers 0.1.2...  to the page names ..  It wasn't real clear how that would help do what I wanted.    But, that idea of a "script" that turns on and off looks good...  I'll research Scripts in those manuals...

    I'm looking for a way to set values or binary states to variables, depending on what "Page" was displayed on the HMI ...

    As an example, when I input values on a page like "wave height", and it might be in feet,  There would be another data display object (on the same page) that indicates the height in millimeters; however, that display in mm, would be based on a "Scale" factor.... like 1/200  or 200.   "Scale" would also be a data input on this, or other HMI page.    I would like the data displays to be "live" .. so that when a scale and a wave height is input as data, the wave height in mm, is displayed.    No axis program is running yet.  The HMI page is live for inputting and displaying variable data; but the CPU isn't doing any servo controlling ...

    I need a way to display variables that are calculated from inputted variables.  I need a small program to go live when a page is displayed, and always be calculating, and displaying different variables on the same page.         Basically, you input something, and other data displays on the same page, change in response.   Because, they mathematically depend upon the values of the variables you inputted.

    I would like to see them, before running the axis.  

     


  12. Hi.. an easy question.. which I can't find an answer too .. in the 2 manuals:  V421 and V422 ...:

    "Can you make a variable that goes TRUE when a particular page is selected, and "live" on the HMI screen?"

    Yes, it's easy to map NJ variables to the objects on the HMI pages...  Yet, It's not clear how to create a variable for a "specific page".. so it is TRUE when that page is on screen.

    I'll keep looking .. and post what I find, in case no one posts the answer ... thanks   Regards, Michael


  13. 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


  14. STATUS:    Changed to using State Trackers  .. That worked well .. No clunks, and the sequence runs fine; but, only up to a point.  There is a point at short periods (0.3 sec) to the positive peak of the cosine ramp up, when the control fails and the linear motor runs away negatively into the hard stop. (have nice shock pads for that.. :-)    This may be due to the position equation itself.  By creating only 180 degrees of motion mathematically ( SIN(2 * Pi * Time increments/Period) + 270 degree Offset)  The 2 is not in this equation)  The equation is only for a half cycle...  perhaps it should be in the equation... or something a little larger than 1 .   Because, the "end" timing is too critical.  In only one CPU cycle, (0.001sec) the curve will go from + peak(max) to zero!.     Probably, better to make the cycle go slightly past + Peak(max), but try to catch the + Peak(max) with the IF-THEN statement.  

    UPDATE:   RESOLVED... both Tsunami and the Rogue wave series:

    59750d07551ac_Rogue_009.jpg.d8bba9a4a95b

    Found a way to use Inc in ST ..  makes for easy jumping to various states.. or stages.. :-)    Thanks all!


  15. 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

     

     


  16. Tried some other options .. also didn't work well .. one thing for sure,  the equation for FSine_Tsunami is correct ..it provides a new position every 1.0ms to the LinMot Drive.. That part is working well.. just things go badly after the position equals (2*Amplitude) .. the peak to peak value of the 1/2 cosine plot.

    596fb859afc2c_Tsunami_014.thumb.jpg.2af9

    Using an IF-THEN to jump out of the position calculation.. Turn off the ST (which is not a good idea.. but, what else)  The T-Hold starts a timer for 4 seconds, below:

    596fb95204056_Tsunami_015.jpg.84774a363a

    Turning off Tsunami_Run also kills Delay_Timer.Q .. which powers off the MC_SyncMoveAbsolute with brute force .. probably should use MC_STOP,  but that brings problems too.

    This causes the linear motor to jump a little in the negative direction, but 4 seconds later the MC_MoveAbsolute fb kicks in and the position ramps to zero or Offset, if an offset is selected.   After the return to zero, MC_STOP is activated by TON:

    596fba5a9467f_Tsunami_016.thumb.jpg.f95d

    MC_Stop is reset by TON:

    596fbae4c0917_Tsunami_017.thumb.jpg.9752

     

    This still doesn't work... because there isn't a way, known be me.. that will permit this sequence of moves to be done in 3 stages.  Omron doesn't have stages.. but, it does have tasks... perhaps, i should look into that more closely... to be continued..

     

     

     

     

     


  17. 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)

     

     

     

     


  18. Hi Michael ...  Glad you are still out there... When you can.. this is what I've got so far:

     

     

    596e5a6ca6545_Tsunami_010.jpg.33576526cd

    596ccf203ce1f_Tsunami_005.jpg.e048b9ed71

    596e5a5535de5_Tsunami_011.jpg.861c613e74

    Line  6 generates the cosine curve, and makes all points positive because of the + TsunamiAmp at the end  (help from "Dirt" from Stockholm, on PLCs.net) ...

    596e554ee3285_Tsunami_008.thumb.jpg.8788

    596e5578348de_Tsunami_009.jpg.a3a54d8049

    I tried an inverted "Stop_Tsunami" to turn off the MC_SyncMoveAbsolute Fb.. but.. it didn't work...

    Interesting that there doesn't appear to be a way to jump from an ST line to a ladder rung...  or from an  IF   FSine_Tsunami => 2*TsunamiAmp  (or PeakToPeak) THEN stop calculating FSine_Tsunami and hold at that last position...& start a timer ...  how hard could it be...

    I'm trying to jump out of the ST when the cosine wave is finished, and hold for 4 seconds

    This program almost works .. :-)

    The cosine wave starts at zero (+ a small offset) and, I believe reaches the max positive (2 * TsunamiAmp) .. The GE instruction (Greater than or equal to) should go true when the peak positive is reached..  But, this probably isn't the correct way to stop an hold a position when using a MC_SyncMoveAbsolute.

    The TON is intended to hold for 4 seconds, then trigger a MC_MoveAbsolute from wherever the hold position is,  back to the offset.

    instead, when the cosine move should stop ....  the motor quickly moves negatively to the hard stop, way past the offset, or zero position.  sigh!

    Ya think this has something to do with pulling the plug on the ST that's running the position stream to the MC_SyncMoveAbsolute?   That function block is still on, and generating position data... but, the data isn't changing .. it should be: Offset+ TsunamiSine , which should be Offset + (2 * TsunamiAmp) .. The last calculation of that ST line (6) would be the max positive position (2*TsunamiAmp)

     

     

     


  19. Doesn't look like anyone is gonna comment on this post ..  I guess this Forum is mostly for the professionals .. That's OK..  I'll keep reading the manuals .. :-)

    Looks like this should be done in three rungs of the ladder .. I'm close to figuring out how to make the Cosine position curve above.. Got some good help on PLCs.net Forum

    working now on the way to "jump" out of the calculation for the curve when the amplitude equals 2 * Amp..  .. Sure, might use an IF Amplitude < (2 * Amp) THEN quit calculating the cos curve, and hold for a while (go to a TON,, then after a few seconds.. use a MC_MoveAbsolute to get back to zero... but, ya can't use a "Jump" in an ST IF-THEN expression.

    Even  if one could use a "Greater than or equal to" FUN in Ladder ... How you would stop the position equation at a paticular point ,   continues to elude me...    Later.

     


  20.  

    4 hours ago, Crossbow said:

    Consider writing logic that does the control you want, but on a number in a variable, nothing to do with an axis.  Then you can use that value as the target location for MC_SyncMoveAbsolute to move an actual axis to that particular position every single program cycle.  So as the value changes, the function block causes a move each and every PLC scan.  You need to account for accel and decel in the logic, because that function block just says each scan 'ok go here now'.

    Thanks... I'll give it some thoughts ... What you are saying, is exactly what is happening now with the running of the Random Sea, which is one heck of a lot more complicated than a single simple "S" curve.  I might be wrong but MC_SyncMoveAbsolute doesn't care about velocity or acceleration as an input.  It's just going to a new position every 1.0 ms, an' it's going to do what ever it takes to get there in 1.0 ms ..    So, it's really all about position as a function of time.  A position is determined mathematically every 1.0 ms (CPU  Cycle) .. The resulting curve will be a Cosine .. some of the points will be closer together, others will be farther apart.   If the curve lasts 0.5 seconds, there will be 500 points defining that curve.  

    I've written the code to make sine waves (cosine waves.. same thing just 90 degrees out of phase with sines)  .. Now to make the code that creates just a part of a sin/cos wave .. the part that goes from -1 to +1  ... How hard could it be?  :-)         ....well... it's very hard for me.... sigh!

    Pay no attention to the glitch (arrow):

    Tsunami_bmp.png.ea061a46a9d6ce76a190c3df The perfect sequence (without the glich)


  21. Hi again... more information about the objective.

    Wanted to explain the problem better:
    Imagine this Sequence: A typical "S"curve ... generally starts from zero accelerates by a specified amount, then moves at a constant velocity until nearing the end point of the move, where it decelerates by a selected amount and stops at the "end point" .. a distant positive value. Then after a few seconds, another move, slower than the first slowly ramps at a constant speed back to zero... and, awaits the next move programmed and launched by a NA HMI

    That sequence is what I'm trying to do.

    In Ladder (Omron), you would probably use the MC_MoveAbsolute function block to make this move. Very easy, and almost intuitive... default_smile.png

    But.. what if that "curve has to be a "cosine wave"? It starts at zero and moves to the positive end position, and only the "path" is programmed, not the velocity or the acceleration.
    Now you would have to use the MC_SincMoveAbsolute fb. And the "path" would be calculated in ST .. with the only inputs from the HMI as "Amplitude" and "Period". The final positive end position (amplitude), and the time (in seconds) it would take to get there.  As we are not moving in a complete cycle, only a half cycle ... the "time" could be thought of as half the period.
    This is some brute force programming, I cannot do .. yet default_smile.png

    I can generate a sin or cos routine in ST (With some help from Tyler Corbett):

    (1) Pi:=3.141592;
    (2) SampleTimeSec:=TOLREAL(TimeToNanoSec(GetMyTaskInterval()))*1e-9;
    (3) SinTime:=ModReal(SinTime+SampleTimeSec, Period);
    (4) FSin:=(Amplitude * SIN( 2 * Pi * SinTime/Period);
    (5) Sine:= Sine + Fsine


    The global variable Sine is sent to the Position input of the MC_SyncMoveAbsolute (or some Final_Move sequence in ST)

    Now, The trick is to use 1/2 a Cosine wave (a 90 degree phase shift of a sine wave), and only use the first 180 degrees of the wave.. where it goes from zero to maximum positive (yes, it really goes from -1.0 to +1.0 .. but.. there will be an final rung for OFFSET (6) Final_Move:= Offset + Sine so that all moves are positive)

    This equation must run only once, unlike the above example which would run forever. After doing that one move.. there is a time delay (TON) then the position ramps slowly back to zero .. and waits for another run.

    I'm asking for any programming ideas that would control the equation for using only a half cycle.. which starts at zero and moves positive to the input: Amplitude. I don't expect the actual program.. just some text explaining a good method to control the process. Please.

    I assume the COS instruction would work just as well .. I just don't know how to use the best instructions to control the position equation...

    Thanks Much, Regards, Michael

    PS:   The equation (4)  isn't the problem.. to be clear ... My problem is in managing the equation in ST or Ladder programming .. something most everyone here is well versed in.. 'cept me.

    I'm imagining IF-THAN, and other expressions that will start and stop that equation's position feed to the ME_SyncMoveAbsolute function block which is talking to the LinMot drive via EtherCAT.
    Tsunami_bmp.png.a77c3f0342dd491bf016e4ecThe perfect sequence (with out the  glitch)                          

    There are 3 moves: the cosine SyncMoveAbsolute, the Delay and hold, and the MoveAbsolute back to zero

     


  22. Hi Crossbow... Thanks for the reply.   Cause I'm an idiot .. :-)     I figured it out .. and posted a last sentence above in an edit...  It must be frustrating trying to help people who are not well experienced in this science.   I am truly sorry I am quite limited in understanding Omron programming, and Sysmac ... The manuals are very confusing as tutorials .. they seem to be mostly "references" ..  I do appreciate "all" of your comments...  REALLY! ... :-)   

    Check this out:

    https://www.youtube.com/embed/gGzp7HURBJE?rel=0&amp;controls=0&amp;showinfo=0