Lamboom
Lifetime Supporting Member
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!
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!