Warning

 

Close
Confirm Action

Are you sure you wish to do this?

Cancel Confirm
AR15.COM
9/18/2026 2:48:25 AM EDT
[Last Edit: hushpuppy26][Edited]
I've had a home converted PM-25 CNC mill for a long time now.  Years ago I made limit switch housings for it and planned to add limits 'someday'.  The steppers don't have the umph to really bend or break anything and soft limits got me by with eyeballing home position for each axis on startup and so I got on with making other things and never got around to cleaning up the controls (Breakout board screwed to plywood lean-to).  A few months back I decided to make a decent control cabinet and along with that a temporary breakout mock up of the new setup to get used to a MESA 7i92 Ethernet controller.  The real control is based on MX4660 that's been on my shelf a LONG time.  The mockup is just the ethernet controller tied to a parallel port break-out C10.  

All this prompted me to get the limits working.  A few items I decided on:

1.) I don't want the system 5V going to the switches so I need opto-isolation.  

2.) I don't want to wire all the switches together in series at the mill.  I want them all to connect separately.  

3.) I don't want to tie up multiple inputs for it.  So I want one limit input for all the home/limit switches.

I decided to try making a PCB for this.  An opto setup to handle the incoming switches at 7 to 15V and some logic to combine the limits to a single signal.  Thought about using a 4 input NAND or AND and definately would have worked but I've been playing with AI and some really cheap microcontrollers and thought, what the hell... the 8 pin packages are cheaper than than the logic chips when I got them.  CH32V003 controller.  It's job is as basic as it gets.  Sample the inputs every millisecond, debounce them, and signal back to a breakout board if any of them are tripped.

I added one vanity feature.  On boot it holds a fault for 3 seconds and watches the inputs.  If any connected and closed switch opens in those 3 seconds it will mark that input as 'inactive'.  This provides a way to ignore an input without having to jumper it closed.  Now it will never check that input unless at its next boot up there is again a connected and closed switch on that input.  If so, the input is reactivated.  

So I went off on a long quest where I designed the PCB, the firmware, completed the switches by making the cables for them and putting the PCB together once it arrived as well as designing and printing up a housing for it.  Of course no PCB is without error the first run and I discovered the discrete transistor was opposite pinout to the one that KiCAD used.  Fortunately, turning it backwards was all I had to do.  Otherwise it all works and tests out well on the bench.  I used rare-earth magnets in the housing so it will just magnetically attach to the mill or stand for mounting.

Once the heat breaks next week I plan to try and get it incorperated to my controller and get LinuxCNC setup to use it.  Homing will take place one axis at a time and I will be really happy to never have to line up punch marks on all my slides by eyeball anymore :D

The things that are within reach to do in a man's lifetime as a hobby these days is amazing.  I still marvel a bit that I get to live when its possible to do all this in one's home.


Bench Test:





The Machine:


9/18/2026 5:00:55 AM EDT
[#1]
Pretty neat system.
It’s better to keep your mouth shut and appear stupid than open it and remove all doubt.

Sign up to continue the discussion

Create a free account to share your thoughts, follow topics, and connect with the AR15.COM community.

Already a member? Sign In