You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old July 14th, 2017, 05:37 PM   #46
Lamboom
Lifetime Supporting Member
United States

Lamboom is offline
 
Lamboom's Avatar
 
Join Date: Mar 2014
Location: Fallbrook, Ca
Posts: 228
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!

  Reply With Quote
Old July 14th, 2017, 06:13 PM   #47
Dirt
Member
Sweden

Dirt is offline
 
Join Date: Apr 2008
Location: Stockholm
Posts: 91
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 by Dirt; July 14th, 2017 at 06:18 PM.
  Reply With Quote
Old July 14th, 2017, 06:37 PM   #48
Lamboom
Lifetime Supporting Member
United States

Lamboom is offline
 
Lamboom's Avatar
 
Join Date: Mar 2014
Location: Fallbrook, Ca
Posts: 228
Quote:
Originally Posted by Dirt View Post
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..

Quote:
+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 by Lamboom; July 14th, 2017 at 07:20 PM. Reason: correction
  Reply With Quote
Old July 14th, 2017, 06:54 PM   #49
Dirt
Member
Sweden

Dirt is offline
 
Join Date: Apr 2008
Location: Stockholm
Posts: 91
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
  Reply With Quote
Old July 14th, 2017, 07:02 PM   #50
Lamboom
Lifetime Supporting Member
United States

Lamboom is offline
 
Lamboom's Avatar
 
Join Date: Mar 2014
Location: Fallbrook, Ca
Posts: 228
I like that decision to hold on position.. nothin' wrong with that :-)
  Reply With Quote
Old July 17th, 2017, 07:50 AM   #51
kvogel
Member
United States

kvogel is offline
 
Join Date: Jan 2011
Location: Colorado
Posts: 42
Quote:
Originally Posted by Lamboom View Post
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
  Reply With Quote
Old July 17th, 2017, 09:41 AM   #52
Peter Nachtwey
Member
United States

Peter Nachtwey is offline
 
Peter Nachtwey's Avatar
 
Join Date: Apr 2002
Location: Vancouver, WA, US
Posts: 6,531
Quote:
Originally Posted by kvogel View Post
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?
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon
  Reply With Quote
Old July 17th, 2017, 09:42 AM   #53
Lamboom
Lifetime Supporting Member
United States

Lamboom is offline
 
Lamboom's Avatar
 
Join Date: Mar 2014
Location: Fallbrook, Ca
Posts: 228
Quote:
Originally Posted by kvogel View Post
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 by Lamboom; July 17th, 2017 at 09:49 AM.
  Reply With Quote
Old July 17th, 2017, 10:06 AM   #54
kvogel
Member
United States

kvogel is offline
 
Join Date: Jan 2011
Location: Colorado
Posts: 42
Quote:
Originally Posted by Peter Nachtwey View Post
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
  Reply With Quote
Old July 17th, 2017, 10:33 AM   #55
Peter Nachtwey
Member
United States

Peter Nachtwey is offline
 
Peter Nachtwey's Avatar
 
Join Date: Apr 2002
Location: Vancouver, WA, US
Posts: 6,531
Mathematicians would call a basic cam table a cubic spline. Here is what is involved.
http://www.aip.de/groups/soe/local/n...kcpdf/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.
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon
  Reply With Quote
Old July 17th, 2017, 07:29 PM   #56
Highland Controls
Member
United States

Highland Controls is offline
 
Join Date: Oct 2012
Location: Richfield, Ohio
Posts: 352
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?
  Reply With Quote
Old July 17th, 2017, 09:44 PM   #57
Peter Nachtwey
Member
United States

Peter Nachtwey is offline
 
Peter Nachtwey's Avatar
 
Join Date: Apr 2002
Location: Vancouver, WA, US
Posts: 6,531
So how do you do it?

Quote:
Originally Posted by Highland Controls View Post
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.
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon
  Reply With Quote
Old July 17th, 2017, 10:00 PM   #58
Highland Controls
Member
United States

Highland Controls is offline
 
Join Date: Oct 2012
Location: Richfield, Ohio
Posts: 352
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...
  Reply With Quote
Old July 18th, 2017, 01:22 AM   #59
Peter Nachtwey
Member
United States

Peter Nachtwey is offline
 
Peter Nachtwey's Avatar
 
Join Date: Apr 2002
Location: Vancouver, WA, US
Posts: 6,531
Quote:
Originally Posted by Highland Controls View Post
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.
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon
  Reply With Quote
Old July 18th, 2017, 05:25 AM   #60
Highland Controls
Member
United States

Highland Controls is offline
 
Join Date: Oct 2012
Location: Richfield, Ohio
Posts: 352
That may be true Peter, but I think it would make a great wave in a tank at a kid's museum.
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
engineers kill me robo77 LIVE PLC Questions And Answers 19 November 18th, 2011 09:28 PM
ControlLogix Learning Curve? peterjung LIVE PLC Questions And Answers 20 May 25th, 2011 05:50 PM
Help with flow curve controllogix asterof LIVE PLC Questions And Answers 23 March 1st, 2010 11:12 PM
Automatic linear curve?? DBLD99 LIVE PLC Questions And Answers 4 May 3rd, 2008 06:36 PM
GE Veramax vrs. RSLogic learning curve Mark Buskell LIVE PLC Questions And Answers 8 January 14th, 2004 05:20 PM


All times are GMT -5. The time now is 11:03 AM.


.