PDA

View Full Version : Getting dizzy cutting circles!



fasteddy
13-05-2010, 07:44 PM
Hi all...

Not even sure i qualify as a newbie, just trying to pop my cherry on my newly built cnc router.. Am running it with Mach 3, but every piece of code I load into it just cuts loads of circles and arcs..
Created some of the code using CamBam, some I got off the net as freebies (a smiley face etc) but Mach 3 just wants to cut circles on all of them..!
Really got me scratching my head on this one.. Have tried to go through all the code but cant spot anything, am beginning to wonder if it is a setting in Mach 3 itself.. Just cant think what..

Any ideas all you CNC gods?

Steve..

irving2008
13-05-2010, 07:51 PM
How about uploading a sample of your G-code.... and start with something simple and circle free, such as a square, in CamBam and lets see what its producing...

John S
13-05-2010, 08:04 PM
Go to Config > General Config and change the arcs to incremental

2143

fasteddy
13-05-2010, 10:53 PM
Hi..

Seems all my cambam nc files have loads of circles overlaying the original designs.. Will have to try another software package to convert to gcode.. Any recommendations for a newbie?
Will go and change my Mach 3 as you suggested John, thanks..

Steve..

fasteddy
13-05-2010, 11:08 PM
Hi again..

Bit adventurous for first time out I know.. But this is an example of what cambam is giving me.. Run it through a simulator and you will see what I mean..

Steve..

John S
13-05-2010, 11:40 PM
Looks fine to me here.
Change your arcs, read post 3.

fasteddy
13-05-2010, 11:53 PM
You sure John? Am running the code through a couple of different simulators and getting hundreds of circles above the main design... Doing this on my PC at home, not the one running my cnc..

Steve..

John S
14-05-2010, 12:13 AM
File with Inc arcs.

2145

File with Abs arcs.

2146

.

Robin Hewitt
14-05-2010, 01:27 AM
The Inc Arcs pic looks like a she-male in plan view :heehee:

fasteddy
14-05-2010, 01:30 AM
Spot on John!! Works a treat now.. Made my first smiley face!!!!

Many thanks..
Steve

John S
14-05-2010, 01:41 AM
Next time slow down and read the posts, you'll go faster that way :whistling:

Send bickies by recorded delivery.

.

Lee Roberts
15-05-2010, 12:53 AM
lol, John...when i said update your advata with a pic of yourself thats not what i had in mind !

moving on...

Why is it adding the arcs and circles John, like why would one need to have such an option if its no good with a design ?

John S
15-05-2010, 10:20 AM
Lee,
I thought the avatar you entered said it all so I left it, it's a bastard getting crumbs out the computer though.

As regards the arcs thing, it's got to be the most posted about fault on Mach, it's well documented but who reads the docs ?

It's not actually a fault running arcs in absolute mode and relative mode is a choice, like imperial and inches. Some people / systems use one or the other, it's more a personal choice.

One problem with Mach is when you select a machine you load an XML file up for that machine, defaults are mach3mill.xml , mach3turn.xml , plasma .xml or if you have named one for a machine you may have called it router.xml

When the xml file is loaded it tells Mach all the information about the machine, steps per inch, ports and pins etc so you can run many machines from the same computer. However xml's are not consistent to each computer, they should be but they are not.

A classic example is the pulse width in motor tuning, I could give you a xml with the pulse width saved to 5 but when I pass it to someone else here computer can read that as anything from 0 to 6, it very computer dependant.

The same applies for the inc / abs arcs, they can change on install.

Art, when he had control of the program before he sold it on knew this and put a code in for it, they are G90.1 for absolute arcs and G91.1 for incremental arcs.

If you work in incremental arcs like most people then putting G91.1 in the startup line either by hand or get the post processor to do it will always load the right choice.

.

irving2008
15-05-2010, 10:28 AM
Lee,
...However xml's are not consistent to each computer, they should be but they are not.

A classic example is the pulse width in motor tuning, I could give you a xml with the pulse width saved to 5 but when I pass it to someone else here computer can read that as anything from 0 to 6, it very computer dependant.
....
Sorry, John, but that make no sense to me. What you are implying is that either each computer reads the same value from the file but does something different with it, or that the value isn't in the file at all and that each computer does its own default setting...

I use XML files for system configuration day in/day out - I have never experienced a situation where two computers read diffeent values from the same XML node on the same file - whats in the file is what gets read, however I could accept that a specific machine uses the value in a different way due to other configuration items.

Lee Roberts
15-05-2010, 12:02 PM
I have to go with Irving on this John, I use allot of xml files as well and if we took vbulletin this is how modifications are installed into the running system and how they do allot of other stuff to. I can’t see they would use such a system for vb because every web server is setup differently so this would give them all sorts of problems wouldn’t it?

Or are there different types of XML file?

And/or this is actually not the computers reading the file differently its Mach and the need for the G90.1, G91.1 codes? Have you been able to replicate and test this inconsistency with different computers John or?

2147
(http://www.bbc.co.uk/blogs/radio3/hobnob.jpg)

irving2008
15-05-2010, 12:23 PM
Or are there different types of XML file?

As you know Lee, there is only one true XML file structure, a heirachy of named nodes, which looks like:


<?xml version="1.0"?>
<root node>
<block with named nodes>
<data item 1>some data</data item 1>
<data item 2>some data</data item 2>
<data item 3>some data</data item 3>
</block with named nodes>
<another block with repeated nodes>
<data item>some data</data item>
<data item>some data</data item>
<data item>some data</data item>
</another block with repeated nodes>
</root node>



Its possible to use the .XML extension for something else but that would be silly..
Its also possible that file might be mis-formed - no closing label to a node for example, that could cause it to get misread, or a node incorrectly named. But you'd expect the reading program to cope with that and flag it to the user.

XML is heavily used for program and system configuration and works... we have over 400 servers and it would be a nightmare if it didnt...

John S
15-05-2010, 04:56 PM
Sorry, John, but that make no sense to me. What you are implying is that either each computer reads the same value from the file but does something different with it, or that the value isn't in the file at all and that each computer does its own default setting...



Possibly it's down to the computer then and not the XML, I'm just a practical big hammer man and don't understand the nuances of programming.

There has recently been a thread on here that proves the pulse width in that Steve Hilton posted to someone [ can't remember who ] about changing it.

Here's some proof,
Download this test XML from http://www.stevenson-engineers.co.uk/files/test.xml and drop it into C:\mach3

Open up the Mach3 loader on the screen and select test.
Then go to Config > Motor tuning and post what the pulse width is. When we have got a few replies I'll tell you what I set it too.

This won't knacker up anything in Mach, it's actually the default Mach3mill xml renamed and a new value saved for pulse width.

The Abs / Inc arcs don't change once set but it depends on who issued the original XML. If you open the test one up which as I say is a copy of the default one it's setup for absolute arcs but 90% of users use incremental.

Unless you understand this then 90% of new users get caught out because the program is in the wrong units as default.

irving2008
15-05-2010, 09:26 PM
I don't have Mach3 installed anywhere, but downloaded it into an XML editor and can immediately see why the pulse width setting would be an issue. This is a classic case of bad design in XML. An XML document should be absolute and the units defined...

If I wrote a document that contained this snippet:


<price>100</price>

and another that said


<price>145</price>

what would you surmise?

But if i wrote


<priceGBP>100</priceGBP>

and


<priceUSD>145</priceUSD>

you'd get it and it would work anywhere...

Even better would be...


<price>
<amount>100</amount>
<currency>GBP</currency>
</price>


In the file you sent the 'pulsewidth' is 19551... but 19551 of what??? and thats the issue... probably relates to machine clock speed or something... which would explain the issue Steve saw...

Incidentally there is no node whose name suggests anything meaningful as regards incremental or absolute arcs, which makes me wonder if its in the file as a default at all until someone changes it, then gets saved as a preference. Maybe the default setting is whatever happens to be in memory at the time the program is first loaded?

John S
15-05-2010, 10:27 PM
In the file you sent the 'pulsewidth' is 19551... but 19551 of what??? and thats the issue... probably relates to machine clock speed or something... which would explain the issue Steve saw...

Incidentally there is no node whose name suggests anything meaningful as regards incremental or absolute arcs, which makes me wonder if its in the file as a default at all until someone changes it, then gets saved as a preference. Maybe the default setting is whatever happens to be in memory at the time the program is first loaded?

Probably clock speed which is why it varies.

When the program is down loaded it defaults to absolute, why I have no idea given that most people use incremental but this is why there is all the confusion over what has been dubbed 'crop circles'

However if you change your post processor to have G91.1 in the startup line, every post you make will force the program to default to incremental and you never see crop circles.

.

Robin Hewitt
16-05-2010, 07:46 AM
You can hook in to a 1KHz interrupt under Windows but it is not exactly fast enough which is why my current mill driver runs DOS. I get the whole computer not just a share of it...

oldhandler=getvect(INTR); // hook in to the interrupt
setvect(INTR,service);
outportb(0x43,0x3c); // set speed
outportb(0x40,timeset&0xff); // low byte
outportb(0x40,timeset>>8); // high byte

... and the timer interrupt is all mine :naughty:

Doesn't half boot quick to when you load DOS on to a GHz machine :smile: