Where to insert code to issue G4 command after spindle start?

Here's the place for discussion related to CAM/CNC and the development of the Path module.
User avatar
sliptonic
Posts: 1835
Joined: Tue Oct 25, 2011 10:46 pm
Contact:

Re: Where to insert code to issue G4 command after spindle start?

Postby sliptonic » Wed Mar 06, 2019 2:14 pm

pauluzs wrote:
Wed Mar 06, 2019 12:46 am
mlampert wrote:
Wed Mar 06, 2019 12:27 am
A dressup is for machine independent path manipulations. All of this belongs into a post processor, not the TC or a dressup.
Clear, still fairly new to Freecad. Only where does simulation fit in? According to the wiki its job>path>verify>simulate>post should i do a other simulate after postprocessing to see M3/M4/M5's? Or should it be job>path>verify>post>simulate?
Simulation doesn't try to visualize everything that happens at the machine. It doesn't animate chips flying, coolant turning on and off, or even the spindle spinning. Simulation is only tracing the path movement commands.

Remember, the path commands look like gcode but really aren't. The REAL gcode is generated by post processing and verifying it is the responsibility of the user/operator. You can use external tools or a simulation mode on your machine to 'air cut' the part but there's too much that is machine dependent for Path to accurately simulate it.
sebste
Posts: 25
Joined: Tue Sep 01, 2015 9:23 am

Re: Where to insert code to issue G4 command after spindle start?

Postby sebste » Wed Mar 06, 2019 10:34 pm

Okay - With a little massaging of the GRBL postprocessor I finally got a version that works for me, which I have attached.

* I added a --spindle-wait option to give the spindle some time to get up to / change speed.
* I also added a --stop-on-zero-rpm option to replace spindle start with 0 rpm by spindle stop command (M3 S0.0 -> M5) if desired
* It also addresses the following problem (I think it really could be seen as a bug, but this sort of a hack at least band-aids it, even if in the wrong place):
If different tool controllers are used for the same tool number, the changes in spindle speed for the subsequent operations are ignored if there is no change to a different tool number in between.

Say we create a tool controller with aggressive feeds and speeds for a roughing operation for tool #1 and another tool controller with more moderate feeds and speeds i.e. for a spring pass operation directely afterwards, then Path does realize that the tool# has not changed between operations and therefore does not issue a toolchange. Since the spindle commands are tied to tool changes, Path does not apply the changes in SpindleSpeed to the spring pass operation.

This modified postprocessor fixes this problem by removing all spindle start commands issued by the tool change and puts them right at the beginning of the operation. So every operation has its own spindle start command which reflects the changes in spindle rpm between different tool controllers for the same tool#

Let me know what you think.
Attachments
spindle_mod_grbl_post.py
(13.8 KiB) Downloaded 15 times
pauluzs
Posts: 27
Joined: Wed Feb 27, 2019 7:48 pm
Location: Netherlands

Re: Where to insert code to issue G4 command after spindle start?

Postby pauluzs » Sat Mar 09, 2019 10:16 pm

Thanks for explaining,
It doesn't animate chips flying, coolant turning on and off
was clear, No spindle commands wasn't because i thought the ToolController was tied in