As I said previously, I have been slowly developing my second CNC Machine, TheMaker2. To control the new CNC machine I developed a new board based on a PIC16LF877A since the L297's that I used on the first CNC controller board that I designed can be quite expensive here in Portugal and I had some PIC16LF877A samples lying around that with a few programming lines could do the same or even more than three L297 stepper motor controllers.
|(Click the photo for better resolution in Picasa Photostream)|
Once again, the board design can be split in three parts:
- Isolation - it has Vishay's CNY17-2 optocouplers to isolate the parallel port from the rest of the circuit;
- Driver - a Microchips' PIC16LF877A drives three stepper motors in unipolar mode (if you prefer bipolar you can change the schematics and boards at your will);
- Power Interface - a bunch of Vishay's SUP85N03 N channel FETs working as switches controlled by the PIC16LF877A.
The motor's VCC is separated from the rest of the circuits' VCC which should be 5V. For the motors you can provide 5V, 12V, 24V or other voltage that may be best suited for your motors. The SUP85N03 have a maximum continuous drain current of 85A so you should be safe with any motors that you wish to use (attach them to some heatsinks and reinforce the PCB traces for high currents). To power the board I use a PC ATX power supply using the 5V to power the board and 12V to power the motors. I enclosed both in a custom made acrylic and aluminium box.
The board has two extra connectors:
- A UART connector that you can use to communicate with the PC or change the firmware if you put a bootloader in the PIC before uploading the CNC controller firmware. The current firmware has no communication protocol for UART included and as such it isn't being used. I included this connector in the board because I placed the Tiny PIC Bootloader inside the PIC for easier firmware upgrading. I intend to add new functions to the firmware when I get some free time to do it.
- A Sensors connector that you can use to read the limit switches on your CNC. However, that feature has not been implemented yet.
The current firmware has only the basic functions to control stepper motors according to Direction and Step signals and nothing more.
Get the flash player here: http://www.adobe.com/flashplayer
The circuit and board were designed in Kicad and you can download the project files here.
I remind you that you will need a PIC programmer to program the PIC16LF877A with the firmware provided. The firmware was developed in Piklab and you can download the project here (.hex file included).
I hope this board is useful for you and that you can use it to control your CNC. If you can upgrade it with newer features, even better! :) Just make sure to report back to share your developments :)
Did you find this post helpful? Do you wish to contribute to other projects regarding computer science, electronics, robotics or mechatronics that will be posted in this blog? If you wish to do so, you can donate via paypal using the button below. Thanks! :)