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

Dear Dirt...

Pondering your Position math .. Trying to figure out where "Period" enters into the equation (the elapsed time for a single complete cycle.)
I noticed you have a variable: Stage1_TimeFactor multiplied by 1000.0:

Stage1_Out:= Amplitude*sin(Pi*(time_to_real( Stage1_Timer.ET)/(1000.0*Stage1_TimeFactor))+(Pi*1.5))+Amplitude;

Is that like a Period? input 3 and the stage1 curve takes 3000.0ms?

What is the +Amplitude at the end.. to make sure we start at zero, rather than a minus max value? :) nice...

and.. That IF-THEN statement for when to switch to Stage 2:

if Stage1 and (Stage1_Out > (2*Amplitude-Stage1_Lim)) then
Stage2:=true;
Stage1:=false;
end_if;

I get it, we must not plot a position larger than 2 * Amplitude.

Wondering.. what is "Stage1_Lim" ?

I also get that 2 * Amplitude will not likely ever be reached "exactly" .. so, I assume we subtract some "small" constant each time before checking "larger than"?

When the time runs out at the "hold".. I'll just use a MC_MoveAbsolute Fb to go back to zero.

Thanks again.. will post the final Sysmac, Omron program..

PS.. I know this is simple stuff ... sigh!

 
Stage1_TimeFactor is Period/2 expressed in seconds. Just for me to play around. You can always substitute back to the original equation sin(x+1.5*pi) and change from there to what suits your task.

+Amplitude to make it go from zero rather than a negative number, yes.

Stage1_Lim is a small constant, in my case rather big (0.01) because of relatively slow cycle time :(:(
 
Last edited:
Stage1_TimeFactor is Period/2 expressed in seconds. Just for me to play around. You can always substitute back to the original equation sin(x+1.5*pi) and change from there to what suits your task.

Hi.. I was in the middle of editing the last post when you replied .. GADZOOKS! it's 1:30 AM where you are..

+Amplitude to make it go from zero rather than a negative number, yes.

Stage1_Lim is a small constant, in my case rather big (0.01) because of relatively slow cycle time :(:(

Thanks for the info.. ya know, I've found it hard to get example programs from Omron libraries .. Their manuals are more like references than tutorials... to be continued

I think this will be my equation:

SampleTimeSec := TO_LReal(TimeToNanoSec(GetMyTaskInterval())) * 1e-9 ... see: NJ Reference Manual W502-E1-18 pg.2-1457

1) SineTime_Tsunami := ModReal(SineTime_Tsunami + SampleTimeSec , Period);
2) FSine_Tsunami := Amp * SIN(( Pi * SineTime_Tsunami / Period) + (Pi * 1.5))+ Amp;
 
Last edited:
I dunno why I based the transition to hold stage on position.. If you know, which you do, the period time it's better base it on that. Easy fix :)
 
Hay Kvogel Thanks for the feedback.. Omron has ways of doing cam curves; however, I will need to modify the characteristics of the curves frequently .. especially in a museum, where kids are designing, and launching the waves, based on the physics of gravity waves, and their environment which effects propagation. You have to do this very fast and efficiently .. because the "ocean" is only 15-20 feet long! Good thing we now have instant high speed video playback.



to be continued ...

Apart from the programming software editor, the Bosch has several function blocks that can be used to create and modify the cam curves, I would assume that the Omron does as well.

Ken
 
Apart from the programming software editor, the Bosch has several function blocks that can be used to create and modify the cam curves, I would assume that the Omron does as well.

Ken
Can the Bosch controllers generate the cam tables in real time so that there is no gap between cam tables and the motion is smooth as the controller transitions from one cam table to another?
 
Apart from the programming software editor, the Bosch has several function blocks that can be used to create and modify the cam curves, I would assume that the Omron does as well.

Hi Ken.. I bet you are right .. probably a better way to go.. I'll look into it if this approach fails. I just wanted to try it with an algorithm for the MC_SyncMoveAbsolute position streaming function block.

Regards, Michael

Good Question Peter.
Frustrating that I'm not getting emails when someone posts here .. always worked in the past.. anyone know how to contact the Forum administrator?
 
Last edited:
Can the Bosch controllers generate the cam tables in real time so that there is no gap between cam tables and the motion is smooth as the controller transitions from one cam table to another?

That I don't know because I have never needed to try. There are a number of parameters that can be used to determine how the cam is entered so you should be able to get a smooth transition. I have not attempted to edit the table while the cam is running.

The cam is generated in real time. I use a cam section triggered by an external sensor that caused the stroke to change every cycle. I'm not sure of the mechanism of how the cam table loads into the cam function block. ie: if the cam table is used directly or if its loaded at the execution of the function block.

Ken
 
Mathematicians would call a basic cam table a cubic spline. Here is what is involved.
http://www.aip.de/groups/soe/local/numres/bookcpdf/c3-3.pdf
However, this document only covers the basic. The documentation doesn't explain how to make both the velocity and acceleration at the end of one spline match the beginning velocity and acceleration of the next spline. Usually one can match the velocity or acceleration but not both. A lot of controllers have cam tables or splines but few implement them so the velocity AND acceleration can be controlled at the end points.
 
So how do you do it?

Still not sure what you are after. Why don't you just use the MC_Move function blocks with the right values for velocity, accel, and decel?
A sine or cosine wave does not have a constant velocity or acceleration section that lends itself to a function blocks or commands like our MoveAbsolute or Rockwell's MAM where constant velocities and accelerations are provided.

The trickiest part of a motion controller is the target generator.
 
The positional moves in my plot were made using an Exlar Tritex, about as simple a motion controller as you can find. I could do the same moves with MC_Move function blocks. I think you guys are thinking too hard...
 
The positional moves in my plot were made using an Exlar Tritex, about as simple a motion controller as you can find. I could do the same moves with MC_Move function blocks. I think you guys are thinking too hard...
NO, your example is a good one if a second order or parabolic move is OK. It is a few terms short of a sine or cosine wave. The motion profile you show uses linear ramps or constant acceleration ramps. There are no constant accelerations in a sine or cosine.
 

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
540
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
598
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
951
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
861
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,668
Back
Top Bottom