Community
PowerMill Forum
Welcome to Autodesk’s PowerMill Forums. Share your knowledge, ask questions, and explore popular PowerMill topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

5 axis post processor for Mach3 for DIY CNC machine.

32 REPLIES 32
SOLVED
Reply
Message 1 of 33
Poduhvat1
19547 Views, 32 Replies

5 axis post processor for Mach3 for DIY CNC machine.

We just got custom made 5 axis CNC machine. I got machine kinematics in place and simulation for the test part is working properly. The problem is the post processor for Mach3.  I have managed using instructions from this forum to create rudimentary  5 axis post from generic Fanuc using Autodesk Manufacturing Post Processor Utility but this somwhat works without RTCP while with RTCP if creates Gcode inconsistent with simulation.

The main difference is the Y coordinates with and without RTCP option post file. Without RTCP there is no fluent simultaneous movement of the machine it just rotates B axis for a long time before starting to use Z with minuscule movement while with RTCP gcode due to inadequate y distance it tool collides with B axis table.

 

The goal is to have truly simultaneous 5 axis movement as in simulation. 

And this can be done by optimizing post for Mach3. Machine has manual tool change. 

I will post .cut file with some .pmoptz  post files with RTCP and without.

Can anyone help with adequate 5 axis simultaneous Mach3 postprocesor for this machine?

32 REPLIES 32
Message 2 of 33
Poduhvat1
in reply to: Poduhvat1

15 days and nobody answering anything. 

So Powermill can not be used if you have Mach 3 controller for 5 axis machine? 

Message 3 of 33
Anonymous
in reply to: Poduhvat1

From what you wrote, I think the Mach3 controller doesn't have RTCP functionality.
 
"Without RTCP there is no fluent simultaneous movement of the machine it just rotates B axis for a long time before starting to use Z"
- This behavior is independent of the RTCP / without RTCP option, but depends on the value of "Linearise Multi-Axis Moves". If you set it to "None", it would disappear, but you would not be able to do this without the RTCP function, because a faulty tool path would be created.
Linearise Multi-Axis Moves.JPG
 
 
-"while with RTCP gcode due to inadequate y distance it tool collides with B axis table."
This is correct behavior, because for machines with RTCP function the kinematic correction must be made by the control.
Take a look at the following pictures of cigra.cut: both have only linear axis movement, rotary axes are off, and high speed movement off
.with RTCPwith RTCP with RTCP
without RTCPwithout RTCPwithout RTCP
 
 
Message 4 of 33
Poduhvat1
in reply to: Anonymous

Thank you for the explanation. Is there any way to make this to work? I guess if the gcode is correct the Mach3 will follow it. There must be some way to do it and I guess this is up to postprocessor or some settings I'm not familiar with. Note that I'm beginner with all this and would appreciate if any one could assist as I believe I'm not the only one with this kind of problem. How to translate correct movement from simulation into the gcode?

Message 5 of 33
Anonymous
in reply to: Poduhvat1

Change these with your Fanuc5osa postprocessor:
Option File Settings:
Program Generation - General - General -Use Model Location = No (If set to Yes then always fill  the Nc-program Model Location in Powermill)
Program Generation - Multi Axis - Workplane Definition- Ignore Toolpath Workplane Shift = Yes
Program Generation - Machine Kinematics - 2nd Rotary(A) - Origin Y,Z exact measured values. Such as Y0;Z19 -> Y-0.03;Z18.982
 
In Move Rapid/ Move Linear Commands:
X,Y,Z axis -Workplane for Output = Machine Workplane
Képkivágás.PNG
 
Preparation on Powermill:
The Nc-programs Output Workplane always set to Machine Tool reference workplane.
It will be necessary to adjust the tolerance and the point distribution. https://forums.autodesk.com/t5/powermill-forum/best-way-to-have-better-surface-finishing/m-p/8380088...
The result:
Mach3_chk.png
 
Message 6 of 33
Poduhvat1
in reply to: Anonymous

Thank you for the advice. I changed the postprocessor as per your suggestions. Never the less I'm probably doing something wrong as I did not able to achieved for actual machine to work as a simulation. There is no fluid simultaneous  movement in actual use. Can you send me the screen cast of your procedure with Powermill and your version of postprocessor?

I noticed that post I sent you generate some Fanuc related code which Mach3 does not recognize in 2 lines, one at the beginning, line 39: N136 G05 P10000 R4, and at the end, line 24607: N24704 G05 P0 in tap file from Powermill. I'm sending you screencast from simulation and actual machine video to see the difference as well as test files and actual tool database..

 

By the way how were you able to recover the machine geometry from the files I attached?

 

 

 

Message 7 of 33
Anonymous
in reply to: Poduhvat1

The reason for moving back and forth  C-axis is that it may be Mach3 used only positive direction https://www.machsupport.com/forum/index.php?topic=7090.0

 

'SETUP AND USE NOTES:

'Under Config>General you will have to tick "Rot 360 rollover"
'for this to work right.
'You A axis DRO will only read 0 to +360, it will not show negatives.
'In your Gcode all A movements will need to be in the above + range
'so basically only absolute A+ moves for your G code, you can put 
'(NEGATIVE -A) moves ONLY if when it moves bacwards it does NOT cross
'the 0/360 line.....!!!!!!!!!!
'You can issue negative A axid moves but it will move that many,
'negative degrees from its positive position, and the show you positive.
'i.e. if your at A0, and push A-90, when it quits moving it will show
'A90 Positive.

HomeRapidPoint = 5.0  'this is the degree location to stop above move.
CurrentPos = GetOEMDRO(86) 'current location of A axis prior to homing move
        
MoveDist = HomeRapidPoint - CurrentPos   'Calc the move distance        
 If Abs(MoveDist) >180 Then         'Find the shortest path          
    If MoveDist < 0 Then            
       MoveDist = 360 + MoveDist          
    Else            
       MoveDist = MoveDist - 360          
    End If        
 End If        
    Code "G00 G91 A" & MoveDist        'Move the A axis in Incermental the move distance          
    While IsMoving ()          
    Wend
Code "G90"           'Put back to absolute mode

G05 P10000 -https://www.cnczone.com/forums/general-off-topic-discussions/31214-wat-mean-g05p0-g05p10000.html

-to recover the machine geometry from the files:  AMPPU -Option File setting- Machine Kinematics -Export

 

I am currently at home so I only have access to a PM2017 remote. I can't open the pmpost file. Please export: AMPPU -File- Export- Option files v2014

 

 

Message 8 of 33
Poduhvat1
in reply to: Anonymous

I will try to change configuration within Mach3. In the meantime I'm posting exported .pmomptz 2014 file.

Message 9 of 33
Poduhvat1
in reply to: Anonymous

I ticked the "Rot 360 rollover". When started the cycle (executing test gcode) it wanted turn the A axis 360degrees which had a 210 degress limit. If I let it go it would riped off the electric cable for A axis motor. In our configuration B is unlimited 360+- . It must be some way to limit the A in Mach3 not to over 210+-.

Message 10 of 33
Anonymous
in reply to: Poduhvat1

Sorry, I was ambiguous when I wrote about the C axis and in the quote about the A axis, in your configuration it corresponds to the B axis.
I found the following in the Mach3 config manual:

Mach3_rot_config.PNG

I modified the postprocessor you sent:

kinematic0825.JPG

Reset Angles Only -temporary solutionReset Angles Only -temporary solution

MoveLinear_0825.JPG

Replace rotary _axis1_2020 and  rotary _axis2_2020 with Machine A, Machine B in Move Linear/Move Rapid Command. 

Message 11 of 33
Poduhvat1
in reply to: Anonymous

I guess I should keep 360 rollover ticked or not? 

Message 12 of 33
Anonymous
in reply to: Poduhvat1

I think the shortest route is important this case (Ang Short Rot on G0), the Rot 360 rollover is only secondary priority. That is, I ask you to look at both cases.

Message 13 of 33
Poduhvat1
in reply to: Anonymous

I tested the new settings in postprocessor with default Mach3 settings

mach3genconfig.JPG

 

B axis rotates in both directions so I guess this is better. With Ang short options on it is a bit better when it comes to line

466 N563 X3.2799 Z23.2525 B0.0
467 N564 B360.0

although I'm not sure why it is doing this. Also I noticed that Y coordinates are working strange it just alternate between coordinates 117 and 227 while starting to change a bit latter in code and never in simultaneous mode but always independently. What do you think of this? Here is the first few minutes of video.

Also at begging and in the end it has at line 25 N122 G53 Z0.0  and N9955 G00 G53 Z0.0 command which if stock was in the place would plunged the tool and the spindle into it. How to change this?

 

 

Message 14 of 33
Anonymous
in reply to: Poduhvat1

Message 15 of 33
Anonymous
in reply to: Anonymous

I create a simple macro that will help you compare machine simulation data to "wihout-RTCP" postprocessors output.
Need a short (macro working slowly) 5 axis toolpath activated, Machine Tool model activated, Model Location selected. Output is created in the project \ ncrpogram directory

FUNCTION MAIN () {
   STRING ActiveProject=project_pathname(0)
   IF $ActiveProject == "" {
      MESSAGE INFO 'Please save the project'
      RETURN
   }
   IF NOT entity_exists(entity('MachineTool', '')) {
      MESSAGE INFO 'Please activate Machine Tool'
      RETURN
   }
   IF NOT entity_exists(entity('Toolpath', '')) {
      MESSAGE INFO 'Please activate Toolpath'
      RETURN
   }
   ENTITY TP=entity('Toolpath', '')
   IF (NOT $TP.Computed) OR (SEGMENTS($TP)==0) {
      MESSAGE INFO 'Toolpath not computed/empty toolpath'
      RETURN
   }
   STRING LIST Axes=filter(Machine()._keys,"(this < 'max') OR (this > 'minZ')")
   $Axes=sort($Axes)
   STRING Config=""
   FOREACH C IN $Axes {
      $Config=$Config+$C
   }
   STRING LIST Kinematics={'ABXYZ','ACXYZ','BCXYZ'}
   IF not member($Kinematics,$Config) {
      MESSAGE INFO 'Unknown configuration'
      RETURN
   }
   $Axes[3]=$Axes[0]
   $Axes[4]=$Axes[1]
   $Axes[0]='X'
   $Axes[1]='Y'
   $Axes[2]='Z'
   STRING SimuLogFile=Project_pathname(0)+'/ncprograms/'+map_key($TP.name)+'_log.tap'
   REAL ToolLengthComp=entity('tool',$TP.Tool.Name).Overhang
   EDIT PAR 'SimulationState.Issues.Collisions.CheckCollisions' 0
   EDIT PAR 'SimulationState.Issues.CheckReconfigurations' 0
   EDIT PAR 'Powermill.Simulation.Issues.PlaybackSetting' 'never'
   SIMULATE TOOLPATH $TP.Name TOOLBAR SIMULATION RAISE
   SIMULATE END
   INT SL=simulation_location().Point
   SIMULATE REWIND
   EDIT PAR 'Powermill.Simulation.Step' 'point'
   EDIT PAR 'Simulation.Speed' 100
   FILE OPEN $SimuLogFile FOR WRITE AS simu
   REAL ARRAY Prev[]={-9999,-9999,-9999,-9999,-999}
   STRING Out=''
   DO {
      CALL GetMachinePosition($Config,$Axes,$ToolLengthComp,$Prev,$Out)
      IF $Out != '' {
         FILE WRITE $Out TO simu
      }
      SIMULATE STEP FORWARD
   } WHILE simulation_location().PoINT < $SL
   CALL GetMachinePosition($Config,$Axes,$ToolLengthComp,$Prev,$Out)
   IF $Out != '' {
      FILE WRITE $Out TO simu
   }
   FILE CLOSE simu
}

FUNCTION GetMachinePosition(STRING $Config,STRING LIST Axes,REAL ToolLengthComp, OUTPUT REAL ARRAY Prev[],OUTPUT STRING Out) {
   REAL ARRAY Pos[]={0,0,0,0,0}
   $Pos[0]=round($Machine().X,4)
   $Pos[1]=round($Machine().Y,4)
   $Pos[2]=round($Machine().Z-$ToolLengthComp,4)
   SWITCH  $Config {
      CASE 'ABXYZ'
      $Pos[3]=round($Machine().A,4)
      $Pos[4]=round($Machine().B,4)
      BREAK
      CASE 'ACXYZ'
      $Pos[3]=round($Machine().A,4)
      $Pos[4]=round($Machine().C,4)
      BREAK
      CASE 'BCXYZ'
      $Pos[3]=round($Machine().B,4)
      $Pos[4]=round($Machine().C,4)
   }
   $out=''
   INT I=0
   WHILE $I < 5 {
      IF $Prev[$I] != $Pos[$I] {
         IF $Out !='' {
            $Out=$Out+' '
         }
         $Out=$Out+$Axes[$I]+$Pos[$I]
         STRING CMD='$'+'Prev[$I'+']='+$Pos[$I]
         DoCommand $CMD
      }
      $I=$I+1
   }
}

The 0/ 360 a problem one possible solution:  extend teh B-axis range 0-720, then in  the Move Linear/ Move Rapid Commands change the Machine B parameter Value to expression:  "(%p(Machine B)%) % 360"  aka modulo 360.modulo360.JPG

 

The result:modulo360_result.JPG

 

Message 16 of 33
Anonymous
in reply to: Anonymous

The macro previous version didn't always work, I didn't check the simulation_location().Component value, and the decimal point vs comma (1.1 != 1,1) also caused an error.

FUNCTION MAIN () {
   STRING ActiveProject=project_pathname(0)
   IF $ActiveProject == "" {
      MESSAGE INFO 'Please save the project'
      RETURN
   }
   IF NOT entity_exists(entity('MachineTool', '')) {
      MESSAGE INFO 'Please activate Machine Tool'
      RETURN
   }
   IF NOT entity_exists(entity('Toolpath', '')) {
      MESSAGE INFO 'Please activate Toolpath'
      RETURN
   }
   ENTITY TP=entity('Toolpath', '')
   IF (NOT $TP.Computed) OR (SEGMENTS($TP)==0) {
      MESSAGE INFO 'Toolpath not computed/empty toolpath'
      RETURN
   }
   STRING LIST Axes=filter(Machine()._keys,"(this < 'max') OR (this > 'minZ')")
   $Axes=sort($Axes)
   STRING Config=""
   FOREACH C IN $Axes {
      $Config=$Config+$C
   }
   STRING LIST Kinematics={'ABXYZ','ACXYZ','BCXYZ'}
   IF not member($Kinematics,$Config) {
      MESSAGE INFO 'Unknown configuration'
      RETURN
   }
   $Axes[3]=$Axes[0]
   $Axes[4]=$Axes[1]
   $Axes[0]='X'
   $Axes[1]='Y'
   $Axes[2]='Z'
   STRING SimuLogFile=Project_pathname(0)+'/ncprograms/'+map_key($TP.name)+'_log.tap'
   REAL ToolLengthComp=round(entity('tool',$TP.Tool.Name).Overhang,3)
   EDIT PAR 'SimulationState.Issues.Collisions.CheckCollisions' 0
   EDIT PAR 'SimulationState.Issues.CheckReconfigurations' 0
   EDIT PAR 'Powermill.Simulation.Issues.PlaybackSetting' 'never'
   SIMULATE TOOLPATH $TP.Name TOOLBAR SIMULATION RAISE
   SIMULATE END
   INT SL=simulation_location().Point
   INT SC=simulation_location().Component
   SIMULATE REWIND
   EDIT PAR 'Powermill.Simulation.Step' 'point'
   EDIT PAR 'Simulation.Speed' 100
   FILE OPEN $SimuLogFile FOR WRITE AS simu
   REAL ARRAY Prev[]={-9999,-9999,-9999,-9999,-999}
   STRING Out=''
   DO {
      CALL GetMachinePosition($Config,$Axes,$ToolLengthComp,$Prev,$Out)
      IF $Out != '' {
         FILE WRITE $Out TO simu
      } 
      SIMULATE STEP FORWARD
   } WHILE simulation_location().Point < $SL OR simulation_location().Component < $SC
   CALL GetMachinePosition($Config,$Axes,$ToolLengthComp,$Prev,$Out)
   IF $Out != '' {
     FILE WRITE $Out TO simu
   }
   FILE CLOSE simu
}

FUNCTION GetMachinePosition(STRING $Config,STRING LIST Axes,REAL ToolLengthComp, OUTPUT REAL ARRAY Prev[],OUTPUT STRING Out) {
   REAL ARRAY Pos[]={0,0,0,0,0}
   $Pos[0]=round($Machine().X,4)
   $Pos[1]=round($Machine().Y,4)
   $Pos[2]=round($Machine().Z-$ToolLengthComp,4)
   SWITCH  $Config {
      CASE 'ABXYZ'
      $Pos[3]=round($Machine().A,4)
      $Pos[4]=round($Machine().B,4)
      BREAK
      CASE 'ACXYZ'
      $Pos[3]=round($Machine().A,4)
      $Pos[4]=round($Machine().C,4)
      BREAK
      CASE 'BCXYZ'
      $Pos[3]=round($Machine().B,4)
      $Pos[4]=round($Machine().C,4)
   }
   $out=''
   INT I=0
   WHILE $I < 5 {
      IF $Prev[$I] != $Pos[$I] {
         IF $Out !='' {
            $Out=$Out+' '
         }
         $Out=$Out+$Axes[$I]+$Pos[$I]
         STRING CMD='$'+'Prev[$I'+']=$'+'Pos['+$I+']'
         DoCommand $CMD
      }
      $I=$I+1
   }
}
Message 17 of 33
Poduhvat1
in reply to: Anonymous

Something is not working right with me it seems that post is not working. Can you send me your version of post-processor.

macroproblem.png

 

postproblem.png

Message 18 of 33
Poduhvat1
in reply to: Poduhvat1

I managed to sort it out the post-processor issue I needed to adjust the .mtd file i.e machine tool for 720 degree B-axis  to put in Powermill configuration and to create new tool-path but the issue with macro is still the same.

Message 19 of 33
Anonymous
in reply to: Poduhvat1

The Simu_log.mac not working if  you do not have full  access rights in folder. Folder name characters: A-Z, 0-9, '_'.

If simu_log.mac failed then type in PM command window:  "FILE CLOSE simu" 

For testing use PP and macro, use short, simple toolpath.

Message 20 of 33
Poduhvat1
in reply to: Anonymous

I'm not sure what is the problem the folder with Powermill project file is in My documents under the name powermillprojecti. Maybe because Powermill is installed at external hard disk. I will try to solve this.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report