trigonometric function lim Junior Member Posts: 24 Threads: 13 Joined: Mar 2013 03-11-2014, 01:38 AM if I want call trigonometric function "cos" to move forward and backward on one axis, how should I write in programming? tahoe brian Member Posts: 77 Threads: 9 Joined: Jun 2011 03-12-2014, 09:24 AM One way to do this is to create a phantom (pretend) axis. For example, let's say you want the X axis to have a sinusoidal trajectory. Then create a phantom axis called V, and do circular interpolation in the X-V plane. There is no V, so it doesn't do a circle, it simply does sinusoidal motion on X. Richard Delta Tau Insider Posts: 201 Threads: 9 Joined: Jun 2008 03-12-2014, 09:43 AM One way to do this is to execute a circular move on X and Y, where Y for example is a non-existent phantom axis. The real axis will then move in a sinusoidal fashion. Here is an example. Code: ```[font=Courier]End Gat Del Gat Close Undefine All &1 #1->1000X            ; cts/user units (e.g. mm, inches) I113 = 10            ; Segmentation Time #define OutFreq  P100    ; Output Frequency #define OutMag    P101    ; Output Magnitude #define OutCycle    P102    ; Cycle Counter OutFreq = 1        ; Sine Frequency [Hz] OutMag = 5            ; Sine magnitude, [user units] OutCycle = 0        ; Reset Cycle Counter OPEN PROG 1 CLEAR OutCycle = 0        ; Reset cycle counter HOME 1            ; Circle starting point ABS TA 10                ; Small accel time TS 5                ; Small S-Curve time TM(1000 / OutFreq)    ; Move time / Frequency DWELL 0                                         NORMAL K-1                                 CIRCLE1                                         WHILE(OutCycle !> 3)                     OutCycle = OutCycle + 1     X 0 Y 0 J(-OutMag) ENDW DWELL 0 CLOSE[/font]``` lim Junior Member Posts: 24 Threads: 13 Joined: Mar 2013 03-24-2014, 04:08 AM I would like to move on SINE WAVE CHARACTERISTIC and below is the sample program I get through and can below the graph consider as SINE WAVE…? There are few question would like your advice base on the program as below.. 1. The position for X(P103)=5000 and the graph that I get is just 3300pulse..please advice… 2. What is the function for OutMag J(-P101) currently I set it to 0..it doesn’t affect my motor moving while set it to 10.. Attached Files   graph.zip (Size: 40.95 KB / Downloads: 12) Richard Delta Tau Insider Posts: 201 Threads: 9 Joined: Jun 2008 03-26-2014, 08:46 AM You have modified the example, and removed the home command. This is important for the X0Y0J() command because it specified the starting point, being at zero. I don't see you specifying anywhere in your motion program the start point of the "circle". You need to learn about the CIRCLE command, and understand that what you program in the CIRCLE move X()Y()I()J() specifying the end point and radius is directly related to the very important start position. Otherwise, I don't understand the first question. I don't see P103 anywhere in the code or X(P103). You have hard coded X5. « Next Oldest | Next Newest »