OpenBuilds / OpenBuilds-CAM

Online CNC CAM System
https://cam.openbuilds.com
GNU Affero General Public License v3.0
253 stars 617 forks source link

Center Drill, wrong plunge feedrate used in gcode output #58

Closed petervanderwalt closed 4 months ago

petervanderwalt commented 4 years ago

camFeedrate: "400" camPlungerate: "5"

workspace-2019-10-24.zip

User says "What I set was a feed rate of 5, that is my confusion here, why is doing it at 400 wheare that nuamber came from"

; GCODE Generated by cam.openbuilds.com on 2019-10-21
G21 ; mm-mode
G54; Work Coordinates
G21; mm-mode
G90; Absolute Positioning
M3 S1000; Spindle On

; Operation 0: Drill: Continuous (Centered)
; Tool Diameter: 3.00

G0 Z10
G0 F1000 X14.9674 Y26.9679

G0 Z0
G1 F5 Z0.0000
G1 F400 X14.9674 Y26.9679 Z-6.0000 S1000
G1 F400 X14.9674 Y26.9679 Z0.0000 S1000
; retracting back to z-safe
G0 Z10

M5 S0; Spindle Off

https://openbuilds.com/threads/openbuilds-cam-software.13122/page-4#post-88400 relates

naikymen commented 3 years ago

I have the same issue, and dirty-patched it with a regex in a text-editor.

It is specific for my drill-depth but you'll get it:

Pattern: G1 F1000 (.* Z-5.*)

Replacement: G1 F50 \1


The problem seems to be that (for drilling), the actual plunge is done at cutSpeed (the feedrate) and not at plungeSpeed (see the generateGcode function at js/advanced-cam-gcode.js).

I just wrote "actual plunge" because the intended plunge is futile: there is no movement in the Z direction

G0 Z0
G1 F20 Z0.0000

Only after those lines, the actual plunge uses the feedrate and not the plungerate:

G1 F50 X64.6191 Y52.9875 Z-5.0000 S1000
G1 F50 X64.6191 Y52.9875 Z0.0000 S1000
naikymen commented 3 years ago

The easiest workaround would be to set cutSpeed=plungeSpeed somewhere, only for drilling operations.

naikymen commented 3 years ago

Untill it is fixed, I managed by:

  1. Making a fake milling operation, and setting the feedrate equal to the plungerate.
  2. Deleting that operation, and creating the drill operation.

Ta-da!

; Starting : Closed?:true
G0 Z10
G0 F1000 X64.6191 Y52.9875

G0 Z0
G1 F20 Z0.0000
G1 F20 X64.6191 Y52.9875 Z-5.0000 S1000
G1 F20 X64.6191 Y52.9875 Z0.0000 S1000

I suspect that this works because the code gets values from a "last used" operation if it doesn't have them.