Raspberry Pi CNC
- 1 Overview
- 2 Availability, Update Notifications and Forums
- 3 Installation and configuration
- 3.1 Quick Start Guide
- 3.2 Wiring Diagram
- 3.3 Powering the Hat
- 3.4 Micro Stepping Jumpers
- 3.5 End Stops
- 3.6 Clone Drive (Introduced with V2.51)
- 3.7 External Driver Boards
- 3.8 Button Controls
- 3.9 Coolant, Spindle Direction, Spindle Speed
- 3.10 Probe
- 3.11 Connection To Raspberry Pi
- 3.12 Grove Connector
- 4 Software (Firmware)
- 5 Troubleshooting
- 6 Hardware
The RPI CNC Board combines a real-time CNC controller(Micro-controller running GRBL) with a powerful credit card size computer(Raspberry Pi).
By combining the two systems we have created an eco-system where the Raspberry Pi provides benefits like: Processing power, connectivity(IOT) and a well supported community.
The board plugs directly into the Raspberry Pi General Purpose Input/Output pins, with the micro-controller and Raspberry Pi communicating via serial. (/dev/ttyAMA0)
Availability, Update Notifications and Forums
Newsletter and Forum
Installation and configuration
IMPORTANT: None of the components should be powered while installing or configuring.
Quick Start Guide
WARNING: Do not power up the board with stepper drivers installed if they are not connected to stepper motors. The stepper drivers are current limiting and will overheat if they are not connected.
WARNING: Make sure to plug in the Stepper driver in the right way round. EN of each axis should align with the "Enable" pin of the stepper driver. (Some Chinese stepper drivers have the printed pin names up side down.)
Dimensions: PCB is 55x89mm and with green connectors 59x93mm
- Pin 1 - 2 : Spindle Direction Pins
- Pin 3 - 4 : PWM Spindle Pins
- Pin 5 - 8 : End-stop pins and Probe pin
- Pin 9 - 10 : Coolant Pin
- Pin 11 - 12 : Main Power Pins - 12-36V (Check polarity!!!)
- Micro Stepping Pins with pin 3 at the top.
- Stepper Coils indicated with A and B.
Powering the Hat
The MCU is powered by the Raspberry Pi and runs at 5V(Level shifters are in place to allow the MCU and Pi to communicate at diverant logic level voltages).
The external power supply connectors power the Pololu compatible stepper drivers. External driver setup's don't need the external power to be hooked up.
Micro Stepping Jumpers
Jumpers number are indicated as follow:
In the tables below High indicates that a Jumper is inserted and Low indicates that no jumper is inserted.
|Jumper 1||Jumper 2||Jumper 3||Microstep Resolution|
|Jumper 1||Jumper 2||Jumper 3||Microstep Resolution|
End Stops use normally-open push-button type switches. The End-stop socket shares a common ground that connects to each axis end-stop. The pins are pulled high by the micro controller's internal pull-ups and will activate the end-stop when the pin is connected to ground.
GRBL v0.9 setting $21 needs to be set to 1 to activate hard-limits. Setting $22 also activated the Homing functionality.
V2.51 Introduces End-stop and Probe line filters to prevent noise on the lines.
Clone Drive (Introduced with V2.51)
The 4th Stepper Driver Socket can be configured to clone any of the other Axes. Configuration is done with the two rows of solder-able jumpers situated under the board.
In the images above the green sections indicates a jumper positions to configure the 4th Stepper Motor Socket.
!!! The A3 / A4 jumpers are for custom software and allows control of Socket 4 with the A3/A4 pins. !!!
External Driver Boards
External driver boards are great for use with larger external driver like Gecko drivers and TB660 drivers.
The external driver board redirect signals through the green screw connectors on the Raspberry Pi CNC hat and makes it super easy to hook up.
Current version and wiring of the External driver...
The above image has been corrected as the pin names was inverted.
The buttons : RESET,ABORT,HOLD,RESUME work with normally open buttons and gets activated when grounded. All buttons are pulled high.
Coolant, Spindle Direction, Spindle Speed
- S0 - S1000 - This command set the spindle speed. (0-1000 with 1000 being 100% speed.)
- M3 / M4 - Enables the spindle clockwise or anti-clockwise. The Spindle Direction pin is set accordingly(Anti-clockwise turns direction pin high). Sets the Spindle speed pin accordingly.
- M5 - Disables and pulls spindle pin low.
Examples: M3 S500 -> Enables spindle in clockwise direction at 50% speed.
Keep in mind that the direction pin does not reset when the M5 command is used.
- M8 - Enables the coolant and pulls the pin high.
- M9 - Disables and pulls the pin low.
The probe pin and ground can be connected to a Normally-open switch. Software like bCNC has probe functions and can be used with this board.
Connection To Raspberry Pi
This is great for connecting I2C devices directly to the Raspberry Pi. This only works at the Raspberry Pi's 3.3V voltage levels.
In order for the GRBL to communicate with the Raspberry Pi, the hardware serial port on the Raspberry Pi needs to be enabled and working. HobbyTronics has a good tutorial on how to set it up and test it. Raspberry Pi Serial Port setup
Uploading new firmware
As of this version firmware can directly be upload from the Raspberry Pi.
The Raspberry Pi V4.00 image includes script to update the firmware on the Raspberry Pi CNC HAt.
- Firstly make sure no software is connected to the Hat's serial port.(A clean V4 image will start of in that state) (Only one app can connect at a time and if its being used the firmware will not update.)
- On the desktop there is a folder called "Update Firmware" that contains 3 shortcuts for changing the firmware
- GRBL 0.9
- GRBL 1.1
- Latest GRBL (Experimental)
- By double clicking one , it will execute a script that uploads the firmware.
Before shipping each board we test the firmware and we use the same script to upload the initial firmware before automated testing starts.
The upload script uses Python GPIO libs and sometimes does not upload the first time while the pins gets configured.(Bootloader timing issue that happens rarely) If so try a second time.
Firmware gets uploaded from the Nano's usb port.
GRBL is the magic that does the actual control of the CNC machines.
For more details : GRBL
The Raspberry CNC board comes pre-loaded with GRBL but can be updated as follows : Flashing Grbl to an Arduino
Will be added soon.
- Added a Grove Connector to allow I2C connections directly to the Raspberry Pi.
- Green Screw connectors changed from 3.5mm pitch to 3.81mm pitch.
- Moved Stepper Drivers inline.
- Replaced the Arduino Nano with a embedded micro-controller(ATMEGA328 - Arduino UNO compatible)
- Add reset circuitry to enable programming directly from the Raspberry Pi. ISP pins added and preloaded with the Opti-Boot bootloader. This opens the door for other firmwares like Firmata.
- Replaced clone jumpers with solder-able jumpers.
- Later batches might have dip-switches instead of Jumper headers.
- First Protoneer board to be mode on our Pick and Place machine.
- Extra Stepper Drivers Socket that can clone one of the other Axes.
- End-stop + Probe line noise filters. Allows end stops to work with normal un-shielded cable.
- Breakout pins allowing external Stepper drivers to be hooked up.
- Wiki Page - http://wiki.protoneer.co.nz/Raspberry_Pi_CNC_v2.51
- Initial Version
- 3-Axis (XYZ)
- End Stop for each Axis (XYZ)
- Variable Speed Spindle / Laser Intensity control (PWM Spindle pin and Direction pin)
- Coolant control pin. (Extra output pin)