TerryTham Posted May 8, 2014 Share Posted May 8, 2014 Hello there In my software, it extracts dxf files into set of trajectories data for the entire profile, which consists of position X, position Y, Speed, IJK values (for circular trajectories), Move Type(linear, circular, arc or spline). Currently i am command the XY Axis moves interpolation point by point where the pmac code was very simple of moves interpolation, decelerate, and stop, then for the next point of the trajectory to complete an entire profile. However this gives unsatisfied output of quality which required to moves entire profile without decelerates and stops. I'm considering using the Q variables, but then what if the number of position X&Y and other parameters exceed the number allowance of variables? and do you have a sample of pmac code or similar case to study or reference? How do i throw in all the trajectories data (position, type of moves, speed, and ijk value) as buffer and it runs the entire profile in the pmac program but not command by command from my software? Thank You Best Regards Terry Link to comment Share on other sites More sharing options...
andreychip Posted May 8, 2014 Share Posted May 8, 2014 Hello there In my software, it extracts dxf files into set of trajectories data for the entire profile, which consists of position X, position Y, Speed, IJK values (for circular trajectories), Move Type(linear, circular, arc or spline). Currently i am command the XY Axis moves interpolation point by point where the pmac code was very simple of moves interpolation, decelerate, and stop, then for the next point of the trajectory to complete an entire profile. However this gives unsatisfied output of quality which required to moves entire profile without decelerates and stops. I'm considering using the Q variables, but then what if the number of position X&Y and other parameters exceed the number allowance of variables? and do you have a sample of pmac code or similar case to study or reference? How do i throw in all the trajectories data (position, type of moves, speed, and ijk value) as buffer and it runs the entire profile in the pmac program but not command by command from my software? Thank You Best Regards Terry Read guide TURBOPMAC_USER_MANUAL and TURBO SRM http://www.deltatau.com/Manuals/Default.aspx example ROTARY bufferPrograms0.PMC Link to comment Share on other sites More sharing options...
steve.milici Posted May 9, 2014 Share Posted May 9, 2014 You can place your existing program in a fixed motion buffer so it is permanently in PMAC. This is described in the "Turbo PMAC User Manual" in the section"WRITING AND EXECUTING MOTION PROGRAMS". Can you describe in more detail your existing code and it's unsatisfactory output? Link to comment Share on other sites More sharing options...
TerryTham Posted May 14, 2014 Author Share Posted May 14, 2014 In the attachment, there's a brief description of the current machine system. Current system is moves point to point where the motion will accelerate, then decelerate, then stop, then moves second point, and so on. Due to the application of laser cutting, it required to moves without stopping point to point. Furthermore, under my program, the user needs to export random drawing to do cutting, which will be a random set of trajectories (linear or circles or arcs). Hence, I would like to use the method like following ;------------------------------------------------ ;Move Trajectory ;Q100-Q199 for Move type (Linear/Circle/Arc/etc) ;Q200-Q299 for Position X ;Q300-Q399 for Position Y ;Q500-Q599 for I ;Q600-Q699 for J OPEN PROG 100 CLEAR Frax(X,Y) IF(XYAxis_WB=0) ;make sure all moves complete before execute CURRENT_TRAJECTORY=0 WHILE(CURRENT_TRAJECTORY < NO_OF_TRAJECTORY) ;loop for all the trajectory IF(Q100+CURRENT_TRAJECTORY=1) ;if profile is straigh line ABS TA(XYAxis_TA) TS(XYAxis_TS) F(XYAxis_F) X(Q200+CURRENT_TRAJECTORY)Y(Q300+CURRENT_TRAJECTORY) DWELL0 DWELL0 DWELL0 WHILE(XAxis_InPosition = 0 AND YAxis_InPosition = 0) ;wait motion done WAIT ENDWHILE ENDIF IF(Q100+CURRENT_TRAJECTORY=2) ;if profile is CCW circle TA(XYAxis_TA) TS(XYAxis_TS) F(XYAxis_F) NORMAL K-1 ABS ABS® CIRCLE2 X(Q200+CURRENT_TRAJECTORY) Y(Q300+CURRENT_TRAJECTORY) I(Q500+CURRENT_TRAJECTORY) J(Q600+CURRENT_TRAJECTORY) DWELL0 DWELL0 DWELL0 WHILE(XAxis_InPosition = 0 AND YAxis_InPosition = 0) ;wait motion done WAIT ENDWHILE ENDIF CURRENT_TRAJECTORY=CURRENT_TRAJECTORY+1 ENDWHILE ENDIF[/code] DWELL0 DWELL0 DWELL0 XYAxis_MV_Trajectory=0 CLOSE ;--------------------------------------------------- the highlighted lines are the part couldn't get it through. I need to loop reading the Q variables which i pre-set all the positions and parameters before execute this program. Link to comment Share on other sites More sharing options...
Richard Naddaf Posted May 14, 2014 Share Posted May 14, 2014 Have you had any Turbo PMAC training? Pre-compute all the expressions inside parentheses and hold them in separate parameters. Why do you believe that you need 3 x DWELL 0? You do not need to insert while loops to wait for the motion to stop. PMAC does that automatically. The axis is considered in position based on the in-position bandwidth specified by Ixx28. And what is ABS® ??? Closing the while loop is done either with a Wait or an End while, not both. Link to comment Share on other sites More sharing options...
curtwilson Posted May 14, 2014 Share Posted May 14, 2014 It seems to me that you are making this far more difficult than it needs to be. What virtually everyone does in this type of application is to turn the entire sequence of moves into a single "part program" that is very much (or exactly) like a CNC "G-code" part program. I don't see any need for subprograms or parameters - just a straight sequence of programmed motions. Link to comment Share on other sites More sharing options...
TerryTham Posted May 15, 2014 Author Share Posted May 15, 2014 Have you had any Turbo PMAC training? Pre-compute all the expressions inside parentheses and hold them in separate parameters. Why do you believe that you need 3 x DWELL 0? You do not need to insert while loops to wait for the motion to stop. PMAC does that automatically. The axis is considered in position based on the in-position bandwidth specified by Ixx28. And what is ABS® ??? Closing the while loop is done either with a Wait or an End while, not both. 1. I did not conducted any Turbo PMAC training before. All are base on the reference of the software manual and self study. 2. 1 or 3 DWELL0 does any different? 3. The in position bit was defined in .h file. 4. ABS( R ), that i was defined the I and J value as absolute value. 5. Got that. 6. In my application, user are not be able to change the pmac code every time they changes the laser cutting pattern. It has to be receive the different position buffers from the machine software (FASAMachine). Link to comment Share on other sites More sharing options...
Richard Naddaf Posted May 15, 2014 Share Posted May 15, 2014 No, 1 or 3 dwells do not matter. It is just a programming efficiency matter. Again, even if the in position bit is defined, you do not need to check for in position after moves in motion programs. PMAC does that automatically for you. Just specify the bandwidth, Ixx28, which you would consider your motor(s) in position. So this is a typo ABS®? why is the R encircled? this is not a correct syntax for PMAC. Sure, the user can change pre-configured parameters and run a program (recipe). I think if you pre-compute the expressions in your conditionals, you would be fine. Also, there is no need to check if all moves are completed in the beginning of the program. PMAC will not allow running a program if any axis in the coordinate system is in the middle of a commanded move or not in closed loop. Have you gotten your program to download, and run? I stripped some stuff out of your program, but this should download and execute if all the input values are set. End Gat Del Gat Close // --------------------------------------------------- // &1 #define CURRENT_TRAJECTORY Q99 ; #define MoveType Q100 ; =1 linear, =2 CCW circle #define MoveTa Q102 ; msec #define MoveTs Q103 ; msec #define MoveF Q104 ; Q99..104 = 0 OPEN PROG 100 CLEAR FRAX(X,Y) DWELL 0 IF(Q100 = 1) // Linear ABS LINEAR TA(MoveTa) TS(MoveTs) F (MoveF) X(Q200 + CURRENT_TRAJECTORY) Y(Q300 + CURRENT_TRAJECTORY) DWELL 0 ENDIF IF(Q100 = 2) // CCW Circle TA(MoveTa) TS(MoveTs) F (MoveF) NORMAL K-1 ABS CIRCLE2 X(Q200 + CURRENT_TRAJECTORY) Y(Q300 + CURRENT_TRAJECTORY) I(Q500 + CURRENT_TRAJECTORY) J(Q600 + CURRENT_TRAJECTORY) DWELL 0 ENDIF CLOSE // --------------------------------------------------- // Link to comment Share on other sites More sharing options...
TerryTham Posted May 16, 2014 Author Share Posted May 16, 2014 No, 1 or 3 dwells do not matter. It is just a programming efficiency matter. Again, even if the in position bit is defined, you do not need to check for in position after moves in motion programs. PMAC does that automatically for you. Just specify the bandwidth, Ixx28, which you would consider your motor(s) in position. So this is a typo ABS®? why is the R encircled? this is not a correct syntax for PMAC. Sure, the user can change pre-configured parameters and run a program (recipe). I think if you pre-compute the expressions in your conditionals, you would be fine. Also, there is no need to check if all moves are completed in the beginning of the program. PMAC will not allow running a program if any axis in the coordinate system is in the middle of a commanded move or not in closed loop. Have you gotten your program to download, and run? I stripped some stuff out of your program, but this should download and execute if all the input values are set. End Gat Del Gat Close // --------------------------------------------------- // &1 #define CURRENT_TRAJECTORY Q99 ; #define MoveType Q100 ; =1 linear, =2 CCW circle #define MoveTa Q102 ; msec #define MoveTs Q103 ; msec #define MoveF Q104 ; Q99..104 = 0 OPEN PROG 100 CLEAR FRAX(X,Y) DWELL 0 IF(Q100 = 1) // Linear ABS LINEAR TA(MoveTa) TS(MoveTs) F (MoveF) X(Q200 + CURRENT_TRAJECTORY) Y(Q300 + CURRENT_TRAJECTORY) DWELL 0 ENDIF IF(Q100 = 2) // CCW Circle TA(MoveTa) TS(MoveTs) F (MoveF) NORMAL K-1 ABS CIRCLE2 X(Q200 + CURRENT_TRAJECTORY) Y(Q300 + CURRENT_TRAJECTORY) I(Q500 + CURRENT_TRAJECTORY) J(Q600 + CURRENT_TRAJECTORY) DWELL 0 ENDIF CLOSE // --------------------------------------------------- // 1. The ABS ( R ), please refer to the attachment. Its running fine in the previous machine for the circular interpolation. 2. I am still waiting for the new motion card to arrive to do the actual testing where i do not want to interrupted the previous machine since its running fluids dispensing application correctly. 3. I've change a method to do the continuous moves of trajectories. my software will create and generate a text file base on all the positions and moves type (linear or circular), then save as pmc extension (refer attachment), and download to motion card using pcommserver function: Download(long dwDevice, BSTR filePath, VARIANT_BOOL bMacro, BOOL bMap, BOOL bLog, BOOL bDnld, BOOL *pbSuccess); and execute. Let me try out and let you guys know the outcome. Thank You.PMACProgram100.pmc Link to comment Share on other sites More sharing options...
TerryTham Posted May 16, 2014 Author Share Posted May 16, 2014 I did tried the pcommserver "Download()" function, it seem alright. I could download the program into the card, and it created .56k, log, map, and TBL file. i guess its good to go. I'll be waiting for the mechanical structure to finish assemble to do the testing then. Thank You guys for the help. Link to comment Share on other sites More sharing options...
Recommended Posts