![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| G-Code Programing Discuss G-code programing and problems here! |
| This forum is sponsored by: |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| |||
| |||
Hi, I'm currently a software engineering for a laser company and am programming a GCode display program in C#. How would I go about displaying arcs using I/J values? As far as drawing arcs goes here are my options: x, y, width, height, startAngle, sweepAngle Rectangle, startAngle, sweepAngle How would I gather the startAngle and sweepAngle from the GCode? Another option would be just to draw an arc using straight lines... How should I approach this? |
|
#2
| ||||
| ||||
| There is some info here that may give you some ideas: http://www.cnczone.com/forums/austra...e_indexer.html |
|
#4
| |||
| |||
| The best place I found that describes the different methods of arcs in G code is the Mach3 manual. It can be found at http://www.machsupport.com/docs/Mach3Mill_1.84.pdf Look at section 10.7.3.1 and 10.7.3.2 George |
|
#5
| |||
| |||
|
| Sponsored Links |
|
#6
| |||||
| |||||
| Example NCPlot. NCPlot.com - Tools for CNC Programmers
EMC Documentation Wiki: Simple EMC G-Code Generators "Axis" does the backplotting for EMC2. It's open source but wading through the code will take a lot of effort. More python.
G02 and G03 defines arcs so why go there ? edit/ G02 and G03 use 'start point/end point/distance from center' (or alternatively R). If sweep is needed the program will need to make the calculation, it helps to think in quadrants.
__________________ Anyone who says "It only goes together one way" has no imagination. |
|
#7
| |||
| |||
|
|
#8
| |||
| |||
When writing software to display the tool path, you can: 1. Easily calculate the arc center point in systems using I and J to describe the center point incrementally, by applying the I and J values to the arc start point. 2. In systems using I and J to describe the arc center in Absolute terms, the center requires no calculation. 3. In systems using R, the center point is calculated using the Start, End points and the R value. I can give you the algorithm for this if its a help to you. Once the arc center is known the Start and End angle of the arc is calculated using simple trigonometry. If the software is to display the cutter path of a laser machine (top view of XY plane) then using arc center, start angle, sweep angle, and radius is the best solution. If the display is an Isometric view, then the properties of the arc will still have to be calculated based on the G code data, but the acr will be drawn using short, straight lines because the representative curve drawn in the display will not be a true arc. Regards, Bill |
|
#9
| ||||
| ||||
| ZSamuels, if I understand your question correctly, you're trying to write a g-code simulator in C++ to be used with your laser. Is that correct? If so, there's quite a lot for you to consider. I've got a simulator in Beta Test called G-Wizard Editor: GWizard Editor: A G-Code Editor and Simulator Something you may find useful about GWE is it has a facility called "Hints" for folks that are not dyed in the wool g-code experts (actually it is helpful to many experts too, LOL). It pumps out a lot of information about each line of g-code in easy to understand English. Here is a typical hint with information on an arc, for example: ![]() You might find it useful just because it provides a lot of information about the arc that is not immediately obvious just looking at the raw g-code. As for the other considerations of a g-code simulator, the language has all sorts of ways to modify what's going on that you'll need to be aware of depending on which dialect your laser's controller plans to support. For example, you'll need to be prepared to plot the arc when scaling, work offsets, coordinate rotation, and various other factors are in play. Quite a bit of work required to build a general purpose simulator, LOL. Probably the best place to drill down and see at least one way things are done is to go check out the source code for EMC2. Best, BW
__________________ Try G-Wizard Machinist's Calculator for free: http://www.cnccookbook.com/CCGWizard.html |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Gcode sub program example needed | MrWild | LinuxCNC (formerly EMC2) | 14 | 09-03-2010 05:51 PM |
| 4th-Axis GCode Programming | twehr | G-Code Programing | 6 | 09-17-2009 06:31 PM |
| Newbie Q: (Mach/Gcode/Tormach?) display vars? | rc33 | Tormach PCNC | 10 | 11-18-2008 03:16 PM |
| Can you use the graph feature to display sub program moves? | Shotout | Haas Mills | 15 | 11-27-2007 02:27 PM |
| Toolchanging and offsets gcode programming | ddanutz | G-Code Programing | 12 | 11-04-2006 04:39 PM |