Don't want an "S" curve..need a cosine curve

It's all about efficiency, and getting the water to move as it naturally would ... When the tank is very long.. the method used to make the wave isn't so important, after a few cycles.. water particle motion becomes correct for a gravity wave.. but it might carry some parasitic waves along with it. The trick is to transfer the energy from the wave maker to the water in the most efficient way, so that particle motion is "natural" in the shortest distance from the wave maker, especially if the tank is short. (museum) .. A moving wall is not efficient for regular waves, but, isn't too bad at simulating "Impact" tsunamis, such as caused by sliding land mass, or comets hitting the ocean. A "cosine" move is essential for efficiency.
 
Because of the amazing number of views here (now over 2000!) I'm going to show some of the ladder & ST used in this cosine quest:
Here a wave type is selected, and a delay is used help qualify the rungs that are used for that wave. If an Offset is required, that is done first:

Tsunami _011.jpg
 
Then run position data stream ...line (6)

The tricky part is jumping out of that equation when it reaches the max positive peak .. can't do it with an IF-THAN , so I'm using a "Greater Than Or Equal TO" expression.. to cut off the ST and start a TON (Timer) for 4 seconds.

Tsunami _008.jpg
 
The MC_MoveAbsolute would then kick in and move the slide from wherever it is, back to Offset.

But, there's a conflict.. The MC_SyncMoveAbsolute is still active, even tho the position data isn't changing any more.. it is still there in memory .. so, I expected it to be the means that "held" the position at +Max Amplitude. But there's an eventual transfer from that function block to the MC_MoveAbsolute Fb.. for the ramp back to "Offset"

The result is ugly... the slider rapidly moves negatively after reaching +Max, and moves past offset into the hard stop... sigh.. back to the books. (I might try a "invert" Stop_Tsunami) in rung 32)

Tsunami _009.jpg
 
Last edited:
It would be interesting to see a plot of the target and actual positions. I don't see the actual position output on any of the motion blocks.

I think it is a must that the target and actual positions as well as the control outputs are available for plotting.

Actually, the plot of desired position vs actual position is available from both the LinMot Drive (which shows excellent PID tuning) and the Omron NJ which can also plot any of the variables like CSine_mm (which is the position variable) and the actual position, which the NJ gets continuously from the LinMot via EtherCAT. It can even provide a 10 second spread sheet of actual variable data every 1.0 ms ..

The important thing to remember here.. is this problem of mine is only one of programming skills with Sysmac Studio, which I am lacking. sigh! The only people that should be looking at this thread are Omron Engineers. Omron's written support on the NJ controller rivals the Library of Congress .. Manuals that if printed, and stacked, would reach the ceiling.

As I've said before.. your company did an awesome job in making programming incredibly intuitive. No problem doing damn near anything with the RMC75E... My first question was simply how to formulate an equation that would draw a 1/2 cosine wave, similar to a "S" curve.. Dirt, on this forum, showed me how to do that. Now, all that's left is a question for Omron: How do I stop that equation, hold for 4 seconds at the last position (which is the max positive, same as 2*Amp of the cosine wave)... then turn off the function block that created the cosine move .. and jump to a MoveAbsolute function block to ramp the position back to zero. BTW... there are no negative moves here. Nothing goes below zero.

With all the views on PLCs.net (over 2000) I was hoping there was an Omron Engineer about ... so far, my requests for help from Omron, on this question, have not been answered... But, I expect that help from them will eventually come.

Thanks for your interest, and past help... always appreciated..Regards, Michael
 
Last edited:
Dear DIRT

Your equation worked great for the Cosine position move: Line #6 in the ST above. Now, I'm trying to make just one cycle of a sine wave.. OR a single cycle of a cosine wave.

A Sine wave would start at zero, move to + max amplitude, then go down to - max amplitude, and come back to zero... and stop.

My Cosine wave would start at zero and move to + (2*Amplitude), then back down to zero ... and stop, one cycle only.

I want to be able to connect 3 sine waves of different amplitude and period together, one after the other. ... and the 3-wave sequence can be either all positive positions, or +&- zero moves of sine waves.

I'll try the +&- sine waves first... then, as we did for the Tsunami, I'll add amplitude to the end, and offset the position curves up with all positive values.

Here's the Question: Do you know a good way to use the IF-THEN statement to jump away to the next curve after the 1st curve completes 1 cycle?

Here's the way I'm making the Tsunami wave with the NJ:

Tsunami _029.jpg
 
What isn't shown, is that "Stop_Tsunami" triggers a HOLD for a time (HMI input) and then returns the position to zero, and awaits any changes in amplitude or period..for a re-run.

For the Rogue wave, 3-wave sequence ... If I used a simple Sine wave in the ST, like this: FSine_Wave1 := Wave1_Amp * SIN(2 * Pi * SineTime_Rogue1/RoguePer_1) That equation would make a wave starting at zero, and make infinite sine waves + & - about zero. But, I just want the first cycle.. :)

Same for your Cosine wave above... In the IF-THEN statement, I can't imagine setting up a cycle counter an trip exit at the first count. Perhaps exit after SineTime_Tsunami = 1.0 (in the Tsunami equation)

Would love some ideas on making single cycle waves... Regards, Michael
 
I would use: FSine_Wave1 := Wave1_Amp * SIN((2 * Pi * SineTime_Rogue1/RoguePer_1)+ (Pi * 1.5)) Then for a Cosine sequence .. add the amplitude at the end:
FSine_Wave1 := Wave1_Amp * SIN((2 * Pi * SineTime_Rogue1/RoguePer_1)+ (Pi * 1.5))+ Wave1_Amp

But.. what to put into the IF-THEN statement for exit to Wave2?
 
Here's some results of trying the above.. and there has to be an issue with the IF-THEN statement?
This rung in the program: (1st picture), produces the following Trace.
(Can't figure out how to post a picture, then write a note under it..

Tsunami _032.jpg
 
Good news is, only one curve is made; bad news, the next curve isn't activated.. methinks there's something wrong with the IF-THEN: (Stop_Rogue1:=TRUE) is supposed to do that, and start the next curve .. kinda like in DIRT's Stages. If the IF-THEN looks OK, then it's a programming problem which I'll work out. I assume you can stack statements like line 10 & 11?

Tsunami _031.jpg
 

Similar Topics

I have been reading everything I can find on the P_LLS the last 2 days but I am still having trouble understanding how the P_LLS swaps beyond 2...
Replies
9
Views
568
In OB1, I'm monitoring some values (first pic). The values are what I expect. At the same time, I'm monitoring the same values in the DB where...
Replies
1
Views
645
Maybe I am the last to know but Rockwell has put an EOL date on the 3 motion modules at the end of 2024 but maybe sooner. I know this will affect...
Replies
1
Views
960
On the laser displacement sensor now connected to my PLC, the manual says 4mA=643 and 20mA=64,877. However, I checked with a Fluke, injecting...
Replies
5
Views
884
I'm from a Mitsubishi Q-series background so excuse my ignorance. In Mitsubishi world, in my experience your Mbits (booleans) are just M1, M2...
Replies
20
Views
2,755
Back
Top Bottom