CarlosGS / Cyclone-PCB-Factory

Cyclone (Circuit Cloner) is a parametric CNC mill design intended for PCB manufacturing.
https://reprap.org/wiki/Cyclone_PCB_Factory
1.15k stars 342 forks source link

Changing Feed Rates in GCode not being honoured #36

Closed joco-nz closed 9 years ago

joco-nz commented 9 years ago

As part of the calibration of the CNC I wanted to use the zig-zag pattern from precisebits.com. I created a fixed co-ord version so that it rendered nicely in gcode-cnc-controller and did a dry run (i.e. Z 0 set at 3mm above the copper). The whole idea behind this code zig-zag is to change the feed rate on each line so that you can tune in what is the best feed rate for this material. However the feed rate changes are NOT being honoured.

Anyone able to replicate this?

Code below incase I have an issue in that. Note this version starts fast and slows down. This was done to debug the issue and speed up the process.:

G90
G00
G21
F400
G01 Z15
G01 X0 Y0
M03
F60
G01 Z-0.1
G90
( **START ZIGZAG** )
F150
G01 X24 Y3
G01 X0 Y6
F130
G01 X24 Y9
G01 X0 Y12
F110
G01 X24 Y15
G01 X0 Y18
F90
G01 X24 Y21
G01 X0 Y24
F70
G01 X24 Y27
G01 X0 Y30
F50
G01 X24 Y33
G01 X0 Y36
F30
G01 X24 Y39
G01 X0 Y42
( **END ZIGZAG** )
G90
G00
F400
G01 Z15
G01 X0 Y0
M05
M02
ve3sjk commented 9 years ago

The max feed rates are set in the marlin code I think around line 498 that is what is likely Limiting the movements, I think I saw message a once in the communications window Where marlin was throwing back, “using default rates” when I tried to move faster

They are in mm/sec in the marlin code as well, and in mm/min in the cnc-gcode controller so you have to convert to get the right numbers.

From: James [mailto:notifications@github.com] Sent: Wednesday, December 24, 2014 2:58 AM To: carlosgs/Cyclone-PCB-Factory Subject: [Cyclone-PCB-Factory] Changing Feed Rates in GCode not being honoured (#36)

As part of the calibration of the CNC I wanted to use the zig-zag pattern from precisebits.com. I created a fixed co-ord version so that it rendered nicely in gcode-cnc-controller and did a dry run (i.e. Z 0 set at 3mm above the copper). The whole idea behind this code zig-zag is to change the feed rate on each line so that you can tune in what is the best feed rate for this material. However the feed rate changes are NOT being honoured.

Anyone able to replicate this?

Code below incase I have an issue in that. Note this version starts fast and slows down. This was done to debug the issue and speed up the process.:

G90 G00 G21 F400 G01 Z15 G01 X0 Y0 M03 F60 G01 Z-0.1 G90 ( START ZIGZAG ) F150 G01 X24 Y3 G01 X0 Y6 F130 G01 X24 Y9 G01 X0 Y12 F110 G01 X24 Y15 G01 X0 Y18 F90 G01 X24 Y21 G01 X0 Y24 F70 G01 X24 Y27 G01 X0 Y30 F50 G01 X24 Y33 G01 X0 Y36 F30 G01 X24 Y39 G01 X0 Y42 ( END ZIGZAG ) G90 G00 F400 G01 Z15 G01 X0 Y0 M05 M02

— Reply to this email directly or view it on GitHub https://github.com/carlosgs/Cyclone-PCB-Factory/issues/36 . https://github.com/notifications/beacon/AHR23D4aY682nChIZoV0cGIWDC3_TNUKks5nammCgaJpZM4DL4cw.gif

joco-nz commented 9 years ago

Understand the Marlin limits and what I a trying to run in this g-code is well within the max speeds allowed in Marlin. The issue isn't the max speed its that the F codes are not changing the speed once set by the first F code. If I start with the F30 then everything is done at F30 even if later an F60 is issued. Equally if I start at F400 then everything is done at that speed even if a later F60 is issued.

CarlosGS commented 9 years ago

Are you sending this gcode with CNC-Gcode-controller? On 24 Dec 2014 10:20, "James" notifications@github.com wrote:

Understand the Marlin limits and what I a trying to run in this g-code is well within the max speeds allowed in Marlin. The issue isn't the max speed its that the F codes are not changing the speed once set by the first F code. If I start with the F30 then everything is done at F30 even if later an F60 is issued. Equally if I start at F400 then everything is done at that speed even if a later F60 is issued.

Reply to this email directly or view it on GitHub https://github.com/carlosgs/Cyclone-PCB-Factory/issues/36#issuecomment-68039143 .

ve3sjk commented 9 years ago

It looks like you need to put the F commands on the same line as movement like this, it still gives warning on three lines but it appears to change the speed this way

G90 G00 G21 G01 Z15 G01 X0 Y0 F400 M03 G01 Z-0.1 F60 G90 ( START ZIGZAG )

G01 X24 Y3 F150 G01 X0 Y6

G01 X24 Y9 F130 G01 X0 Y12

G01 X24 Y15 F110 G01 X0 Y18

G01 X24 Y21 F90 G01 X0 Y24

G01 X24 Y27 F70 G01 X0 Y30

G01 X24 Y33 F50 G01 X0 Y36

G01 X24 Y39 F30 G01 X0 Y42 ( END ZIGZAG ) G90 G00 G01 Z15 F400 G01 X0 Y0 M05 M02

CarlosGS commented 9 years ago

The default Marlin firmware won't understand the F command by itself, it needs to be sent via CNC-Gcode-Controller which will make the translation. Can you point out if the problem is in Marlin or in CNC-Gcode-Controller? :)

On Wed, Dec 24, 2014 at 7:26 PM, ve3sjk notifications@github.com wrote:

It looks like you need to put the F commands on the same line as movement like this, it still gives warning on three lines but it appears to change the speed this way

G90 G00 G21 G01 Z15 G01 X0 Y0 F400 M03 G01 Z-0.1 F60 G90 ( START ZIGZAG )

G01 X24 Y3 F150 G01 X0 Y6

G01 X24 Y9 F130 G01 X0 Y12

G01 X24 Y15 F110 G01 X0 Y18

G01 X24 Y21 F90 G01 X0 Y24

G01 X24 Y27 F70 G01 X0 Y30

G01 X24 Y33 F50 G01 X0 Y36

G01 X24 Y39 F30 G01 X0 Y42 ( END ZIGZAG ) G90 G00 G01 Z15 F400 G01 X0 Y0 M05 M02

Reply to this email directly or view it on GitHub https://github.com/carlosgs/Cyclone-PCB-Factory/issues/36#issuecomment-68068247 .

ve3sjk commented 9 years ago

@carlosgs I am not sure if its a problem at all or just and issue with how you put the commands in gcode, the file seems to change speeds if the F commands are inline with movement otherwise it gives zero movement warnings and ignores them. I noticed this myself with pcb2gcode from eagle, it will put almost all the F commands as i did above, but it often leaves a few on their own and cnc-gcode-controller flags warnings for all the single ones. I am testing that code with the lastest version of cnc-gcode-controller that has your new zero tool options, i made the file via the repo and netbeans to build it.

joco-nz commented 9 years ago

@carlosgs I'm using CNC-Gcode-Controller. I also had the F codes on lines like this and no change happened: G1 F40

I don't think the issue is in Marlin as I run that on my 3d printer and that honours speed changes during prints. .i.e. Slower perimeters, faster in fill, medium speed support material.

I'll have a try using @ve3sjk suggestion. But if CNC-Gcode-Controller is doing the translation as you say then it shouldn't matter. Unless CNC-Gcode-Controller does something a bit naughty and doesn't actually send the subsequent F commands after the first one?

ve3sjk commented 9 years ago

@joco-nz even that G1 F40 is a command without movement, cnc-gcode-controller seems to ignore it. I tested the file as i changed it and the movements change as expected it starts fast then gets slower

joco-nz commented 9 years ago

Thanks @ve3sjk I'll give that a whirl. I'll also make myself have a look at the CNC-Gcode-Controller code to see what it does. It really shouldn't be ignoring commands we give it. I just wish it wasn't written in Java. Reading that stuff makes my eyes bleed. ;-)

joco-nz commented 9 years ago

@ve3sjk yup your code works a treat. The Java code looks like it should pass a G1 Fnnn type code through but when I tried that approach I didn't have any luck. I'll do some more tests to see if I cna narrow things down. I'll also try things in pronterface and see how things behave.

joco-nz commented 9 years ago

Closing as there is a working pattern identified by @ve3sjk .