FullControlXYZ / fullcontrol

Python version of FullControl for toolpath design (and more) - the readme below is best source of information
GNU General Public License v3.0
672 stars 78 forks source link

[QUESTION] How do you get around function-induced speed changes? #84

Open Timothee-Leblond opened 7 months ago

Timothee-Leblond commented 7 months ago

Hi there,

I've noticed that when a function is added, such as fc.squarewaveXY or fc.travel_to, a speed index (equal to the default value specified in intial parameters) is consistently added afterwards, as shown in the screenshot (the F values are induced by these functions). I'm having trouble with this because I've made the speed vary during printing and the functions I've mentioned reset the F value for each new layer.

Is there any way to prevent these functions from modifying speed?

Capture d’écran 2024-04-25 à 14 46 43
fullcontrol-xyz commented 7 months ago

The speed instruction is not added by those functions but results from the change between G0 and G1 commands. fc.travel_to simple adds three objects to your list of steps for:

The speed change comes about because G0 and G1 commands typically have different speeds and need the F speed to be included to achieve that (fullcontrol doesn't check if speed has changed, it just puts in a speed when there is a change between G1 and G0.

I'm not sure how you're changing speed. But if you use an fc.Printer(print_speed = ###, travel_speed = ###) then things should work fine. And you need to make sure you supply the correct print_speed and travel_speed as initialization data when transforming from the design to gcode.

If you mean you're changing speed during printing with some kind of manual adjustment or command on the machine, you can try to use the speed factor (M220), which applies after the F### speed setting. Alternatively, you can do a postprocess on the gcode in python or in notepad to replace all F300 terms with nothing. Use chat gpt and ask it to create a python function that takes a string and replaces all "F300" terms with nothing and it should work well. Then in FullControl, don't save the gcode to file directly with the fc.transform function, but assign it to a variable. E.g. gcode = fc.transform(...) Then you can edit the gcode before saving it to file.