Hello Guest it is February 25, 2021, 06:25:58 AM

Author Topic: mach's rounding of measurements?  (Read 9887 times)

0 Members and 1 Guest are viewing this topic.

mach's rounding of measurements?
« on: April 19, 2010, 10:44:56 AM »
How does mach handle the rounding of decimal points I am looking at using a .375 pitch 26 tooth drive gear(belt) with a 20:1 reducer, with a 200 step stepper. anyways, any formula using a .375 pitch belt vs. a .200 pitch will result in a long carried out decimal number. does mach round up, I assume all is from home. so .375 x 26 = 9.75 divided by 4000 = .0024375 per step in full step. I am not using or going to use micro-step. so to go one inch i need to move 410.34058  am i correct it will move 410 steps with an accuracy of .0024375

Offline ger21

*
  • *
  •  6,288 6,288
    • View Profile
    • The CNC Woodworker
Re: mach's rounding of measurements?
« Reply #1 on: April 19, 2010, 04:57:46 PM »
Mach doesn't round any numbers off internally. If it did, you'd lose position over time. It'll move to the nearest step, 410 in your example.

Are you sure you're math is correct? I don't quite understand  what you're doing, but a 20:1 reduction should get you better than .002 per step.
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Re: mach's rounding of measurements?
« Reply #2 on: April 19, 2010, 11:49:31 PM »
.375 inch times 26 tooth gear(sync) equals 9.75 inches per revolution divided by 200 steps per revolution equals .004875 divided by twenty  equals .0024375 per step of stepper motor. so my calculations i believe are correct? ( a .2 pitch gear [ a 5 tpi lead screw] will round, end up with even numbers) divided by 200 .001 per step......... i didnt think it was rocket science but maybe it is?


Re: mach's rounding of measurements?
« Reply #3 on: April 20, 2010, 12:19:58 AM »
sorry .04875 div by 20, none the less, no rounding? if i was walking towards a doorway and took 2 foot steps i would need to program myself somehow because i can only walk in two foot steps, and the door is closed, so i need to stop out of the door knobs reach or walk through the door? maybe that is all those posts ( i am losing steps) . am I correct im saying the only way this program will work is to use a drive that only runs in thousandths, what if you have a metric screw? or visa versa, a metric screw wont match a us. so the program just wont work and will crash if everything doesnt matc > exactly? :o

Offline Hood

*
  •  25,838 25,838
  • Carnoustie, Scotland
    • View Profile
Re: mach's rounding of measurements?
« Reply #4 on: April 20, 2010, 03:13:02 AM »
Mach will keep track of decimals to 16 positions if I recall but what it cant do is move a distance less than one step. What I am meaning by that is if you command a move to 1.5 x the distance of a step then Mach will just move just one, as commanding two would go past that point you commanded and it is impossible to command a move of half of a step. If you command a further move of 1.5 x your steps(in the same direction) it will move two steps as it kept track of the last move asked for and can now complete the full distance.
Hood
Re: mach's rounding of measurements?
« Reply #5 on: April 22, 2010, 01:52:36 AM »
Am I understanding corrrectly? as in my first post all measurements are from home ( obviously).

410.34058 pulses per inch, say i need to go 1" and .003 thousandths? what if my encoder is in english, and I am using mm, how does mach handle the difference?

from your previous - post hood, mach will never go over a step.... always under?

i am not sure anyone undertsnds the question? i am not trying to move in 1/2 steps but the fact is 10 divided by 3 is what? how does mach deal with it?

the machine cannot possibly line up on 9.5 because 10 divided by 3's 3,6,9 only not 7  not 4, not 5,  I am thinking prime number thing.

I am not asking mach to go to an irregular position, but the fact the gearing is irregular, mach has to choose where it will or will not go.

perhaps rounding was not correct...... linear interpolation of axis movement?

Offline Hood

*
  •  25,838 25,838
  • Carnoustie, Scotland
    • View Profile
Re: mach's rounding of measurements?
« Reply #6 on: April 22, 2010, 04:21:56 AM »
You can set the steps per unit in motor tuning to 8 decimal places so I dont think you need to worry about the difference between imperial and metric.

Hood

Offline Hood

*
  •  25,838 25,838
  • Carnoustie, Scotland
    • View Profile
Re: mach's rounding of measurements?
« Reply #7 on: April 22, 2010, 04:54:07 AM »
To put it another way, with your figures above your steps per unit would be 4000/9.75= 410.256410256410256410256410245 etc
now divide  1 inch by that number and you get 0.0024375000000018281250000013710939 per step
Now instead if you enter to 8 decimal places  it would be 410.25641026 so 1 divided by that is 0.002437499999978618750001866210937 per step
Difference between the two would be 0.00000000000002315624999981474990625163293457
So for example if you moved a distance of 100 inches the rounded to 8 decimals would theoretically be out by 0.000000000950000000000714296153846646 inches
I dont think you need to worry about that, there is probably 1000 x more error in a tooth of your gear.

Hope my calcs are right ;D

Hood
Re: mach's rounding of measurements?
« Reply #8 on: April 22, 2010, 12:00:47 PM »
Looks spot on to me, Hood.  ;D

Randy

Offline RICH

*
  • *
  •  7,419 7,419
    • View Profile
Re: mach's rounding of measurements?
« Reply #9 on: April 23, 2010, 09:23:46 AM »
Randy,
Your showing your age by posting a picture of a back scratcher.......!   :D
Ok, in all fairness, at least you don't need batteries to make it work....!  ;)
 :)  :)
RICH