Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: vortrex on February 10, 2013, 07:53:23 PM

Title: What are the units of measure??
Post by: vortrex on February 10, 2013, 07:53:23 PM
I have the units set to MM with Alt-U and my gcode is using MM also.  However, when I run the gcode I max out the Z axis on this line.

N150G00G43Z31.750H1

This above line is correct, Z should go to 31.75mm/1.25".  However, in looking at the coordinates in mach3 I can't figure out what units they are in?  I did some rough measurements and see that moving 1" reads about 3.9 in mach3.  This is the reason it is maxing out the Z axis when trying to move to 31.75.  Any ideas what is wrong here?
Title: Re: What are the units of measure??
Post by: ger21 on February 10, 2013, 08:44:56 PM
What are your native units set to, and is there a G20 or G21 in your code?
Title: Re: What are the units of measure??
Post by: vortrex on February 10, 2013, 08:55:14 PM
Yes, there is a G21.

N110G00G21G17G90G40G49G80
Title: Re: What are the units of measure??
Post by: Hood on February 11, 2013, 02:58:53 AM
What is the height offset for tool 1 in the tool table? It could be that as you are calling it.
Hood
Title: Re: What are the units of measure??
Post by: vortrex on February 11, 2013, 10:30:17 AM
the offset is 0, so that's not the problem. why is it when I zero out an axis, then jog a measured 1", my coordinate says 3.9? that's causing the problem since that Z31.75 is off the table.
Title: Re: What are the units of measure??
Post by: ger21 on February 11, 2013, 10:52:04 AM
You didn't say what your native units are set to?
Title: Re: What are the units of measure??
Post by: vortrex on February 11, 2013, 10:54:20 AM
isn't that with the alt-U or are you talking about the setting that's used for the motor tuning?  it's MM both ways.
Title: Re: What are the units of measure??
Post by: Hood on February 11, 2013, 11:51:48 AM
Sounds like your steps per unit are set incorrectly, also as Ger says you need to first choose the native units before you do anything with regards steps per unit. You get that from Config menu then Set Native Units. You only ever do that the one time and if wishing to run code with the opposite units from your native units you change that in code with G20 or G21.
Hood
Title: Re: What are the units of measure??
Post by: vortrex on February 11, 2013, 12:01:45 PM
I'll double check the steps per unit but I thought I set it correctly per the specs.  I know i set it to be MM from the start and have not changed it.
Title: Re: What are the units of measure??
Post by: vortrex on February 11, 2013, 01:39:59 PM
steps per unit is set correctly and native units is MM.  is there some other configuration that would affect this?
Title: Re: What are the units of measure??
Post by: Hood on February 11, 2013, 01:57:26 PM
Ok lets start from the start so we are talking about the same thing. If you zero the axis then command a move from MDI, say G0Z10 what does the DRO in Mach read?
If it is anything other than -10 then either your steps per unit are not correct or you have scaling n that axis.
Hood

Actually the DRO will read -10 even if steps per unit are wrong but what we need to know is does the axis move down 10mm as well.
Title: Re: What are the units of measure??
Post by: vortrex on February 11, 2013, 02:00:08 PM
I'm not at the machine now, but yes, similar to what you said.  if I zero an axis, measure by hand 1", and then manually jog to the 1" mark, my coordinate is 3.9-something instead of being 25.4.  same thing is happening for all the axis.
Title: Re: What are the units of measure??
Post by: Hood on February 11, 2013, 02:02:29 PM
Ok dont jog, command the move and see if motion moved equals axis DRO reading.
Hood
Title: Re: What are the units of measure??
Post by: vortrex on February 11, 2013, 02:49:42 PM
it won't, I can see that when it runs my gcode.  the 31.75 it tries to go to is way off the table, when it should only be 1.25".  I can see this happening.
Title: Re: What are the units of measure??
Post by: Hood on February 11, 2013, 02:52:57 PM
What do you mean it wont?

Why do you talk in mixed units? you are set up in metric yet you are always talking inch?

Set your native units to what you use most, if you use Imperial units the majority of the time your native units should be Inch and your steps per unit should be calculated for inch. If you use Metric most of the time set native units to mm and steps per unit calculated per mm.
Hood
Title: Re: What are the units of measure??
Post by: vortrex on February 11, 2013, 03:45:46 PM
I mean distance moved won't match the DRO, which I have been saying all along.  if I move an axis 25.4mm it will read roughly 3.9mm on the DRO.  so, when my gcode calls for 31.75 it tries to move the axis far further than the table allows.
Title: Re: What are the units of measure??
Post by: Hood on February 11, 2013, 04:57:20 PM
I am not asking you to move a distance, I am asking you to command a move from MDI and see if the DRO corresponds to the command and also if the distance moved corresponds. Jogging a set distance and looking at the DRO is a totally different thing.

Ok think the best thing is for you to attach your xml and answer a few questions so I know what I am looking at.
1. What units (mm or inch) will you predominantly use?
2. What pitch ballscrews do you have?
3. Do you have gearing between motor and screw?
4. Is it steppers? If yes what is the microstepping of the drive?
5. Is it servos? If yes what is the encoder count?

Hood
Title: Re: What are the units of measure??
Post by: vortrex on February 12, 2013, 12:30:36 PM
got it figured out, the docs I was looking at had the wrong steps value.  thanks.