Headless Raspberry Pi (or better suggestions!)

Joe Pineapples
Posts: 41
Joined: Sun Apr 10, 2016 1:22 pm

Re: Headless Raspberry Pi (or better suggestions!)

Post by Joe Pineapples » Tue Apr 12, 2016 11:42 am

WillAdams wrote:We have the basics of how things fit together on the parts page: http://www.shapeoko.com/wiki/index.php/Parts

And there are additional pages on:

http://www.shapeoko.com/wiki/index.php/Electronics
http://www.shapeoko.com/wiki/index.php/Arduino
http://www.shapeoko.com/wiki/index.php/Stepper_Motors

&c.

You may want to look into whether the bCNC interface can be adapted / tweaked for smaller displays (I suggested making it scalable, and having an option to hide sections to save space)

Another option would be using its web pendant on a smart phone or small tablet to control it.

Agree that there’s a lot of potential in the jog wheels.
Thanks for the links Will, I haven't had time to go through them in detail but had a quick scan through and can't see anything about the RasPi, will have a closer look tonight.
Nokia 3310 with custom ringtone
Nintendo Gameboy with backlight upgrade and worn D-pad

WillAdams
Posts: 8527
Joined: Mon Apr 09, 2012 6:11 pm
Location: Pennsylvania --- south of the Turnpike, East of US-15
Contact:

Re: Headless Raspberry Pi (or better suggestions!)

Post by WillAdams » Tue Apr 12, 2016 12:29 pm

The Raspberry Pi, in the normal mode, simply replaces a full-fledged computer system. The only major addition usually is that it gets wired into the power somehow.

There are some specifics on it here: http://www.shapeoko.com/wiki/index.php/ ... spberry_Pi
Shapeoko 3XL #0006 w/Makita RT0701 Router w/0.125″ and ¼″ Elaire precision collets
Nomad 883 Pro #596 (bamboo)

Joe Pineapples
Posts: 41
Joined: Sun Apr 10, 2016 1:22 pm

Re: Headless Raspberry Pi (or better suggestions!)

Post by Joe Pineapples » Tue Apr 12, 2016 12:51 pm

WillAdams wrote:The Raspberry Pi, in the normal mode, simply replaces a full-fledged computer system. The only major addition usually is that it gets wired into the power somehow.

There are some specifics on it here: http://www.shapeoko.com/wiki/index.php/ ... spberry_Pi
Thanks again, I'll have a good look tonight. As I'm a total beginner I could really do with a walkthrough or video of what goes where, everything I've found over the last few weeks goes along the lines of "connect the Pi to the Arduino and the Arduino to the drivers" which isn't much help at all to someone who doesn't know how to do it (I'm pretty sure I can't just glue them together) ;)
Nokia 3310 with custom ringtone
Nintendo Gameboy with backlight upgrade and worn D-pad

WillAdams
Posts: 8527
Joined: Mon Apr 09, 2012 6:11 pm
Location: Pennsylvania --- south of the Turnpike, East of US-15
Contact:

Re: Headless Raspberry Pi (or better suggestions!)

Post by WillAdams » Tue Apr 12, 2016 1:29 pm

For a step-by-step on hooking up the electronics, see: http://shapeoko.github.io/Docs/electronics.html and http://shapeoko.github.io/Docs/wiring_2.html --- for the SO2, but those instructions date back to when the machine intent was more hands-on hobbyist, as opposed to hands-free click-and-play --- the SO3 is heading towards being a set of assembled sub-components which one "merely" puts together.
Shapeoko 3XL #0006 w/Makita RT0701 Router w/0.125″ and ¼″ Elaire precision collets
Nomad 883 Pro #596 (bamboo)

Joe Pineapples
Posts: 41
Joined: Sun Apr 10, 2016 1:22 pm

Re: Headless Raspberry Pi (or better suggestions!)

Post by Joe Pineapples » Tue Apr 12, 2016 1:36 pm

WillAdams wrote:For a step-by-step on hooking up the electronics, see: http://shapeoko.github.io/Docs/electronics.html and http://shapeoko.github.io/Docs/wiring_2.html --- for the SO2, but those instructions date back to when the machine intent was more hands-on hobbyist, as opposed to hands-free click-and-play --- the SO3 is heading towards being a set of assembled sub-components which one "merely" puts together.
With an absence of Rasperry Pi in there, I'm taking a blind stab in the dark that to connect the Pi to the Arduino I'd use the USB ports?
Nokia 3310 with custom ringtone
Nintendo Gameboy with backlight upgrade and worn D-pad

Shook
Posts: 139
Joined: Thu Nov 12, 2015 6:50 pm
Location: Downingtown, PA

Re: Headless Raspberry Pi (or better suggestions!)

Post by Shook » Tue Apr 12, 2016 2:01 pm

As Will mentioned, the Raspberry Pi is just a computer in this setup.

My setup:
The Shapeoko's control board (which has Arduino bits), gets plugged into the USB port on the Raspberry Pi. The Raspberry Pi is connected to an external display (could be anything from a TV with Composite input to a touch screen). I'm currently using a wireless device with keyboard and mouse functions and it works well enough for me.

(Not an endorsement, but here's a 10-inch touchscreen for Raspberry Pi)
http://www.banggood.com/10_1-Inch-13667 ... ele-xie-us

Note:
If you have a dead laptop (or know someone getting rid of one), you might be able to salvage the LCD from that and purchase a driver board off of eBay. I got one cheap ($25 shipped free from Hong Kong) and I'm currently using it with a Raspberry Pi. I just need to find the time to make a case for it. Don't worry about a lack of electronics experience, it really is just a case of finding all of the screws and being careful when disconnecting it from the old connections.
Shapeoko 3 (#1107)

cvoinescu
Posts: 4442
Joined: Thu Jul 19, 2012 6:50 pm
Location: Camberley, UK
Contact:

Re: Headless Raspberry Pi (or better suggestions!)

Post by cvoinescu » Tue Apr 12, 2016 3:27 pm

At a very basic level, what you aim for is this:

A stepper motor has two coils. It does not run continuously like the DC motors you're used to; instead, powering it up makes it hold position, and you can move it one step at a time by changing the current through its coils. In the most basic operating mode, both coils have current passing through them all the time. If you reverse the current through one of the coils, the motor moves one step. Which direction it moves depends on the polarity of the currents and on which coil you reverse. Continuous movement is achieved by flipping polarities quickly in the proper pattern. This is called full stepping; finer operation (half stepping and microstepping at various factors) is possible by controlling coil current in subtler ways (essentially interpolating between full step positions). Most commonly used drivers can do at least 1/8 microstepping, and often 1/16 and 1/32.

Controlling the coil current is done by a specialized chip called a stepper motor driver. It's made of two parts: a power stage, which modulates the higher voltage of the power supply and transforms it into an accurately controlled current at a lower voltage; and an indexer, which tells the power stage what the currents need to be at any point in time. It is the indexer that implements microstepping techniques. Typical power supply voltages are 12 V to 48 V, with 24 V being most popular in this size of machine (most small drivers are limited to 30-40 V). Popular drivers include the Allegro A4988, the Texas Instruments DRV8818 and DRV8825, and the Toshiba TB6560 and TB6600.

The motor driver, specifically, the indexer, receives two signals that tell it how to move the motor: a direction signal, and a step signal. One pulse of the step signal makes the motor advance one (micro)step in the direction given by the direction signal. To move continuously, a series of step pulses is required. These step pulses must be accurately timed, and coordinated between axes if more than one needs to move at the same time (to move diagonally, or in a curve, or, in general, in any direction that's not parallel to an axis).

The G-code interpreter's role is to receive your G-code commands, calculate how the machine needs to move, and turn that into the series of step pulses and direction signals for all the motors drivers of your machine. In some cases, the interpreter can read G-code files directly (e.g. LinuxCNC, Mach3). In our case, though, the interpreter runs on the Arduino, with very limited memory, so it needs to be fed the G-code commands pretty much one by one (although there's some buffering, which is important for smooth motion). This is the role of the host program.

In your case, bCNC is the host program. It runs on the Pi. It sends G-code commands to the Arduino Uno, over a USB-to-serial interface. The Arduino Uno runs GRBL, which receives these G-code commands, buffers them, interprets them, and transforms them into electrical pulses. Specifically, the step signal for the X axis driver is pin D2, Y step is D3, Z step is D4; the direction signals are pins D5-D7, and pin D8 is used to turn all three axes' drivers on.

You have a choice of what to use for drivers:
  • separate drivers;
  • an Arduino shield with built-in drivers (e.g. gShield);
  • an Arduino shield with separate driver modules (e.g. GAUPS or Protoneer with Pololu-compatible driver modules);
  • or a board that integrates the functionality of the Arduino and the drivers (e.g. the Carbide Motion 2.x board, or its close equivalent from SparkFun).
There are many other choices, with the various Azteeg products from Panucatt deserving a mention.

In all cases, the essential scheme is the same: a microcontroller (typically the ATMega328P) runs GRBL software, which receives G-code and creates accurately timed pulses for the motor drivers. As far as the microcontroller is concerned, the connection to the host program delivering the G-code is serial (RS232), but most often this is implemented with a second chip doing USB-to-serial conversion, so the actual connection is USB, although it appears serial to both the host software (bCNC) and the firmware (GRBL). It is also possible to send serial signals directly to the microcontroller, and avoid USB entirely.

I hope this helps.

Here are two more links that may help, even though they're about the eShapeoko (a machine similar to the Shapeoko 2) and the GAUPS (a driver shield).
http://wiki.amberspyglass.co.uk/index.p ... structions
http://wiki.amberspyglass.co.uk/index.p ... mplete_Kit
Proud owner of ShapeOko #709, eShapeOko #0, and of store.amberspyglass.co.uk

Joe Pineapples
Posts: 41
Joined: Sun Apr 10, 2016 1:22 pm

Re: Headless Raspberry Pi (or better suggestions!)

Post by Joe Pineapples » Wed Apr 13, 2016 12:28 pm

Shook wrote:As Will mentioned, the Raspberry Pi is just a computer in this setup.

My setup:
The Shapeoko's control board (which has Arduino bits), gets plugged into the USB port on the Raspberry Pi. The Raspberry Pi is connected to an external display (could be anything from a TV with Composite input to a touch screen). I'm currently using a wireless device with keyboard and mouse functions and it works well enough for me.

(Not an endorsement, but here's a 10-inch touchscreen for Raspberry Pi)
http://www.banggood.com/10_1-Inch-13667 ... ele-xie-us

Note:
If you have a dead laptop (or know someone getting rid of one), you might be able to salvage the LCD from that and purchase a driver board off of eBay. I got one cheap ($25 shipped free from Hong Kong) and I'm currently using it with a Raspberry Pi. I just need to find the time to make a case for it. Don't worry about a lack of electronics experience, it really is just a case of finding all of the screws and being careful when disconnecting it from the old connections.
You got me excited when I saw the price, unfortunately it's not a touchscreen though. It doesn't appear that there are many 10" touchscreens about (I can't find any) but a 9" might do.
Nokia 3310 with custom ringtone
Nintendo Gameboy with backlight upgrade and worn D-pad

Joe Pineapples
Posts: 41
Joined: Sun Apr 10, 2016 1:22 pm

Re: Headless Raspberry Pi (or better suggestions!)

Post by Joe Pineapples » Wed Apr 13, 2016 12:35 pm

@cvoinescu, thanks for that. I certainly still have much to learn.

One thing that's confused me a little is bCNC and GRBL, is one the software and another the firmware? Or can they both be both?
To clarify, I use Mastercam to draw my parts and plot/generate my toolpaths, all I would really need is something on the machine to receive the g-code and display basic information. I'm liking the way bCNC looks but have yet to try using it properly - I took a USB with a program home on it last night (.NC file) and tried to open it with bCNC but it wouldn't show up in the list (not asking for help with that, I'm sure there's instructions/help readily available for me to look through once I get time).
Nokia 3310 with custom ringtone
Nintendo Gameboy with backlight upgrade and worn D-pad

WillAdams
Posts: 8527
Joined: Mon Apr 09, 2012 6:11 pm
Location: Pennsylvania --- south of the Turnpike, East of US-15
Contact:

Re: Headless Raspberry Pi (or better suggestions!)

Post by WillAdams » Wed Apr 13, 2016 3:21 pm

Overview: http://www.shapeoko.com/wiki/index.php/Overview
a Shapeoko uses a Microcontroller (an Arduino) running Grbl (a G-Code interpreter) attached to the machine via stepper drivers (originally mounted on a gShield) and controlled by a computer system running a Communication / Control program such as Universal-G-Code-Sender.
Should the Overview page be merged in w/ the Main page?
Shapeoko 3XL #0006 w/Makita RT0701 Router w/0.125″ and ¼″ Elaire precision collets
Nomad 883 Pro #596 (bamboo)

Post Reply