solved Some problem when Post about G2/G3 with R

w59001

Aktiver Benutzer
Member
Landesflagge
Hi, I am Jerry from Taiwan. Thanks for this software,I use it in school and introduction about CNC machine.

I have some problem when Post about G2/G3 with R
It is ok when post circle using IJ
but some error in R , if the central angle > 180 degree
DXF2GCODE - [D__TestG02G03.dxf].png
TestG02G03a.png
TestG02G03B.png

SINUMERIK840DISOMillingG02G03.png
 

Anhänge

  • TestG02G03.dxf
    8,7 KB · Aufrufe: 2
here is the post file and dxf file.
 

Anhänge

  • 0GRBL.zip
    1,8 KB · Aufrufe: 2
  • TestG02G03.zip
    2,4 KB · Aufrufe: 1
Zuletzt bearbeitet:
Dear spicer:

It's amazing that reply so fast.

I am sorry for my poor English. I has not given the question a very detailed description of the postprocessor.

My question is I need a minus sign(-) before R if the central angle > 180 degree.

mypost about G2

arc_int_cw = G2 X%XE Y%YE R%R%nl

the nc code like this

G2 X19.05 Y12.89 R2.24

but i need this if angle of the arc is big then 180 degree

G2 X19.05 Y12.89 R-2.24

I am not familiar with Python but in C

I guess the program like this

if abs(s_ang - e_ang) > pi:
R=0-R

in somewhere(maybe dxf2gcode/core/arcgeo.py or /dxf2gcode/postpro/postprocessor.py)
 

Anhänge

  • TestG02G03C.png
    TestG02G03C.png
    145 KB · Aufrufe: 11
Thank you, Chrisko.
I download the file from sourceforge , both (or just one )arcgeo.py and postprocessor.py and rename the old python file to *.old then try again, but it still not work
2025-02-25 08_48_25-Double Commander 1.1.22~662.png
2025-02-25 08_44_20-CIMCO Edit v5 - [D__TestG02G03.nc].png

here is test post file and dxf file.
 

Anhänge

  • testG02G03.zip
    4,3 KB · Aufrufe: 1
Hi, maybe i was not totaly clear here. I did point to the aereas in the code where YOU could add the requested change. Your code looks fine i guess.

Code:
Bitte, Anmelden oder Registrieren to view codes content!

As your change is very specific i won't implement it in the code but feel free to add the line at one on the proposed places. That should solve you issue.
 
As your change is very specific
Sorry,I don't think that. We have three major type controllers in CNC mill machine in our school (Sinumerik 840,Fanuc 0i-md,Mitsubishi M70).They all supprot the "-R" funtion. It is almost a industry standards.
Here is the Programming Manual of Sinumerik on page 22.
 

Anhänge

  • PGM_0609_en_en-US.pdf
    1,9 MB · Aufrufe: 0
I try to add the code in arcgeo.py near program bottom

if abs(s_ang - e_ang) > pi:
r=-r

2025-02-25 08_44_20-CIMCO Edit v5 - [D__TestG02G03.nc].png

but it not work properly,

for example a arc ,look from center o in the third quadrant.

s_ang=-3 e_ang=-1.8 the abs(s_ang - e_ang)=abs(-3 - (-1.8))= abs(-1.2) = 1.2 < pi , so it not work, but the arc > 180 degree

I guess s_ang and e_ang between -pi and pi for the arc. I need more time to understand fuction about dif_ang(),norm_angle(),atan2()....
2025-02-26 15_16_39-DXF2GCODE - [D__TestG02G03.dxf].png
2025-02-26 15_17_04-CIMCO Edit v5 - [D__TestG02G03.nc].png
 
Zuletzt bearbeitet:
I spend a lot of time to learn python and review mathematic texbook.
Then I add two lines in the program (arcgreo.py) and it seem work fine.

if abs(self.ext) > pi:
r = -r

Thank you, Chrisko.
2025-03-09 16_37_31-D__dxf2gcode_dxf2gcode_core_arcgeo.py - Notepad++.png
2025-03-09 16_57_27-DXF2GCODE - [D__TestG02G03.dxf].png
2025-03-09 16_52_09-CIMCO Edit v5 - [D__TestG02G03.nc].png
 
By the way,
I finish about 70% translations from english to Traditional Chinese.
Can I provide dxf2gcode_zh_tw.ts and dxf2gcode_zh_tw.qm to add in the dxf2gcode project.
 

Anhänge

  • dxf2gcode_zh_tw.zip
    15,5 KB · Aufrufe: 0

Benutzer welche diesen Thread betrachten (Mitglieder: 0, Gäste: 0)

Wer hat diesen Thread gelesen

Zurück
Oben