Author Topic: G03 corner problem  (Read 18925 times)

Offline Roidy

  • Ewok
  • *
  • Posts: 13
    • View Profile
G03 corner problem
« on: December 23, 2007, 13:46:18 pm »
Hi all

I`m new to CamBam and CNC in general, just finished my first CNC machine and am testing it using CamBam. I created a simple dxf file containing just a square 10mmx10mm. I imported it into CamBam converted to polylines and joined it. I then applyed a 2.5d Profile operation to it but CamBam adds G03 commands to the corners which are really slow on my machine. How do I stop CamBam from adding the G03`s to the corners. Below is the g-code CamBam generated. Surely CamBam should get to a corner and just change direction 90degrees and not add an arc into the corner. Is there an option to change this?



( This file was created automatically using CamBam )
( http://www.brusselsprout.org/CAMBAM )
( 12/23/2007 1:22:50 PM )
( T0 : 2 )
G21
G90
G64
G00 Z1.5
( MOPProfile_2 )
( T0 : 2 )
M06 T0
M03
G00 X0 Y-1
G01 F30 Z-1
G01 F300 X10
G03 X11 Y0 I0 J1
G01 Y10
G03 X10 Y11 I-1 J0
G01 X0
G03 X-1 Y10 I0 J-1
G01 Y0
G03 X0 Y-1 I1 J0
G00 Z1.5
M05
M30


Thanks
Rob

Offline mrbean

  • Administrator
  • Storm Trooper
  • *****
  • Posts: 213
  • Web Jedi
    • View Profile
    • MrBean's CNC Projects
Re: G03 corner problem
« Reply #1 on: December 23, 2007, 15:10:58 pm »
Why are G03's so slow on your machine?
what controller are you using, Mach3, TCNC, EMC??

It may be an issue with your controller setup, beacuse G03 shoulnd't be that much slower than your average G01 move speeds, especially as you're using G64 mode, unless you got something weird going on.

Offline Roidy

  • Ewok
  • *
  • Posts: 13
    • View Profile
Re: G03 corner problem
« Reply #2 on: December 23, 2007, 16:54:16 pm »
I`m using TurboCNC with home made fullstep bipolar drivers. G01 commands zip along at full speed but as soon as it encounters a G03 command it takes 2-3 minutes to mill a small radius that doesn`t really need to be there. I`m also having the same problem flyboy describes in the thread Strange "pimple" on Text Pocketing MOP. Sometimes CamBam will add a strange G03 command where two lines join or where an arc and a line join resulting in strange small circles milled into your work.  The path looks perfect in CamBam but in MicroTech CncSimulator and on the mill its wrong. I`ve attached a couple of pictures and my source files.

Thanks Roidy


Offline mrbean

  • Administrator
  • Storm Trooper
  • *****
  • Posts: 213
  • Web Jedi
    • View Profile
    • MrBean's CNC Projects
Re: G03 corner problem
« Reply #3 on: December 23, 2007, 17:55:21 pm »
Can you try this gcode in your simulator,  see if it's any different?

Offline Roidy

  • Ewok
  • *
  • Posts: 13
    • View Profile
Re: G03 corner problem
« Reply #4 on: December 23, 2007, 18:06:14 pm »
No I`m afraid it`s even worse, very strange problem.

Thanks
Roidy

Offline mrbean

  • Administrator
  • Storm Trooper
  • *****
  • Posts: 213
  • Web Jedi
    • View Profile
    • MrBean's CNC Projects
Re: G03 corner problem
« Reply #5 on: December 23, 2007, 18:19:59 pm »
That's weird.  I'll keep hold of the file.  I'll prolly be chatting with 10bulls later so I'll send him what I have for investigation.
With your file and my file generating differing amounts of weirdness, we may be able to get a better idea of what's happening.

For what it's worth Mach3 doesn't show the error.  Nor does it cut those extra bits.
The file machines perfectly fine.

Offline Roidy

  • Ewok
  • *
  • Posts: 13
    • View Profile
Re: G03 corner problem
« Reply #6 on: December 23, 2007, 19:07:40 pm »
Thanks for the help,

I just tried it in AutoEditNC and I get even more errors.

Roidy

Offline Roidy

  • Ewok
  • *
  • Posts: 13
    • View Profile
Re: G03 corner problem
« Reply #7 on: December 23, 2007, 19:22:33 pm »
Getting somewhere now, I just changed the Number format under Machining options from 5 to 3 decimal places, now it simulates ok in MicroTech CNCSim but still has some problems in AutoEditNC. I will try machining it tomorrow and see what happens.

Offline Mickster

  • Ewok
  • *
  • Posts: 40
    • View Profile
Re: G03 corner problem
« Reply #8 on: December 23, 2007, 21:40:00 pm »
Have a quick peek at these posts/threads:
http://www.forum.cambam.org/index.php/topic,168.msg1135.html#msg1135
http://www.forum.cambam.org/index.php/topic,168.msg1187.html#msg1187

and also check the settings in TurboCNC for Absolute/Incremental mode in 'Configure - RS 274 Dialect - Arc IJK Offsets'. I believe it should be set to 'Incremental'...

Offline 10bulls

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 2164
  • Coding Jedi
    • View Profile
    • www.cambam.info
Re: G03 corner problem
« Reply #9 on: December 23, 2007, 22:12:34 pm »
Hello Roidy,

It does sound like there is something wrong with the way your machine is handling arcs.  If anything, arcs should be faster than line moves as the controller *should* be powering both motors simultaneously and the distance around corners is shorter.  The alternatives to arcs is to use lots of small line moves but this will cause slow downs on some controllers that do not 'look ahead' as the controller is constantly ramping the speeds up and down.

As to the arc glitches...

I seems that some controllers have problems with very small arcs. 
To help resolve this, I put an interim release here...
http://www.forum.cambam.org/index.php/topic,156.0.html
which has an extra user option to set the limit of the smallest size of arc in toolpath generation.

There is some more information in this thread...
http://www.forum.cambam.org/index.php/topic,193.0.html

I have done some manual checking on some of these file and it looks like the small arcs are defined accurately, but the numbers involved may bump up against precision errors in controllers and simulators that use low precision numbers.  I am reasonably confident the MinimumArcLength setting should fix that.

Offline Roidy

  • Ewok
  • *
  • Posts: 13
    • View Profile
Re: G03 corner problem
« Reply #10 on: December 24, 2007, 11:12:08 am »
Thanks to everyone for the help, as soon as I`m able to get out to the workshop I`ll give it another try. 10bulls I carn`t seem to get the MinimumArcLength option to work, Maybe I just don`t understand how it works. Taking my first example I have a dxf square 10mmx10mm, I convert it to polylines, join and apply a 2.5D MOP with a ToolDiameter of 2mm. Now with MinimumArcLength set to a low value say 0.1 I can generate a toolpath and it has G03 arcs at the corners. Now if I change MinimumArcLength to say 2, which by my understanding should convert the G03 corner arcs to lines, I am unable to generate a toolpath.

Offline Roidy

  • Ewok
  • *
  • Posts: 13
    • View Profile
Re: G03 corner problem
« Reply #11 on: December 24, 2007, 14:05:31 pm »
Ok did a couple of quick tests one with TurboCNC set to ARC IJK Absolute and one with ARC IJK set to Inc. Put a pencil in the machine and ploted the toolpaths. Abs went crazy, Inc worked perfect. I`m still having problems with arcs taking forever to move, anyone have any ideas why. I would still like to know why CamBam adds arcs on corners where two lines meet, seems like a waste to me.

Thanks to everybody for the help.

Offline 10bulls

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 2164
  • Coding Jedi
    • View Profile
    • www.cambam.info
Re: G03 corner problem
« Reply #12 on: December 24, 2007, 15:01:55 pm »
Where 2 straight edges meet at a corner, the shortest distance around that corner is an arc (with the center on the corner).  As well as the distance being less than say carrying on past the corner then stop, 90 turn then start off again.  Imagine going down the freeway and in order to take a turn off, you pull on the hand break, slide sideways then wait to stop before flooring it to head off in the other direction.  Entertaining yes, but it's not the most efficient way of driving your machine.  With arcs, while one motor is slowly decelerating, the other is accelerating.  Arcs sound nicer!  If your driver and controller are setup, a series of arc toolpaths just sounds nice and smooth.  Lots of straight segments sounds very juddery.  Then there is the actual cutting business.  Driving a cutter into a 90 degree bend can be rather unpleasant.  I am not a machinist (IANAM), but I think curved cutting paths are more efficient and kinder on your cutters.

If you really really don't want to do ANY arcs, then you can set the ArcOutput machining option to ConvertToLines, but as it suggests the many short segments may cause jittering with TNC.

With the MinArcLength, i think at a certain point, the min arc length is too big, it needs to replace the 90 degree arcs with a straight line, which it can't do as this would end up cutting the corner.  MinArcLength is more useful to avoid those small glitches where filler arcs are used at a size which upsets the interpreter.

Have you tested your driver setup?  Sometimes things like a motor step signal that needs inverting can cause odd behaviour.  Is your motor tuning OK?  Is acceleration and deceleration sensible?  You should be able to get your machine moving in a nice smooth circles using arc moves, if not somethings up.  Good Luck!

Offline Mickster

  • Ewok
  • *
  • Posts: 40
    • View Profile
Re: G03 corner problem
« Reply #13 on: December 24, 2007, 15:12:59 pm »
Just taking a wild stab here:

Have a look in 'Configure - General Config' and check the "Arc Factor" (Default is 1).
From the TurboCNC help file..."Arc Factor: This option provides a method of adjusting timing loops used when cutting an arc to the speed of the computer. Values less than one increase the loop speed, those above one decrease it. If you notice lost steps while cutting arcs decrease this value to 0.8 or less."

Also, check the setting in 'Machine' (Default is 'Custom', but there are multiple settings, one of which is for Mill/Drill)

Under 'Configure - Configure Axes', what are your settings for 'Accel, Start Vel & Max Vel'?
A slow Accel would not be that apparent on a linear move along one axis, but arcs & diagonals can result in tiny start/stop movements with a slow Accel due to the steppers ramping up & down as Andy pointed out earlier.

Are your steppers all the same, or are they mixed? I believe (but I could be wrong) that using mixed steppers on arcs & diagonals causes the slowest stepper settings to be used for both axes.

Offline Mickster

  • Ewok
  • *
  • Posts: 40
    • View Profile
Re: G03 corner problem
« Reply #14 on: December 24, 2007, 15:13:40 pm »
Pipped by Andy!  ;D