![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| Parametric Programing (custom macro b, fadal macro, okuma user task) |
| This forum is sponsored by: |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| |||
| |||
Gentlemen, Will this example work: WHILE[#103LE#100DO1 #102=#102-#101 #108=ABS[#102] #104=[#18*#18] #105=[#108*#108] #106=#104-#105 #107=SQRT[#106] #109=#108/#107 #110=ATAN[#110] IF[#110GT45.]GOTO20 G1 G3 G3 G3 #103=#103+1. END1 N20 G1 G3 G3 G3 #103=#103+1. END1 I would use GOTO Statements but the cutter pauses after every pass. Thanks |
|
#2
| |||
| |||
Something like the following may help you #1=0 (Control Flag - initialize before starting DO Loop) WHILE[#103LE#100]DO1 #102=#102-#101 #108=ABS[#102] #104=[#18*#18] #105=[#108*#108] #106=#104-#105 #107=SQRT[#106] #109=#108/#107 #110=ATAN[#110] WHILE [[#110 LE 45.] AND [#1=0]] DO2 #1=1 (Set Control Flag so DO2 executes only once) G1 G3 G3 G3 #103=#103+1. END2 #1=0 (Reset Control Flag so that DO2 will execute again if #110 LE 45.) N20 G1 G3 G3 G3 #103=#103+1. END1 Regards, Bill Last edited by angelw; 10-27-2011 at 06:44 AM. |
|
#6
| |||
| |||
| Arctangent #i=ATAN[#j]/[#k]; Where: #1 = the resulting angle #j = the opposite side #k = the adjacent side Now, I've never tried to use the ATAN function in any other way other way than in the above syntax example. Its my understanding that the function requires two arguments, and not just the TAN of an angle. I'll check that out. In your example program, its not shown where #110 is allocated a value; obviously somewhere prior to the WHILE statement. Lets say #110 was allocated the TAN of an angle elsewhere, and that #110 = ATAN[#110] did not result in a syntax error. In your example program, the first time through the loop, #110 would take on the value of the angle extrapolated from getting the Arctangent of the TAN of an angle ; the second time through, the angle #110 would be plugged back in as the TAN of an angle. For example: #110 = TAN [45] (#110 = 1) ATAN[#110] (#110 = 45) ATAN[#110] (#110 = 88.7269) Regards, Bill |
|
#9
| |||
| |||
Gentlemen, Here's an example from a Fanuc control manual: #i=ATAN[#j] Arc tangent (one argument) #i=ATAN[#j]/[#k] Arc tangent (two arguments) #i=ATAN[#j,#k] Arc tangent (two arguments) So how does the first example differ from my syntax? Thanks |
|
#10
| |||
| |||
| #109=#108/#107 #110=ATAN[#109] would be fine if #108 and #107 are the opposite and adjacent sides respectively. As you're probably aware, the above could also be written as follows: #110=ATAN[#108] / [#107] Regards, Bill Last edited by angelw; 11-02-2011 at 09:31 AM. |
| Sponsored Links |
|
#11
| |||
| |||
| The best way would be to test it on your machine. And please do report back. There is a good reason why Fanuc defined ARCTAN this way. tan 45 and tan 225 are both 1. What should be the out put of arctan 1? Similarly, tan (-45) and tan 135 are both -1. arctan (-1) would be ambiguous. 1/1 and -1/-1 are both equal to 1, but refer to angles in I and III quadrants, respectively. -1/1 and 1/-1 are both equal to -1, but refer to angles in IV and II quadrants, respectively. Thus Fanuc's ATAN always gives correct value of angle. Incidently, this feature is not available in even high-level languages such as Pascal. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Open Loop to Closed Loop Stepper Conversion | beamhome | Stepper Motors and Drives | 9 | 05-24-2012 02:46 AM |
| New 6-axis Double-Closed-Loop Controller? | brccrb | Product Announcements & Manufacturer News | 28 | 03-04-2009 09:46 PM |
| CNC Brain is ready! 6-axis Double Closed Loop Controller | brccrb | CncBrain | 628 | 02-02-2009 07:47 AM |
| CNC Brain is ready! 6-axis Double Closed Loop Controller | brccrb | Product Announcements & Manufacturer News | 374 | 09-17-2008 07:42 PM |
| question on closed loop vs open loop (servo systems) | boonie | Servo Motors and Drives | 20 | 11-09-2007 12:30 PM |