Hello Guest it is March 28, 2024, 07:45:17 AM

Author Topic: How to use GPIO on Dell Embedded PC for additional Mach 4 inputs and outputs?  (Read 1530 times)

0 Members and 1 Guest are viewing this topic.

Offline MrFixit

*
  •  7 7
  • Series 2 Boss 6 CNC mill - retrofitted+updated
    • View Profile
Hello,
I could use some help understanding what I dont know in order to learn more about it.

I have the start of a working Mach4 setup with an AXBB-E motion controller on a Bridgeport Boss CNC mill that I retrofitted. I still need to polish the installation some more.


I am migrating from my laptop to a dedicated computer for the mill.  I bought a Dell PC 5000 embedded computer.

The new computer has 16 GPIO (general purpose in/outputs) built into it.  I am short on inputs and I am hopeful that these are usable.

The Dell manual lists the pin mapping to CPU I/O addresses

I have searched thru this forum and the Mach4 scripting manual but haven't deciphered enough to understand what i might need to do to use these as additional in and outputs to Mach4. I read thru the scripting section on the signal library. It mentions that signals can be tied to external in/outs but it doesn't get into the logistics of adding new ones.  I have started looking at LUA scripting and Modbus, but I don't know if I'm barking up the right tree.

I don't understand the steps involved in this endeavor, and Id appreciate any guidance on what i need to learn more about to pull this off if it is feasible.

Id also be happy to hear opinions related to the matter.

Quote
Embedded Box PC 5000 GPIO module In/Out mapping
The GPIOs ports on the Embedded Box PC and Nuvoton NCT6793D uses index/data pair of CPU I/O addresses 2Eh/2Fh to access NCT6793D.
GPIO 8 Out pin# to NCT6793D pin# map:

0 to 121 (GP00)

1 to 122 (GP01)

2 to 123 (GP02)

3 to 2 (GP03)

4 to 3 (GP04)

5 to 4 (GP05)

6 to 5 (GP06)

7 to 6 (GP07)

8 is GND
GPIO 8 In pin# to NCT6793D pin# map:

0 to 50 (GP60)

1 to 49 (GP61)

2 to 48 (GP62)

3 to 47 (GP63)

4 to 45 (GP64)

5 to 44 (GP65)

6 to 43 (GP66)

7 to 42 (GP67)

8 is GND
Hi,
you could probably use those IOs but they would not be fast.

In Mach4 you have a 'active motion controller' in your case the AXBB-E. Inputs to this controller, things like probe,
limits and home switches are acted on by the board immediately, also called realtime. They will in turn be passed onto Mach but the communication
delays could be tens of milliseconds. The delay would totally screw the functionality of those inputs that require immediate or realtime service
including probe, limits and homes. All of these inputs MUST be handled on the motion control board without assistance from Mach4.

Note that you can only have ONE active motion controller and therefore only the inputs available on that controller can be used for realtime purposes.
I'm not sure but I believe the AXBB-E is similar to my Ethernet SmoothStepper in that it expects to be the active motion controller, and as I've already
said there can only be one active motion controller, that means that you can use ONE and ONE ONLY AXBB-E or ESS.

What you can do however is have another device with its own plugin and that could for instance handle IO. What it could not do however is handle
realtime events, say an extra probe circuit. You'd have to find room on your primary motion control board for it. What it could do though
is turn on and off pumps, lights or monitor door switches for example. Who cares if they take a few hundred milliseconds to get back to Mach or take a few
hundred milliseconds to get from Mach to the pump say.

If you wrote a plugin you could have Mach use the GPIO pins of your PC. Writing a plugin is no small feat, but possible.

I believe there is a better and far easier solution though. PoKeys made their name in digital IO boards long before they made a motion controller for CNC
purposes. Their 57CNC has at its core a 57E, an IO board. What I would suggest is get a 57E and its Mach4 plugin. Then you would have up to 55 inputs
and outputs several of them (7) analogue capable.

Within the understanding that all IO via this second board cannot be realtime would an extra 55 IOs be enough? I think a PoKeys 57E is around $70.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'

Offline MrFixit

*
  •  7 7
  • Series 2 Boss 6 CNC mill - retrofitted+updated
    • View Profile
Thank you for taking the time to write out this reply. I apologize for taking so long to get back to you.  I did heed your advice and stopped trying to use the embedded GPIOs on my computer.  I streamlined my in/outputs and got by with and expansion card for my AXBB-E.  I had gotten an M26X expansion board from cnc4pc and it seems to suit my needs. 
I had considered switching to an ESS at the time, and now i kind of wish i had.  I am struggling with a probing issue that I just posted about.  I can find forum posts where people encountered the same issue with an ESS and it was fixed several years ago by warp9 in their plugin.

Here is a recent one that references settings in the ESS plugin that fixed their problem https://www.machsupport.com/forum/index.php?topic=45273.0

In spite of few problems Ive had, it has been extremely fun to get my old Bridgeport S2 Boss6 CNC up and running better than it ever has.