Hello Guest it is June 19, 2019, 05:39:56 PM

Author Topic: Best way to get data back and forth from Mach3 to a custom button/LED board?  (Read 1048 times)

0 Members and 1 Guest are viewing this topic.

Newbie here, longish post with numerous questions.

I'm in the process of adding steppers to an old LC30A mill. I now have the X and Y axis working, and will add the Z axis shortly.

I'm comfortable with electronic design and plan to make a PCB that will replace the name plate on my mill with a bunch of buttons and LED's for the often used controls. I realize there are lots of OTS pendants available, however making "stuff" is half the fun for me.

Image below is first pass at what I'm thinking of making, please feel free to critique as I have next to no experience using Mach3 (just a few hours of playing with it to test the steppers I installed, and make a couple of simple parts).

So basically:
  - about 15-20 momentary switch contacts
  - perhaps 20 or so LED's
  - Rotary encoder will be hard wired as MPG
  - I already have the spindle controls working as shown (hard wired to VFD), so this could be as is, or flow through Mach3, I need to think about this one, comments?

Mach seems very flexible so there appears to be numerous ways to get the data back and forth to this PCB. Some of the obvious:

1) Hard wire to inputs and outputs
   + Good response time
   - Not enough I/O for all the buttons and LED's I would like to implement

2) Keyboard encoder, I took apart an old keyboard and inside I found a small PCB (1" x 2") that decodes the keyboard matrix, so I could simply map the matrix pins to my new tactile switches
   + Pretty simple and cheap
   -  I will need to add an IC or two to activate the Ctrl and Alt buttons at the same time as the "J" etc. for the multi-key commands (not a big deal but does need to be done), or can I change the commands to single key commands to get around the need for simultaneous key presses? (perhaps through some sort of configuration file in Mach 3?)
   -  I still need to get LED data from Mach 3 to my board

3) PIC type circuit
   + Most flexible if I want to tweak something in the future
   ? I'm not sure (yet) how best to get data back and forth, I'm inclined to use the serial port if that's easy to do from a Mach side perspective. I'm not sure if there is way to send and receive simple commands via the serial port? (my preference) or if I need to use something more elaborate i.e. a mod bus driver on the PIC side?
   ?

4) I/O Multiplexer
    * I'm surprised these are not plentiful in the after market considering the input signal limitations of the parallel port, I did find the (PMDX-126), however it does not have enough I/O
   - I don't think Mach 3 offers a plug-in that would say allow mapping of 5 input signals to 32 inputs and or 8 output signals to 256 outputs, assuming this is not available, would be great enhancement to Mach. The H/W at the BOB side is really trivial.

5) Other options?  If there are other methods, please elaborate.


 

Update

4) I/O Multiplexer
    * I'm surprised these are not plentiful in the after market considering the input signal limitations of the parallel port, I did find the (PMDX-126), however it does not have enough I/O
   - I don't think Mach 3 offers a plug-in that would say allow mapping of 5 input signals to 32 inputs and or 8 output signals to 256 outputs, assuming this is not available, would be great enhancement to Mach. The H/W at the BOB side is really trivial.
   ?  If I connect say 16 buttons to a 16:4 mux and then wire the 4 data lines to 4 unused inputs on my 2nd parallel port, can I use a "brain",  micro-pump etc. to monitor the 4 lines and then update a register or variable in Mach that then could be used to indicate the status of the 16 inputs, and possible select or deselect buttons in Mach based on the data?

Offline ger21

*
  • *
  •  6,261 6,261
    • View Profile
    • The CNC Woodworker
1) Get a UC300ETH motion controller, which has 49 inputs. You'd need a couple breakout boards, though.
http://www.cncdrive.com/UC300ETH.html
Gerry

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

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Hi,
pendants often communicate with serial or Modbus, Modbus probably the most popular.

Multiplexed IO is fine for buttons and switches but not so for motor signals.

Craig
My wife left with my best friend...
     and I miss him!
Update......

I watched a quick video on "Brains" and I think this might be a viable solution using a combination of 1&4 hard-wired and mutiplexed.

Starting with the buttons I have 13 so, 4 input lines can support 16 switches, if I use a simple 16 to 4 line encoder and feed the 4 data lines to input 1...4

and then use Brain logic like this, I think it should work, does anyone spot a flaw in the concept?