Hi, I have a toolpath in which I want to apply a different Spindle Speed at different sections. Any suggestion on how this can be done?
What I am asking is is similar to Update Feed Rate inside Boundary or Update Feed Rate on Chosen Surfaces, instead of Feed Rate I would like to update Spindle Speed.
I’m afraid that that function is not available in Powermill. But you can set user parameters to the toolpaths segments and its points. So I would set those parameters there and then use those for postprocessing.
Here are 2 macros. The first is setting the "HAS_CUSTOM_SPINDLE_SPEED" for selected toolpaths segments to “YES”. And “NO” for the not selected ones. It is also setting the "CUSTOM_SPINDLE_SPEED" value which is in that example 5000.
The second macro just selects toolpaths segments where the parameter "HAS_CUSTOM_SPINDLE_SPEED" is “YES” for visual check.
In your postprocessor you need to define User parameters “udp_CUSTOM_SPINDLE_SPEED” and “udp_HAS_CUSTOM_SPINDLE_SPEED”. Those will be getting the values from Powermill during postprocessing. Then you can in the Move Linear command add the condition statement and print out the custom spindle speed if needed.
INT $cutomSpindleSpeed = 5000
ENTITY $tp = entity("Toolpath","")
INT LIST selected_rows = selected_list_rows('TPList.TPListView')
INT $rowIndex = 0
WHILE $rowIndex < size($selected_rows) {
IF $selected_rows[$rowIndex] == 1 {
INT $i = point_add_parameter($tp,$rowIndex,0,"HAS_CUSTOM_SPINDLE_SPEED","YES","segment")
INT $ii = point_add_parameter($tp,$rowIndex,0,"CUSTOM_SPINDLE_SPEED",$cutomSpindleSpeed,"segment")
} ELSE {
INT $i = point_add_parameter($tp,$rowIndex,0,"HAS_CUSTOM_SPINDLE_SPEED","NO","segment")
INT $ii = point_remove_parameter($tp,$rowIndex,0,"CUSTOM_SPINDLE_SPEED","segment")
}
$rowIndex = $rowIndex + 1
}
ENTITY tp = ENTITY("TOOLPATH","")
INT $tp_Count = 0
INT $tp_ComponentCount = toolpath_component_count($tp, 'segments')
WHILE $tp_Count < $tp_ComponentCount {
print par "$point_parameters($tp,$tp_Count,0,'segment' )"
IF $has_point_parameter( $tp, $tp_Count,0, 'HAS_CUSTOM_SPINDLE_SPEED', 'segment') == 1 {
IF $point_parameters( $tp, $tp_Count, 0, 'segment')['HAS_CUSTOM_SPINDLE_SPEED'] == "YES" {
EDIT TPSELECT ; TPLIST UPDATE\r $tp_Count TOGGLE
}
}
$tp_Count = $tp_Count + 1
}
I've often wondered how something so basic to machining is overlooked in a high end software as well. Don't people ever machine with ball endmills? or care how long their tools last? or care about surface finish? or care how long cycle times are? This being added to the software seems like a no brainer to me, along with the related, fixing the forever broken option of the working dia and slope angle in the speeds and feeds section.
Hey, Thank you for the quick suggestion. I still have trouble understanding on how to implement that.
How do I Set User Parameters to toolpath segments? Is it the Set Named Parameter as in the below image
I think you can set custom parameters for toolpath points only through command line commands. I'm not aware of any user interface for that purpose.
The image in your post is for to setting standard parameters for a toolpath, which is a different feature altogether.
Take my macros as an example of how you could address your requirement. However, after conducting some tests, it's evident that it could be done differently. Currently, the macro is slow because it sets parameters for all points. While this wasn't an issue for short toolpaths, it becomes unusable for long ones.
To simply print out user parameters from a point, you can also utilize the following macro. However, please note that this, along with all my macros, only works with the first [0] points of the segments.
STRING $parameterName = 'HAS_CUSTOM_SPINDLE_SPEED'
ENTITY tp = ENTITY("TOOLPATH","")
INT $tp_Count = 0
INT $tp_ComponentCount = toolpath_component_count($tp, 'segments')
WHILE $tp_Count < $tp_ComponentCount {
IF $has_point_parameter( $tp, $tp_Count,0, $parameterName, 'segment') == 1 {
print par "$point_parameters($tp,$tp_Count,0,'segment' )"
}
$tp_Count = $tp_Count + 1
}
This is only a half of your problem. This is to set your parameter into a toolpath point as a trigger that will perform some action while postprocessing. So you second part of your problem is to change your postprocesso to handle that.
Can't find what you're looking for? Ask the community or share your knowledge.