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.
The result: