Skip to content

Conversation

@gb0101010101
Copy link
Contributor

This patch only provides rendering support to WebControl using radius R in G2/G3 commands.
It does not modify gcode and the code will not work on Malsow Firmware until that is patched.

Test gcode

G90 G00 X-2.0 Y-1.0
G01 X0 Y0 F8.0           ; point A
Y4.0                     ; point B
G02 X2.0 Y6.0 R2.0       ; point C
G01 X8.0                 ; point D
G02 X9.0 Y2.268 R2.0     ; point E
G01 X0 Y0                ; point A
G00 X-2.0 Y-1.0

See rendered example
http://www.helmancnc.com/cnc-g02-circular-interpolation-clockwise-cnc-milling-sample-program/

@gb0101010101
Copy link
Contributor Author

Maslow Firmware PR added to support commands:
MaslowCNC/Firmware#541

G3 test code:

G90 G00 X-2.0 Y-1.0 
G01 X0 Y0 F30.0         ; point A 
Y4.0                    ; point B 
G03 X-2.0 Y6.0 R2.0     ; point C 
G01 X-8.0               ; point D 
G03 X-9.0 Y2.268 R2.0   ; point E 
G01 X0 Y0               ; point A 
G00 X-2.0 Y-1.0

@Orob-Maslow
Copy link
Contributor

All things considered, testing was a success. I successfully compiled and flashed the firmware using webcontrol (separate story if desired). Loaded the new webcontrol and ran G3 and then G2. I have attached a screenshot of what they looked like and a picture of the marker on my board. The G2 path was over a hole, but it ran. A strange thing then occurred after I moved the sled over to a spot where the marker could trace the G2 gcode again. Pressing play, it sends 8 lines and then just sits there. It would work for G3, but not the G2. Looking at the log, there was a buffer overrun condition, so after turning off the maslow setting "buffer gcode," it worked fine.
See attached screenshots and photo. The G3 has the object above and to the left of the home position and the G2 has the object above and to the right of the home position.

Item of interest: the webcontrol visualizer does not handle R, so the arcs look like straight lines in the webcontrol board, but when the sled moves, it goes off the line and you can see the arc as the red reticle travels.

note: I run everything in metric, so I muliplied X Y coordinates everything by 10 and in mm. With a feed rate of 500.

These are the files that were run:

G3

M3
G90 (absolute positioning)
G21 (All units in mm)

G90
G00 X-20.0 Y-10.0
G01 X0 Y0 F500.0 (point A )
Y40.0 ( point B )
G03 X-20.0 Y60.0 R20.0 ( ; point C )
G01 X-80.0 (; point D )
G03 X-90.0 Y22.68 R20.0 ( ; point E )
G01 X0 Y0 (; point A )
G00 X-20.0 Y-10.0

(Footer)
M5
G00 X0.0000 Y0.0000
M2
(end)
%


G2

M3
G90 (absolute positioning)
G21 (All units in mm)

G90
G00 X-20.0 Y-10.0
G01 X0 Y0 F500.0
Y40.0
G02 X20.0 Y60.0 R20.0
G01 X80.0
G02 X90.0 Y22.68 R20.0
G01 X0 Y0
G00 X-20.0 Y-10.0

(Footer)
M5
G00 X0.0000 Y0.0000
M2
(end)
%

IMG_20200516_162835784
G3
G2

Orob-Maslow
Orob-Maslow previously approved these changes May 17, 2020
Copy link
Contributor

@Orob-Maslow Orob-Maslow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code functioned as intended for both G02 and G03 with R commands. See comments in the PR

@gb0101010101
Copy link
Contributor Author

gb0101010101 commented May 19, 2020

@Orob-Maslow Thanks so much for testing this! Glad to see it worked.

@Orob-Maslow @madgrizzle
Please go to MaslowCNC/Firmware#544 and give it a thumbs up so that it will be accepted. Click on smiley in first post and select the thumbs up icon.

Correction: Click on the smiley on the comment by MaslowCommunityGardenRobot and give it a thumbs up.
MaslowCNC/Firmware#544 (comment)

@davidelang
Copy link

davidelang commented May 19, 2020 via email

@madgrizzle madgrizzle requested a review from Orob-Maslow May 22, 2020 16:24
@madgrizzle madgrizzle dismissed Orob-Maslow’s stale review May 22, 2020 16:24

We need to handle mismatched firmware.. see comment

@madgrizzle
Copy link
Collaborator

I tried this out but WITHOUT using the modified firmware and it caused fits (sled not keeping up errors), things cutting in wrong spot, etc. I think we need a message or something that alerts the user that the gcode loaded is not compatible with the firmware if they haven't updated it. I know its a bit of a pain to do, but somewhere down the line someone is going to post about why their gcode isn't working..

@Orob-Maslow
Copy link
Contributor

Orob-Maslow commented May 25, 2020

Maslow has been acting weird with R values since it was designed. My first cut was messed up because R wasn't supported. My original feature request was a parsing filter to remove the R's from gcode so it wouldn't do weird things. It is supported in all the other gcode systems, so if anything there should be a warning that it isn't / wasn't supported. I think this is a mandatory upgrade because of that. Roll in the Z limits and the enhanced calibration options and it will be a very nice package.

EDIT: this is a firmware fix, not a webcontrol fix.

@gb0101010101
Copy link
Contributor Author

When using Maslow firmware or WebControl versions before this fix the results would be wrong cuts, wrong display of cut paths, and/or sled not keeping up errors.
Please let me know how I could check Maslow firmware version to ensure that WebControl will cut the displayed paths which would now be correctly displayed?

@Orob-Maslow
Copy link
Contributor

first of all, the new firmware needs a rev number bump. MaslowCNC/Firmware#544. then in gcodefile.py in the drawarc function, there needs to be something like this:
r = re.search("R(?=.)(([ ])?[+-]?([0-9])(.([0-9]+))?)", gCodeLine)
if r:
#check firmware here to verify compatibility and if not there, flash warning about firmware upgrade required...
#if self.data.controllerFirmwareVersion > 1.26 or whatever the current number is with the 544 r code then ok
rTarget = float(r.groups()[0]) * self.canvasScaleFactor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants