586,111 active members*
3,232 visitors online*
Register for free
Login
IndustryArena Forum > CNC Electronics > Gecko Drives > Steps per inch formula, What I am doing wrong?
Results 1 to 14 of 14
  1. #1
    Join Date
    Jul 2003
    Posts
    67

    Steps per inch formula, What I am doing wrong?

    I am trying to determine my steps per inch for servos with a 1024 ppr encoder, but my calculation seems to be off. The screw has a 13/64" lead and I have the motors geared down using 32 and 20 tooth pulleys. I was using this...

    1 inch /((1/ppr encoder count)*(Motor Pullet Tooth Count/ Ballscwew Pulley Count)*(Screw Lead)

    Is this wrong? The software is Mach 1. One thing I am uncertain of. I am assuming G320's will count 1024 steps from the pulse source as one rotation of the motor, right?

  2. #2
    Join Date
    Mar 2003
    Posts
    4826
    Thread lead is 13/64 = .203125

    1024 / .203125 = 5041.2307 pulse per inch at one to one ratio

    But, at 20/32 ratio

    5041.2307 / 20/32 = 8065.9689 p/inch

    Question: are you sure about this lead? It wouldn't be a metric screw would it? 5mm = .19685 inch

    BTW, if the controller reads the encoder as a quadrature encoder, you will know because the movements will be out by a factor of 4.
    First you get good, then you get fast. Then grouchiness sets in.

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  3. #3
    Join Date
    Jul 2003
    Posts
    67
    Ah, thats probably it. Quadrature encoder, forgot about that. I think I am off by a factor of four. I will have to check that. Screw lead is actually 13/64". Did not believe it myself till I took it off their website.

  4. #4
    Join Date
    Jul 2003
    Posts
    67
    Thats the same number I got by the way so at least I know I don't have to go back 2nd grade.

  5. #5
    Join Date
    Jul 2003
    Posts
    67
    Yup, it was the quadrature encoder. I will remember that.

  6. #6
    Join Date
    Mar 2003
    Posts
    2139
    1024 count encoders may limit your max speed because you need 4096 steps per revolution. That is a lot. You may want to go down to 250 or 300 count encoders for gecko 320 drives. gecko also sells the 340 which is made to hook to high count encoders.

    Eric
    I wish it wouldn't crash.

  7. #7
    Join Date
    Jul 2003
    Posts
    67
    Yeah, I might do that later on. I am thoroughly enjoying this ultra high resolution though. The machine is certainly not unbearably slow, I would say 50-75 IPM rapids; Obviously I would prefer 200-300, but I can live with 75. I know Mach 2 is supposed to have a much higher maximum pulse rate. Do you know what that is? One other question. I bought a very fast PC with a nice 17" LCD as my CNC computer because I wanted to be able to surf the web, play games, listen to music, and watch movies while the machine ran. It seems though that Mach 1 is very picky about what programs it will let run in the background though. I can't seem to get WMP 9 running with Mach 1 and I am trying to locate a compatible DVD player with Mach 1. Any ideas? I have not tried Mach 2 yet. Is it any more compatible?

  8. #8
    Join Date
    Apr 2004
    Posts
    678
    Mach2 and any other program that runs a CNC machine really needs the full attention of the PC. One job is run in realtime, the one that sends out step and direction pulses. But this job is dependent on the non-realtime task feeding it with data. If another realtime task (like playing music or video) is competing with Mach2, it is not easy to say which of these will win if both needs the CPU at the same time. This probably was never tested as it is not a common scenario. It is also not easy to tell if the Mach2 non-realtime task will get enough CPU time to calculate all the trajectory data in time when it's needed. Windows have no mechanism for setting up task priorities and preempting less important tasks.

    So to be on the safe side, let Mach2 be the one and only job run by the PC when running the CNC machine. This is valid for any program doing a job like this, Mach2 is just mentioned because it seems that is what you are using. And if you run into trouble and need to call on Mach2 support, make sure you tell him what other tasks you were running at the same time.

    I am in no way affiliated with Mach2 or Artsoft, I write this based on 20 years of experience working with realtime system support.

  9. #9
    Join Date
    Mar 2003
    Posts
    4826
    That is good advice, ESjaavik.

    I still think that an "outdated PC" is plenty good enough for a cnc controller. Say a P500 or so is lots of computer for the task. Maybe not, if running a full software servo loop on High speed machining applications, but I don't see many guys trying to do that around here.

    Keep the high powered PC for your CAD programs, and games, music, etc.
    First you get good, then you get fast. Then grouchiness sets in.

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  10. #10
    Join Date
    Mar 2003
    Posts
    35538
    You have to remember Hu, that Mach2 is generating the step and direction pulses in software, not through a PCI or external hardware generator. And, it runs in Windows. I've heard that a 500 is about the minimum to run Mach2, and I'm not sure if a 500 is fast enough to use Mach2's 46khz step rate. You might be limited to around 25khz.
    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

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

    JointCAM - CNC Dovetails & Box Joints
    http://www.g-forcecnc.com/jointcam.html

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  11. #11
    Join Date
    Jul 2003
    Posts
    67
    I think you guys hold mach 1 mill in a bit too high of respect. Windows is quite capable of dealing with this sort of thing. How is blasting 1.5 Mb/s through a firewire port, getting pics from a USB digital camera, watching a movie, and simultaneously surfing the web any different from pulsing 25 kHz to a parallel port? I am not familiar with just how mach 1 gets rights to the parallel port during these operations, but I don't think it is that different from a basic printing program. While I have had problems with music and DVD's, I have been able to play games and surf the web while my mill is cutting no with no problems.

  12. #12
    Join Date
    Apr 2003
    Posts
    1079
    Noah, the firewire/usb example can withstand a break in data transfer of a few tenths of a second I am sure, plus the pc can read what it has written to the camera/card to verify the integrity of the data. You don't that luxury with cnc. A break in data transfer can cause stuttering of the tool, which can lead to ruined work. This is why Mach2 excells, as it has a higher priority than almost all windows drivers/apps if it wants to send a pulse to the parrallel port, it is sent instantly, not queued. Hope this helps

  13. #13
    Join Date
    Apr 2004
    Posts
    678
    Originally posted by Noah
    I think you guys hold mach 1 mill in a bit too high of respect. Windows is quite capable of dealing with this sort of thing. How is blasting 1.5 Mb/s through a firewire port, getting pics from a USB digital camera, watching a movie, and simultaneously surfing the web any different from pulsing 25 kHz to a parallel port?
    Windows isn't capable of dealing with this at all! It's not a realtime OS, and never was.
    The big difference is that your firewire peripheral, camera, web and whatever will wait when windows don't want to supply data. When windows gets it's finger out again, the peripheral will continue and be happy. Your stepper motor on the other hand will not wait. It will interpret a lack of pulses as a command to stop immediately. Which is a physical impossibility if the speed is higher than it's startup speed. What happens then is that it stalls out and does so without even reporting back to Mach2 that there is a problem.

    Let's say it lost 10mm in Z on it's way up. Mach2 doesn't know, so it believe everything is OK and continue but now everything will be 10mm lower down. If you're lucky it will try to bite too much out of your workpiece. If unlucky it will mill a nice pattern in your table.


    I am not familiar with just how mach 1 gets rights to the parallel port during these operations, but I don't think it is that different from a basic printing program. While I have had problems with music and DVD's, I have been able to play games and surf the web while my mill is cutting no with no problems.
    You don't think it's much different from a printing program? Then why do you think Artsoft went to great trouble to write a system level task to work underneath windows? Not an easy job to debug I can assure you! We're talking realtime demands here. A realtime task is one that can guarantee that action(s) will be taken at a specific time, not X microseconds later, or earlier for that matter. Those not wishing for trouble will do as HuFlung says. At least you can rest assured that the performance you get from a 500MHz will be consistent when Mach2 is given full control of the machine. If you don't believe us, why not ask Artsoft?

    If your concurrent activities on the machine does not involve realtime tasks (created in a similar fashion to Mach2), and does not starve Mach2 user task from processing time to feed the realtime task, then you'll be fine. But are you competent to judge if you fulfill these requirements? Your lack of understanding for these tells me you're not. I don't say this to put you down, as more than 999 out of 1000 PC-users don't know about realtime requirements, so you're in good company.

  14. #14
    Join Date
    Mar 2003
    Posts
    2139
    What Art has done with Mach 1 and 2, no one has done before. This is why many inexpensive cnc packages that run your motors run in DOS, which is a real time OS. If you want to see windows stepper control before Mach 1 and 2 try Kcam. You will notice exactly what Art has achieved withing the first few seconds.

    Eric
    I wish it wouldn't crash.

Similar Threads

  1. units per inch math
    By gearcut in forum Mechanical Calculations/Engineering Design
    Replies: 4
    Last Post: 05-29-2005, 07:02 PM
  2. Replies: 7
    Last Post: 01-02-2005, 09:41 PM
  3. DRO - Metric or Inch
    By DJ Morrow in forum CNC Machine Related Electronics
    Replies: 2
    Last Post: 11-15-2004, 09:06 PM
  4. Turns per inch to metric conversion
    By sixpence in forum DIY CNC Router Table Machines
    Replies: 1
    Last Post: 08-28-2004, 08:19 AM
  5. Lost Steps How does it Happen?
    By High Seas in forum CNC Machine Related Electronics
    Replies: 1
    Last Post: 01-31-2004, 03:57 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •