Sunday, October 22, 2017

Controller configuration

For initial testing, I would take my laptop out to the garage and use Grbl-Panel.


Slick as Grbl-Panel is, I don't relish ingesting a chip into my laptops' keyboard. So I am going to use an Orange Pi Lite as a grbl server. Prior to the advent of the Raspberry Pi 3, the Orange Pi devices were half the cost and came with integrated wifi, and had more powerful processing power - while the latter is no longer true they are still cheap, nearly expendable computers. I'm not sure the exact configuration I'll end up with but I have had 3 ideas

1. Get a Raspberry Pi touchscreen and go full touch interface.
2. Get cheap used DVI monitor/keyboard/mouse and use the OrangePi as a computer interface
3. Use server software and jog via tablet/upload gcode for production

I'm going to go with (3), with (2) as a backup. During testing I can use my cheap windows tablet as a pendant and during production runs I dont need to have any computer there except the Orange Pi. If this is limiting I'll add a monitor/keyboard from the thrift shop.

Orange Pi Configuration

I installed a fresh Armbian image, added my user acoount and enabled wifi (nmcli c up id <router name>).


First things first: perform an apt-get update, apt-get dist-upgrade to ensure the latest packages. Reboot and make sure your wifi configuration sticks.

First program I tried was grblweb. This is a nodejs-based program that allows you to control your mill remotely through a web browser. It looks fairly simple and well thought-out, the only downside to the naked eye is that github hasn't been updated in 2+ years.

Clone it from github:
 git clone https://github.com/andrewhodel/grblweb

grblweb is built on nodejs, so we need to install nodejs/npm and various dependencies:
 sudo apt-get install nodejs npm
 sudo ln -s /usr/bin/nodejs /usr/bin/node
 npm install serialport
 npm install socket.io
 npm install node-static

now you should be able to cd into grblweb and execute
 node server.js

Load up a web browser to the IP of the machine, port 8000 and you should see the GUI.

If you want to run it as a service (start on boot) you can use forever and crontab. First install forever
sudo npm install forever -g (g=all users) Then follow the instructions from the top answer at stackoverflow.

I went out in the garage to test. I was able to jog the mill with the graphical joystick on my laptop but this was problematic on my tablet - sometimes it would be interpreted as moving the screen, other times as a joystick jog. Additionally there weren't a whole lot of features to do interactive positioning or gcode playback. I was a bit disappointed - this is probably great for production use but I needed something more oriented towards diagnostics.

So I went to the backup plan - ChiliPeppr. The concept is that ChiliPeppr is a "hardware fiddle", a more-or-less generic gui for various hardware devices. By forking the code and creating workspaces, you can create interfaces for new devices. Among these devices are grbl devices. NOTE: if you are using Grbl 1.1 (ie: the latest release) you want to use this workspace, not the grbl one which supports 0.9. In order to talk to your mill you need to download the JSON server for your computer (arm in our case) (download link bottom-right part of screen) and start the service on the Orange Pi. Now with any other device on your network you can connect to your device (bottom-right) using a URL that looks like ws://192.168.1.10:8989/ws. Your device will show up. Before connecting, you must change the connection type dropbox to GRBL! This will cause confusion if you do not. Click the checkbox next to the arduino and you're connected. You can jog by clicking the "jog" button and clicking on the screen. You can play back the test gcode by clicking "play". The code will pause at tool changes, hit the pause button to un-pause. I chucked up a pencil and pressed it against a notebook on my bed... and it worked !  more or less. I lost a few steps in the x-axis at one point.

TL;DR: suggest using Grbl-Panel for diagnostics, ChiliPeppr for gcode testing.

No comments:

Post a Comment

more successes

Next thing to do was cut something with multiple depths. Eventually I'd like to make some keychains for gifts and myself and family (wel...