Manual Pulse Generator (MPG) for a CNC machine
To make the experience fit your profile, pick a username and tell us what interests you.
We found and based on your interests.
MPG v60.f3dFusion 360 design filef3d - 630.85 kB - 03/20/2021 at 18:52 |
|
This weekend I printed the other two base plates, milled two PCBs and integrated all three MPGs in MachineKit.
I really like how this works, it gives you much more control over the machines movement compared to the keyboard arrow keys.
I finally got around re-designing the base plate. As I indicated in my last post, it needed to be a bit higher and it needed some hole to mount the MPG. What I also wanted to do was to create a custom PCB for attaching the hall sensor and the wires. It was a while back since I using EagleCad and was pleased to find that this was now owned by Autodesk and integrates nicely with Fusion360. I created a PCB in fusion in the shape of the space underneath the MPG and linked this to EagleCad. After I was finished with designing the PCB in EagleCad, I used FlatCAM and AutoLeveler to generate the G-Code. A couple of tests (read failures) later I was able to get a reasonable PCB using one of my cheap 60 degree engraving bits.
Even under the microscope it looks pretty, no rough edges at all.
When I mounted the hall sensors I noticed that I had the pins of the sensors swapped, so back to EagleCad. Since I needed to change things anyway, I also moved and rotated the pads for the wires.
So, all I now need to do is make 2 more and I can start using my very own MPGs :)
Today I did the first integration test and it works :)
My CNC machine is running LinuxCNC, originally I only had one parallel port and all the inputs where already used. I bought a cheap PCI parallel port card from Banggood and this just worked out of the box, no driver updates, no kernel re-compile, nothing.
Since the parallel port doesn't have a 5V line, I used power from one of the USB ports and connected everything using jump wires and a breadboard.
The LinuxCNC manual describes how to configure the HAL. There are a number of modes and scale settings and I not sure which I prefer yet. The video below show me experimenting with different scales and mode settings.
I need to do some re-designing of the base plate, is at the moment it is to low to fit wires, and I also like to add some mounting holes.
Originally I was planning to use 32 magnets, giving me 128 pulses per revolution. I tried some test prints and came to the conclusion that this was a bit overkill, eventually I continued with 16.
To give some tactile feedback, I added a clicker that clicks on every quadrature step. The clicker consists of a (round) track of 64 shallow (0.4mm) pockets in the base plate and a 4mm spring loaded ball in the dial.
The most common way of detecting pulses & direction is to use quadrature encoding, this is where the pulses are shifted 90*. So how to you create this type pulses with a hall sensor and magnets?
There are a number of types of hall sensors: unipolar, bipolar switch and bipolar latch, and it is the last one that is ideal for creating a quadrature signal. A bipolar latch hall sensor switches on when it detects one magnetic pole (lets say north) and it switches off when it detects the other (south) magnetic pole. So when you create a circle of magnets with alternating north and south poles facing the sensor, the result is a signal with a 50% duty cycle (when the rotation speed is stable).
I used my 3d printer to create a small disc with 32 (2 mm) holes and I glued in 8 teeny tiny neodymium magnets. I also printed a base for the disc spin on and to hold the hall sensors in place. The sensors are offset by 28.125 degrees (360 / 32 = 11.25, (2 * 11.25) + (11.25/2)), so that when one sensor is directly underneath a north pole, the other one is halfway between a north and a south poll.
And the resulting signals
Create an account to leave a comment. Already have an account? Log In.
I've just pushed my latest version of the Arduino source code to https://github.com/pvd/CncControlPanel/tree/master/CncControlPanel
If you need more info, just let me know.
Thanks!
I guess I am wondering how you are dealing with providing smooth jogging, acceleration, jog cancel, adjusting steps, dynamic steps based on acceleration etc... I'm not familiar with linuxCNC, with grbl it is a bit difficult since the space is limited and the ideal jogging has not been implemented due to jogging.
I'm also wondering about your UI design. I'm using the same OLED.
Finally, there is another project here that is interesting: https://github.com/terjeio/GRBL_MPG_DRO_BoosterPack
All the complexity (smoothing, acceleration, etc...) is handled by LinuxCNC. The Arduino simply sends (over the serial port) the number of detected steps to my LinuxCNC PC. On the PC there is a little python script that assigns the received pulse values to the linuxCNC HAL pins.
The little OLED screen is still work in progress. The plan is to use this in combination with a rotary encoder to show the various probe options (X+ X- Y+ Y- etc...)
I heard about using small steppermotors for this purpose :D they encoded the signals with comperators and a microcontroller :) bit your idea is great !! :)
Neat little project. A while back I built one for my CNC machine then ended up using a slightly different method. I used 3 phase motor from an old HDD and was prety surprised just how well it worked to feed the pulse train in to the controller.
Hi Boris, thank you for you message. Just out of interest, how did you do the conversion from a 3 phase motor signal to a pulse train?
Become a member to follow this project and never miss any updates
is your code shared somewhere? i'm working on a similar idea here: https://github.com/jschoch/grbl-MITM-pendant