Raspberry Pi CNC (GRBL, CNC.js)

New Home Forum Mostly Printed CNC – MPCNC Hardware Development – MPCNC Raspberry Pi CNC (GRBL, CNC.js)

Tagged: ,

This topic contains 1 reply, has 2 voices, and was last updated by  Wesley Gardner 10 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #21125


    I bought one of these, a really long time ago: http://wiki.protoneer.co.nz/Raspberry_Pi_CNC . It has an arduino running GRBL on it, and it’s connected to the serial port on the raspberry pi. The raspberry pi can run bCNC if you have a monitor connected to it, or you can run CNC.js (https://www.npmjs.com/package/cncjs) and then connect to it from your computer or phone (similar to octoprint).

    – Web interface. Very very slick. I was running it on my desk for a few days without any stepper drivers in it, and I was using the preview as a sort of GRBL simulator.
    – No SD cards to mess with.
    – GRBL has the concept of a “machine origin” and a “work origin” and a few “temporary origins”. Nice, if you like that sort of thing.
    – Webcam support, but I haven’t tested that yet.
    – Linux. I love Linux, but you may hate it 🙂
    – Won’t 3D print. I’m not sure how well the laser engraving stuff works with GRBL.
    – Won’t work with the Marlin LCD display.
    – CNC.js supposedly works with a “Contour shuttleXpress”, but it’s $60 on amazon. so, no jog dial for now. There is a breakout for hold/resume/abort buttons though.
    – Costs money.

    I used the steppers from my RAMPS board. I had to make sure I added all three jumpers under them for 1/32 stepping. Otherwise, I just followed the instructions from prontoneer for the most part, but I’m running it headless, without a keyboard, mouse, or screen. During setup, I also did these things. I did have a monitor connected, although you can do this stuff through ssh, if you know what I mean.

    1) changed the password.
    2) ran raspi-config, and expanded the filesystem, and changed the hostname to mpcnc.

    If you have a raspberry pi 3, then there’s also a script that fixes the serial port. I don’t have a pi3, so I can’t tell you how well this works.

    Then you can connect to mpcnc.local:8000 from a phone or computer. For the settings, there aren’t many, and you can read about them here:
    A simple way to do that is from the “Console” widget in the web server. Some things that slipped my attention the first time:
    – The “step idle delay” will disable the stepper motors all the time if you aren’t moving anywhere. You can set it to 255 to have the steppers always on as long as there is power. I like that because my machine isn’t naturally square, so I turn it on square, and then only make movements with the steppers.
    – The units aren’t the same as marlin. To convert from mm/sec^2 to mm/min^2, you have to multiply by 3600 (60*60).

    These are my settings at the moment, but they are definitely on the conservative side:

    $0=10 (step pulse, usec)
    $1=255 (step idle delay, msec)
    $2=0 (step port invert mask:00000000)
    $3=0 (dir port invert mask:00000000)
    $4=0 (step enable invert, bool)
    $5=0 (limit pins invert, bool)
    $6=0 (probe pin invert, bool)
    $10=3 (status report mask:00000011)
    $11=0.010 (junction deviation, mm)
    $12=0.002 (arc tolerance, mm)
    $13=0 (report inches, bool)
    $20=0 (soft limits, bool)
    $21=0 (hard limits, bool)
    $22=0 (homing cycle, bool)
    $23=0 (homing dir invert mask:00000000)
    $24=25.000 (homing feed, mm/min)
    $25=500.000 (homing seek, mm/min)
    $26=250 (homing debounce, msec)
    $27=1.000 (homing pull-off, mm)
    $100=200.000 (x, step/mm)
    $101=200.000 (y, step/mm)
    $102=4535.440 (z, step/mm)
    $110=1800.000 (x max rate, mm/min)
    $111=1800.000 (y max rate, mm/min)
    $112=180.000 (z max rate, mm/min)
    $120=100.000 (x accel, mm/sec^2)
    $121=100.000 (y accel, mm/sec^2)
    $122=10.000 (z accel, mm/sec^2)
    $130=960.000 (x max travel, mm)
    $131=550.000 (y max travel, mm)
    $132=200.000 (z max travel, mm)

    I also edited the /etc/rc.local and added cnc.js to automatically start up, by adding this line to the end of the file:

    su – pi -c /home/pi/.npm/bin/cnc

    This script gets ran by root, so this will log in as pi (which has npm installed everywhere) and then starts cnc. You don’t want to run cnc as root, because root doesn’t have the npm environment set up.

    If you want to just go to mpcnc.local instead of mpcnc.local:8000, then you have to configure it to forward port 80 to 8000. You can do that with iptables, try googling it.


    Wesley Gardner

    thanks for the info plan on doing a similar project myself always good to read others notes 🙂
    I will be using a pi3 with mine tho since my pi2 is a server lol

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.