Author Topic: PMDX-422 to Arduino Communication?  (Read 4693 times)

Miaximus

  • Posts: 10
    • View Profile
PMDX-422 to Arduino Communication?
« on: June 20, 2015, 03:00:03 PM »
Howdy,
 
I have my PMDX-422 with licensed Mach4 up an running, everything looks and works great! 

Thank you for sending the PMDX-340 and 104/105 out quickly, its on the truck for delivery - can't wait. :)

As a maker/DIY fan, I've worked allot with Arduino's in the past and am curious if there is a preferred way for me to interface them at a simple level?

Mostly I would like to have the Arduino, "Listen-only" to the PMDX-422 so that the Arduino can take queue's from the 422 and do things in support of the what the 422 is doing. This isn't a requirement for me to get up and running as I purchased your 104 output and 105 input boards to keep everything inside PMDX/Mach4 scripting control.  It's more a curiosity as I prepare to assemble an All-PMDX solution. :)

Thanks!

Kris

Bob at PMDX

  • Administrator
  • Posts: 368
    • View Profile
    • PMDX
Re: PMDX-422 to Arduino Communication?
« Reply #1 on: June 22, 2015, 12:31:39 AM »
I'm not sure I understand exactly what you mean.  You can certainly connect one or more of the PMDX-422's output signals to pins on the Arduino so that the Arduino can see, for example, when "Pin1" is active and do something with that.  Well, maybe not such a good example as the "Pin1" signal is only available on the 26pin ribbon header, not on the screw terminal connectors as it controls the on-board relay.  But you get the idea...

If you are wanting to monitor the USB communications, sorry.

Another possible approach is to implement a serial port on the Ardiono to interface with Mach4 as a MODBUS peripheral.

If you can give me a concrete example of something you are trying to do (or thinking of trying to do) maybe I can be more helpful.

Bob
Engineering Hell: Everything's right and nothing works.
Bob's Corollary: If everything's right and nothing works, double check your assumptions.

Miaximus

  • Posts: 10
    • View Profile
Re: PMDX-422 to Arduino Communication?
« Reply #2 on: June 22, 2015, 07:25:46 AM »
Actually I should have not even posted this question, as if I had RTFM I could have asked a more intelligent question...
 
Your second suggestion is even better than I had hoped; setting-up the Arduino as a MODBUS to send simple messages back and forth.
 
For example; I would use the abundant analog and digital inputs on an Arduino Mega to greatly augment the sensory input possibilities available to the PMDX-422. I would connect the limit and proximity sensors via the Arduino, and have the Arduino pass-on the data to the PMDX-422 via serial communication.
 
Earlier today I had thought of using 3 of the Inputs (the extra 3 on the PMDX-422) to implement a simpler form of communications by treating the 3 inputs as one code register - giving me 9 possible "signals" or digital values that the Arduino could set using the 3 inputs on the PMDX-422. This would give me the ability to directly sense each end of each axis with limit switches as well as using proximity or other sensor types as well. However if I can create a Serial link between them, then the possibilities get allot broader. :)
 
Thanks!

Bob at PMDX

  • Administrator
  • Posts: 368
    • View Profile
    • PMDX
Re: PMDX-422 to Arduino Communication?
« Reply #3 on: June 24, 2015, 06:01:55 PM »
For example; I would use the abundant analog and digital inputs on an Arduino Mega to greatly augment the sensory input possibilities available to the PMDX-422. I would connect the limit and proximity sensors via the Arduino, and have the Arduino pass-on the data to the PMDX-422 via serial communication.

Yes, you could indeed use the capabilities of the Arduino to provide more/different kinds of inputs/outputs to Mach4.

Just to clarify, the MODBUS would communicate between Mach4 and the Arduino.  The PMDX-422 would have no knowledge of that communication unless or until the MODBUS data caused some signal in Mach4 to change (i.e. a limit switch).  Then Mach4 would tell our plug-in, which would in turn tell the PMDX-422.
 
WARNING: Home switches MUST be connected directly to the SmartBOB, or to the SmartBOB by way of the 26-pin ribbon header (or DB25 on the PMDX-411) through a PMDX-340 or breakout board (PMDX-126, etc.).  The current firmware/plug-in (as of today, 24 Jun 2015) do not require the EStop or limit switches to go through the SmartBOB.  However, future versions *may* require this.

Quote
Earlier today I had thought of using 3 of the Inputs (the extra 3 on the PMDX-422) to implement a simpler form of communications by treating the 3 inputs as one code register - giving me 9 possible "signals" or digital values that the Arduino could set using the 3 inputs on the PMDX-422. This would give me the ability to directly sense each end of each axis with limit switches as well as using proximity or other sensor types as well.

First, 3 inputs gives you 8 possible combinations, and one of those has to be (or should be?) "nothing of interest".  So you are left with 7 possible things to signal.  And, like the MODBUS discussion above, the PMDX-422 would not be interpreting the meaning of these "encoded" inputs.  It would just pass the states to the Mach4 core.  You would need some custom code running in Mach4 to decode the values and set/clear the desired Mach4 signals.

Bob
Engineering Hell: Everything's right and nothing works.
Bob's Corollary: If everything's right and nothing works, double check your assumptions.

Miaximus

  • Posts: 10
    • View Profile
Re: PMDX-422 to Arduino Communication?
« Reply #4 on: July 03, 2015, 01:17:44 PM »
Quote
Yes, you could indeed use the capabilities of the Arduino to provide more/different kinds of inputs/outputs to Mach4.

Just to clarify, the MODBUS would communicate between Mach4 and the Arduino.  The PMDX-422 would have no knowledge of that communication unless or until the MODBUS data caused some signal in Mach4 to change (i.e. a limit switch).  Then Mach4 would tell our plug-in, which would in turn tell the PMDX-422.
 
WARNING: Home switches MUST be connected directly to the SmartBOB, or to the SmartBOB by way of the 26-pin ribbon header (or DB25 on the PMDX-411) through a PMDX-340 or breakout board (PMDX-126, etc.).  The current firmware/plug-in (as of today, 24 Jun 2015) do not require the EStop or limit switches to go through the SmartBOB.  However, future versions *may* require this.
** edited by Bob to fix quoting delimiters **

Bob,
 
Thank you Very Much for the reply!  I understand more now and have taken your advice to heart - I have the 6 limit switches and proximity switch I got from PMDX connected to the PMDX-340 inputs (X+/X- and Y+/Y- limit switches) and the PMDX-422 (Z+/Z- and Proximity limit switches) - hopefully this will give me a robust capability to allow PMDX to know its limits directly. :) 
 
I'm going to use the Arduino for other things, I want to keep the core CNC function on the PMDX platform - as I learn more I am increasingly impressed with what I can do with PMDX and Mach4!
 
Cheers and thanks,

Kris
« Last Edit: July 03, 2015, 04:10:44 PM by Bob at PMDX »