Results 1 to 6 of 6

Thread: Mach 3 axis control by external pulses

  1. #1
    Registered
    Join Date
    Mar 2009
    Location
    USA
    Posts
    121
    Downloads
    0
    Uploads
    0

    Mach 3 axis control by external pulses

    I've been wanting to come up with a proportional (further you push, faster it goes) joystick based controller for Mach 3 and I'm having a little trouble with the last piece of the puzzle. Basically, this means that I won't need to stop and switch "speed" settings on a pendant in order to drive quickly across the table and I'll be able to drive two axes simultaneously on each joystick.

    I programmed a PIC chip to translate the analog input from the joystick to digital step/direction pulses. I'm now trying to figure out how to interface those signals to Mach 3. I made the mistake of assuming this would be a simple task (a hazard of living so much of my life on the road is that I have lots of time to program stuff like this, but very little time to work on actual hardware).

    Ken


  2. #2
    Registered
    Join Date
    Dec 2008
    Location
    canada
    Posts
    226
    Downloads
    0
    Uploads
    0
    A little more information needed...
    Is this just for jogging, or for controlling run speed???
    If just for jogging, change from a step dir to phase drive... then drive the the MPG inputs... you can have 3 of them, and each one a different axis. Six inputs just like 3 STEP/DIRs

    OR you can just run the KEYGRABBER application and have proportional joystick input through it using any game controller including USB devices.
    I'm using a PHILIPS wireless controller with 4 "analogue" and 12 buttons...

    On the other hand, I had thought about making an interface that pugs in between the PC and BOB on the DB25, running through a PIC. It would monitor the STEP/DIR outputs and optionally disable the joystick during PC control or in the case of plasma THC, add or subtract the Z axis depending on a voltage input, and disable the THC function when the X/Y steps drop below a threshold rate (anti-dive)...
    BUT then mach would no longer KNOW where the cutting point is for sure... It would be great for a program that is zeroed on the corner of stock. just tell mach to zero out on a program start, and use the joystick to position the cutter prior to starting.

    On a side note... just as the PC side is becoming a problem with computers not having solid parallel ports , or ports at all... I "think" its not that easy to find an analogue joystick these days.. all USB


  3. #3
    Registered
    Join Date
    Mar 2009
    Location
    USA
    Posts
    121
    Downloads
    0
    Uploads
    0
    Pandinus,

    Thanks for your response. I was aware that a USb joystick could be mapped into Mach3, but everything I had seen indicated that it would only interpret the inputs as "ON/OFF" and drive the axis at a single speed. I was not aware of any proportional joystick control awavailable.

    I intended this purely for jogging. It would work fine right now if I connected it directly to the BOB, but as you said, Mach 3 would no longer be able to track the motion of the machine. My (very basic) code allows for a "dead zone" near the origin of the joystick.

    I purchase an industrial style joystick which operates potentiometers physically. They aren't cheap, but hopefully will last a long time.

    As for using the MPG inputs, Programming for step/dir was fairly easy. Converting to phase output will be more challenging, but it sounds like this might be the best solution aside from using a proportional joystick along with Keygrabber. None of this took very long and it was an interesting experiment in analog signal processing, but I wish I had known that keygrabber could process proportional inputs.

    Ken


  4. #4
    Community Moderator ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Twp, MI....USA
    Posts
    22,303
    Downloads
    0
    Uploads
    0
    I think that the only possible way to feed Mach3 step and direction info would be to write a plugin. But if you need to write a plugin, there's probably a better way to do it than to send the step/dir signals.
    Gerry

    Mach3 2010 Screenset
    http://home.comcast.net/~cncwoodworker/2010.html

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


  • #5
    Registered neilw20's Avatar
    Join Date
    Jun 2007
    Location
    Australia
    Posts
    3,424
    Downloads
    0
    Uploads
    0

    Units per rev.

    Have you thought of using G95 - units per revolution instead of unit per minute.
    Put you pulses in as spindle index pulses.
    I think this could be made to work.
    Super X3. 3600rpm. Sheridan 6"x24" Lathe + more. Three ways to fix things: The right way, the other way, and maybe your way, which is possibly a faster wrong way.


  • #6
    Registered
    Join Date
    Mar 2009
    Location
    USA
    Posts
    121
    Downloads
    0
    Uploads
    0
    Thanks for the info guys... Living in hotel rooms sucks when you're the type who likes to get things done.

    So ten more minutes of coding is all that was required to change from step/dir output to quadrature encoder output... Not too bad considering I had to start with the Wikipedia page explaining how PhaseA and PhaseB work... The code is running like a charm on my development board.

    Best regards to all and thanks for your input. If I ever get further than blinking LEDs, I'll post a new reply.

    Ken


  • Similar Threads

    1. Replies: 12
      Last Post: 09-17-2011, 12:25 AM
    2. Need Help!- Control Mach3 with external VB.NET program
      By Adamj12b in forum Mach Software (ArtSoft software)
      Replies: 0
      Last Post: 12-30-2008, 10:46 AM
    3. configuring Mach 3 for twin X axis stepper motor control
      By Alex2005 in forum Mach Software (ArtSoft software)
      Replies: 3
      Last Post: 03-07-2008, 03:15 AM
    4. Haas 4th axis external drive
      By tecko in forum Haas Mills
      Replies: 1
      Last Post: 06-07-2007, 05:23 PM
    5. will mach 2 or mach 3 work for 4 axis cnc?
      By Runner4404spd in forum Mach Mill
      Replies: 3
      Last Post: 10-05-2005, 12:44 PM

    Posting Permissions


     


    About CNCzone.com

      We are the largest and most active discussion forum from DIY CNC Machines to the Cad/Cam software to run them. The site is 100% free to join and use, so join today!

    Follow us on

    Facebook Dribbble RSS Feed


    Search Engine Friendly URLs by vBSEO ©2011, Crawlability, Inc.