Author Topic: Raspberry Pi, Arduino, Shield, GRBL, CNC, etc.  (Read 28529 times)

Offline vtsteam

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6466
  • Country: us
  • Republic of Vermont
Raspberry Pi, Arduino, Shield, GRBL, CNC, etc.
« on: December 26, 2014, 11:44:31 AM »
I just received a Raspberry Pi B+ for Christmas unexpectedly, and I'm trying to figure out what to do with it.

I was thinking maybe CNC, and came across this artcle on combining it with an Arduino and CNC shield, but I'm still left wondering why?

http://www.instructables.com/id/Raspberry-Pi-Alamode-CNC-Controller

It seems to me you're just left with a device that can accept G-code files and then push stepper motors.

But what gives you the graphic DRO feedback and operational controls (jogging, etc), like say, LinuxCNC or Mach 3, (or even TurboCNC) running on an old  spare computer feeding stepper drivers though a parallel printer break-out board?

Do you still run, say, LinuxCNC on a computer concurrently with these other boards?

And once a G-code program is sent to the Raspberry Pi how do you interrupt, modify it? Is there some graphic CNC program running on it?

 
I love it when a Plan B comes together!
Steve
https://www.youtube.com/watch?v=4sDubB0-REg

Offline vtsteam

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6466
  • Country: us
  • Republic of Vermont
Re: Raspberry Pi, Arduino, Shield, GRBL, CNC, etc.
« Reply #1 on: December 26, 2014, 01:46:55 PM »
A little more reading seems to be answering some questions -- Grbl seems to include a graphical interface and jog controls, and seems to run on the Rspberry Pi.

In the hardware project linked above, it looks like an additional computer(laptop) is used for an actual physical display for the headless Raspberry Pi through VNC via a (wireless) network. But the Pi is running the GRBL program, not the laptop.
In the project, an Alamode board hooked to the Pi provides a Real Time Clock  and does the G-code to motion translation (I think). Finally a CNC Shield board seems to provide stepper drivers.

My questions now are,

1.) if I already have drivers, can I eliminate the shield board?
2.) Does GRBL provide look ahead buffer capabilities for motion control -- how square would corners be if this system was running a mill, and does the feed rate slow down from a straight line on doing arcs an circles made of polylines?
I love it when a Plan B comes together!
Steve
https://www.youtube.com/watch?v=4sDubB0-REg

Offline Brass_Machine

  • Administrator
  • Hero Member
  • *****
  • Posts: 5504
  • Country: us
Re: Raspberry Pi, Arduino, Shield, GRBL, CNC, etc.
« Reply #2 on: December 26, 2014, 10:28:29 PM »
Hi Steve,

Can't answer any of your questions about using the Arduino/Raspberry Pi for CNC. I do have an Arduino I got for fooling around with. Figured I needed to learn this stuff someday. But I do plan on getting a Rasp Pi very soon to do a car audio implementation.

Back to the CNC bit for the Rasp Pi. Would be curious to see how you get on with it. I have a laptop now for my controller. Though I do have an old PC waiting to go into the shop for my mill. Mind you, I am going to completely rebuild it... so this may be an alternative to the bulky pc.

Eric
Science is fun.

We're all mad here. I'm mad. You're mad.

Offline vtsteam

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6466
  • Country: us
  • Republic of Vermont
Re: Raspberry Pi, Arduino, Shield, GRBL, CNC, etc.
« Reply #3 on: December 27, 2014, 12:16:57 AM »
Eric, I'm writing this from the Raspberry Pi on our TV via HDMI. Boy that makes a big monitor!  I'm used to a laptop and this is a 32" screen. Resolution is amazing via HDMI. Not quite the same league as the old TRS-80 days when you hooked up to your TV via an RF converter and got a fuzzy 16 x 64 characters! Yet this thing is the size of a pack of playing cards, and cost about $30.

I'm running Raspbian, a version of Debian Linux specifically tailored for the Raspberry Pi (mine is a B+ model). There aren't many applications that come bundled with it, and I have some favorites so I first installed Synaptic (an application program downloader that works with the Debian repositories), and with that installed Iceape (Seamonkey/Mozilla browser suite), Libre Office Suite, MtPaint, GIMP, and Libre CAD. I also added NoScript to Seamonkey to block web script junk, and deleted Google as the search engine and replaced it with Ixquick.

For getting started with these little boards, you need a fast SD card (micro for the B+ model) of 8 gigs or more ( I bought a 10x speed 16 gig -- $13) and this is actually essential, since the OS goes here, and must be downloaded separately (used my laptop) or the board won't boot.

You also need a video cable, a USB keyboard and mouse (can be IR with a dongle -- mine is). I happened to have an old USB wireless dongle also, and that worked out of the box to connect to my network. There's also an ethernet port on the board for a hard wired network connection. I had all the stuff I needed on hand already, except for the video cable and SD card, so it was all pretty easy. Oh yes, a 5V USB type power supply of 1 amp or greater capacity to help power the USB ports as well as the board ( I have a 2A supply).

Unfortuntately, from my reading, WINE won't work on the Raspberry Pi to run Windows programs on a linux platform, as it will on my notebook computer. This is beacuse the RPi has an ARM v6 processor, which has a different instruction set than the typical Intel x86 Windows machine. So both WINE and the applications would have to be re-compiled (or run on an emulated processor) -- neither of those are mean feats, and the performance hit would be substantial, probably. Thus I can't run Sketchup (CAD) -- the only reason I have to run a Windows program. But a very important one for me in a work computer.

But of course this isn't a work computer, really, and for everything else I can think of re. productivity or entertainment it would actually be fine! Which is remarkable for a $30 device. The screen is really beautiful -- easy on the eyes with a big monitor at high resolution. With 4 USB ports on board you could add a portable terrabyte drive, or a bluray drive or both. If you hook a powered USB hub, it would supply power to both the board and additional USB ports -- if you needed them.

I think this might just end up being a family computer in the living room! Well if it doesn't end up in a dedicated CNC box!. Heck, we could get another one for $30 and do both!

Well I am very impressed -- it's a lot better than I expected -- everything just worked great on installation, and the graphics are excellent. This is designed as an educational computer, but it isn't just for kids. It's a pretty decent desktop computer, to be honest.

Okay, back to the CNC topic:

Probably I'll next download a VNC server. This will allow another computer to view the RPi's desktop and run mouse and keyboard. In other words, allow it to run headless. This is what the setup referenced in the first post uses. The RPi thus doesn't need a keyboard, mouse, or screen -- it is operated by a remote computer (or tablet) running a VNC client, over the network.

So the next stage would be testing the VNC capability. I don't anticipate problems, since I've done this before.

 

I love it when a Plan B comes together!
Steve
https://www.youtube.com/watch?v=4sDubB0-REg

Offline mattinker

  • Hero Member
  • *****
  • Posts: 1316
  • Country: fr
Re: Raspberry Pi, Arduino, Shield, GRBL, CNC, etc.
« Reply #4 on: December 27, 2014, 12:33:04 AM »
That was fast!

Regards, Matthew.

Offline backofanenvelope

  • Jr. Member
  • **
  • Posts: 70
  • Country: gb
    • !5 Minute Modeller
Re: Raspberry Pi, Arduino, Shield, GRBL, CNC, etc.
« Reply #5 on: December 27, 2014, 04:09:06 AM »
Next thing you'll be building one of these Steve :D

https://www.youtube.com/watch?v=Jq5nrHz9I94

I have a couple sitting around I really must put them to use.

TomC
*** Master Guild of Procrastinators ***

Offline gerritv

  • Full Member
  • ***
  • Posts: 115
  • Country: ca
  • St Catharines
    • My Hobbies
Re: Raspberry Pi, Arduino, Shield, GRBL, CNC, etc.
« Reply #6 on: December 27, 2014, 04:30:14 AM »
A little more reading seems to be answering some questions -- Grbl seems to include a graphical interface and jog controls, and seems to run on the Rspberry Pi.

In the hardware project linked above, it looks like an additional computer(laptop) is used for an actual physical display for the headless Raspberry Pi through VNC via a (wireless) network. But the Pi is running the GRBL program, not the laptop.
In the project, an Alamode board hooked to the Pi provides a Real Time Clock  and does the G-code to motion translation (I think). Finally a CNC Shield board seems to provide stepper drivers.

My questions now are,

1.) if I already have drivers, can I eliminate the shield board?
2.) Does GRBL provide look ahead buffer capabilities for motion control -- how square would corners be if this system was running a mill, and does the feed rate slow down from a straight line on doing arcs an circles made of polylines?

Grbl is a Gcode interpreter that runs on an Arduino UNO. In the article he uses an Alamode which is similar to the UNO. It drives stepper drivers, eg. the usual 25 pin drivers from Mach3 or individuals ones such as Gecko or drivers on a shield as in the article you linked to.
Grbl does not have a GUI built in, you need to feed it lines of Gcode from some other program that reads the file and pieces it out.
In the article he uses a Windows PC running Remote Desktop (or VNC) to connect to the Raspi which is running one of the myriad of Grbl feeders.
Personally I see no benefit to using the Raspi in this scenario other than satisfaction in wiring it all up :-) And I definitely would not want yet another layer between me, the button pusher, and the machine being controlled.

Grbl has a planner that holds 16 gcode commands. It is very efficient at driving machines. Yes there are some missing gcodes such as canned drilling cycles but those are easy to replace with simpler codes. File size is not the limiting factor that it was with paper tape!

I wrote a GUI that is more machining focused, https://github.com/gerritv/Grbl-Panel/wiki . It show cases many of the features of Grbl. At least one user is driving a Bridgeport mill with Grbl-Panel and Grbl. I use CamBam to create gcode, there is a post processor for it that is geared to Grbl.

The Grbl wiki contains a lot of info on its capabilities, well worth a read.

Gerrit




Offline DMIOM

  • Hero Member
  • *****
  • Posts: 676
  • Country: gb
  • Isle of Man
Re: Raspberry Pi, Arduino, Shield, GRBL, CNC, etc.
« Reply #7 on: December 27, 2014, 05:24:29 AM »
Just a small note of caution from experience - not intended to diminish the Raspberry Pi - if you wish to use the Pi for "anything important".  There can be issues with the reliability of SD cards in this type of application, but there is a workaround (just minimally boot from SD and then run everything, including the OS, from a USB key).

As Steve mentioned, the main (only!) storage by default is an SD card, and that holds the operating system, all application programs and your data.

SD cards contain "NAND flash". All of the bits in a NAND flash block must be erased before the data is written, or programmed, and the program/erase process eventually breaks down the oxide layer within the floating-gate transistors of the NAND flash. The life of a NAND flash cell is typically quoted as 10,000 - 100,000 cycles

To prevent premature failure, most general-purpose flash memory devices incorporate increasingly-sophisticated "wear levelling" techniques - as each block of a file is written, the firmware inside the memory device decides whereabouts on the chip to write it (although this does have speed penalties - when writing because it has to decide whereabouts the best place is for each block, and when reading because file chains are more fragmented).

In view of their target application for recording still photographs and video footage, the absolute goals for SD cards have been (a) absolute speed of writing, (b) un-interrupted writing, and (c) storage capacity; and with their use in MP3 players etc., a subsequent goal was retrieval and playback speed.  In all these applications though, the number of read/write cycles per hour/day is very low in disc terms.

To meet these performance goals, SD cards tend not to use any of the "wear levelling" techniques used in other flash-memory storage media (SSD drives, even USB memory keys) - they just lay-down blocks as fast as they can, preferably contiguously; and the block-oriented nature of flash memory fits well when saving high-volume still images or video files.

In the old days of single-user DOS or CP/M the only access to disc was when you wanted to open a new program or read/write data files; however modern OSes (unix derivatives, Windows etc.) made more & more use of the hard disk, and not just as a swap file - just watch the hard disk light flicker on your laptop or PC even when you're not doing anything yourself!

SD cards are a great commodity storage BUT they're not really intended for 'main system disk' use - they can - and do - wear out.

The Raspberry Pi was designed as an educational tool - and in that environment SD cards are fine.

Unless you're extremely careful and/or make intrusive modifications to the operating system, unix operating systems update a timestamp whenever they read or check a file.  So, even if you're not changing anything, bits of the file system can be updated as often as once a second .....

I've been involved with several projects where we've exploited the Pi but need it operating reliably, unattended. We found we could not get reliable operation (typical symptoms the Pi would crash and then no longer reboot, SD card was corrupt, so watchdog timers no help either).  The solution we found was to have an absolutely minimal boot on the SD card and the root system on a USB memory key.  This is much better but not infallible - remember you still need backups!

Dave

Edit - typo in upper number of cycles, had put an extra zero so it said 1000,000 when it should have been 100,000
« Last Edit: December 27, 2014, 08:05:22 AM by DMIOM »

Offline Will_D

  • Hero Member
  • *****
  • Posts: 668
  • Country: ie
    • National Homebrew Club of Ireland
Re: Raspberry Pi, Arduino, Shield, GRBL, CNC, etc.
« Reply #8 on: December 27, 2014, 06:22:52 AM »
Homebrewers use a product called the BrewPi. Its a Raspberry pi controlling an Arduino that controls the fridge/heaters

Why the Arduino? Because the Raspberry is viwed as not reliable enough and so if if fails then the Arduino just holds the fermenter at the last set point.

As in not reliable enough to switch a fridge and heater on and off over a couple of days/weeks.

What about if its controlling a CNC machine running a long program?
Engineer and Chemist to the NHC.ie
http://www.nationalhomebrewclub.ie/forum/

Offline vtsteam

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6466
  • Country: us
  • Republic of Vermont
Re: Raspberry Pi, Arduino, Shield, GRBL, CNC, etc.
« Reply #9 on: December 27, 2014, 09:36:15 AM »
Wow, extremely informative and well written information everyone!  :bow: :beer:

I have a lot of thoughts and it will take me a bit to look at the links etc. So there will be just a few thoughts here.

re. unreliability of flash memory:

1.) I did know about this in a general way, but didn't realize that SD cards were worse than thumb drives. If I do eventually use the RPi, I will definitely minimize the SD usage as you do, DMIOM

2.) Point of interest: coming from a Puppy Linux background, flash memory (thumb drive) minimization is planned for by running the entire OS and applications in RAM (since it is so optimized in size) and having a "personal save file" which is written to the drive with data and added apps only occasionally, or on shutdown.

Use of a non journaling filesystem like ext2 also helps. Running in RAM also makes Puppy very fast. Puppy Linux seems to be available for the RPi, (though only in Alpha testing. -- still, it might be good enough to run just the CNC applications)

3.) I use CNC just a few times a year, far less than a camera. I think that my using the typical hobbyist ancient parallel port desktop PC, left for months at a time in a subfreezing shop with a conventional hard disk drive and in a dusty environment would probably be even less reliable, than a dedicated RPi with no hard drive used maybe a dozen times a year. For me, a dedicated CNC computer would not be left powered continuously or used for other purposes.

4.) I typically auto-run fsck at startup so any any memory failure would have to occur during operation, rather than between.

5.) I'm running small CNC machines, and drive power is always off if hands are on the table. I don't depend on a computer to decide whether to move things I'm working on. I let a power switch decide that. This isn't a producton shop. True I can damage a machine if a program goes awry. But I'm far more likely to do a G-code or setup mistake and cause a crash  than memory expiring (unfortunately) and them's the breaks. Although if something does break, maybe the RPi can take the blame anyway!

But I didn't actually buy the RPi for a CNC machine -- I just received it for Christmas, and tried to think what to do with it, so there's no certainty I will build the project that started this thread.

For me the reliability issue could probably be solved. It's the usefulness for my purposes of Grbl and whatever control interface it uses that would decide me.

If it can't maintain a constant feed rate at decent speed through multi-segmented curves because it doesn't have a look-ahead buffer, I'm not interested. I don't care about fancy cycles and G-codes, but the ability to handle acceleration and deceleration intelligently is an absolute requirement, for me.

I love it when a Plan B comes together!
Steve
https://www.youtube.com/watch?v=4sDubB0-REg

Offline Joules

  • Hero Member
  • *****
  • Posts: 1271
  • Country: gb
Re: Raspberry Pi, Arduino, Shield, GRBL, CNC, etc.
« Reply #10 on: December 27, 2014, 10:53:57 AM »
SD card reliability is usually down to quality, pay more get reliable cards.  We have high spec cards that are used for HD digital video and multi track audio recording.  The cards get heavy use and high transfer speeds.   These are the cards I use for low power computer use and not had a failure yet, plenty of trouble with cheap cards in our cameras and audio recording gear.
Honour your mentors, and pay it forward.

Offline vtsteam

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6466
  • Country: us
  • Republic of Vermont
Re: Raspberry Pi, Arduino, Shield, GRBL, CNC, etc.
« Reply #11 on: December 27, 2014, 01:25:07 PM »
Gerrit, still absorbing what you wrote.

It sounds like the Grbl "planner" is the look ahead function -- do you run a CNC machine that demonstrates to your satisfaction that it doesn't effectively slow down in doing multi segmented curves, and does outside corners reasonably sharply?

And it also sounds like I wouldn't need a shield since the alamode has pin outs to directly connect to drives like Gecko drives.

The final question is, whether the RPi is neccesssary --  it is running the GUI and a vnc server (or rdp, whatever). Your interface looks good, but I presume it runs only on a vbasic/Windows machine. Are there front ends for Grbl that run on a linux machine, and how would a notebook/desktop/tablet or whatever interface to the alamode, if there were no Pi? Or would you not have chosen the alamode in the first place?
I love it when a Plan B comes together!
Steve
https://www.youtube.com/watch?v=4sDubB0-REg

Offline gerritv

  • Full Member
  • ***
  • Posts: 115
  • Country: ca
  • St Catharines
    • My Hobbies
Re: Raspberry Pi, Arduino, Shield, GRBL, CNC, etc.
« Reply #12 on: December 27, 2014, 04:03:46 PM »
This video shows my 'build enough to see if it will all work' machine at work cutting T6061. Feed rates are too slow, that was part of the subsequent adjustments.
and


Grbl interprets Gcode just as Mach3 or LinuxCNC do. (but not as extensive a set of codes). So it corners as it is expected to. Grbl also pre-plans enough so that all but the very shortest segments run at full speed. A long sequence of short segments with my GUI will hesitate once in a while as I have not yet implemented the high speed stuffing protocol. Grbl gets its data at 115,000 baud and my GUI shows the fullness of the queue as usually full.

There are other GUI's out there, most of the useful ones are listed on the Grbl wiki. Most run nuder Linux. Some are better than others, some hang for weird reasons, some do things to the Gcode on the way to Grbl (and some don't make it clear what they modify) etc. None take a machining approach though, they are geared more to small routers etc.

Yes, mine presently only runs on Windows PC's but I expect to make some 'dumb it down for Mono' changes soon to let it run under Mono on Linux and OSx.

You wouldn't need a shield if you wire the Geckos directly. But you will still need to use a machine to control the RasPi ( which will control the Arduino running Grbl). In my mind 1 computer too many.

Gerrit
Gerrit

Offline vtsteam

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6466
  • Country: us
  • Republic of Vermont
Re: Raspberry Pi, Arduino, Shield, GRBL, CNC, etc.
« Reply #13 on: December 27, 2014, 11:36:18 PM »
Thanks Gerrit. I like your panel best of the ones I've seen so far. Very nice!

And reading even more, it seems that though the RPi project this thread started out with used an Alamode board to connect to the RPi in a neat header plug-in way.

But that method wasn't necessary. It could also be handled via USB from the RPi (or another computer -- a laptop, say) to an ordinary arduino Uno running Grbl. The Rpi (or laptop) would run the GUI that feeds the Arduino the G codes.

And also a second computer wasn't necessary with the RPi. If it had a keyboard and monitor and mouse, it could run standalone instead of headless.

So a system could simply consist of an RPi (w/K,V,M) and an Arduino connected by a USB cable.

If that is so, and you had on hand, commercial stepper drivers with opto-isolated inputs that needed only step and direction signals, and you had limit switches in place, could the Arduino board be direct wired to these inputs, or would you need an interface board (I guess you call them "shields" -- sorry I don't yet know all the arduino jargon)?

Like so?



It seems like the simplest and least expensive system for me would be going that route -- basically I'd just need an Arduino Uno to complete a system?

ps. though mono would work to port your GUI to an x86 Linux, I'm guessing it wouldn't be possible for an ARM proc Linux like the RPi  :(
I love it when a Plan B comes together!
Steve
https://www.youtube.com/watch?v=4sDubB0-REg

Offline gerritv

  • Full Member
  • ***
  • Posts: 115
  • Country: ca
  • St Catharines
    • My Hobbies
Re: Raspberry Pi, Arduino, Shield, GRBL, CNC, etc.
« Reply #14 on: December 28, 2014, 08:42:16 AM »
Hi
You got it Pontiac, (a saying from the old days)  :beer:, factoring to its simplest level.

Mono will run on a RasPi: http://logicalgenetics.com/raspberry-pi-and-mono-hello-world/

My setup has wires directly from the UNO to a DB25 which then connects to a combo breakout/stepper driver board. The only issue is that the Motor On signal should be inverted in this scenario as its default state from the UNO is on! It blips the motor on power down because of that, not a pleasant surprise the first time it happens. This seems to be related to the way db25 breakout boards are designed.

I found the UNO that I packed for our winter trip, I guess I had better get that port finished soon :-)

Gerrit




Offline vtsteam

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6466
  • Country: us
  • Republic of Vermont
Re: Raspberry Pi, Arduino, Shield, GRBL, CNC, etc.
« Reply #15 on: December 28, 2014, 08:55:45 AM »
Thanks Gerrit! :beer:

I think I'll send for a Uno board then.
I love it when a Plan B comes together!
Steve
https://www.youtube.com/watch?v=4sDubB0-REg

Offline gerritv

  • Full Member
  • ***
  • Posts: 115
  • Country: ca
  • St Catharines
    • My Hobbies
Re: Raspberry Pi, Arduino, Shield, GRBL, CNC, etc.
« Reply #16 on: December 28, 2014, 12:27:50 PM »
BTW to address the real/valid concern about using an SD card as a hard drive, this is useful to know:(from the Raspberry Pi web site)

All the files necessary for booting are installed in a FAT32 partition of the SD card. The Raspberry Pi has to have an SD card installed to boot from, but a USB HD can “take over” after the initial boot. You cannot boot without an SD card.

Gerrit

Offline vtsteam

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6466
  • Country: us
  • Republic of Vermont
Re: Raspberry Pi, Arduino, Shield, GRBL, CNC, etc.
« Reply #17 on: December 28, 2014, 02:19:11 PM »
Thanks Gerri, again   :beer: (I did get that bit from DMIOM earlier, as well).

So, for booting, seems like just a small, high quality SD card would do the trick. Writes would therfore be few and far between except for boot option changes.  And reads are limited, assuming control is transferred to USB drive immediately.

(btw, I think the Atmel processor also has 32K internal flash memory that is read to boot the Arduino board.)

For me 100 jobs a year would be an extremely optimistic estimate of use. So I think the reliability risks are trivial.

Even then, there's a failsafe feature of sorts with the RPi SD card in this application. If the boot card ever failed, you wouldn't succeed in booting to the USB drive anyway. So you wouldn't be able to do any CNC milling at all. In that case, You would just replace the card for a few bucks.
I love it when a Plan B comes together!
Steve
https://www.youtube.com/watch?v=4sDubB0-REg

Offline vtsteam

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6466
  • Country: us
  • Republic of Vermont
Re: Raspberry Pi, Arduino, Shield, GRBL, CNC, etc.
« Reply #18 on: December 28, 2014, 02:41:38 PM »
Another thought -- In my tiny shop, it would be great to get away from the need for a keyboard and mouse and monitor (or even a laptop in a 6' x 8' shop).

An ideal (at least in size and portability) would be something like an Android tablet for feedback and control similar to Urly's Bluetooth DRO project that Modeldozer is writing about in his thread.

I happen to have an 8" Acer A1-830 (Atom x86 proc) that would be great to be able to use. That would be pretty close to a CNC pendant in utility. Though maybe a Bluetooth connection wouldn't be feasible for reliability. Don't know.

Still, a USB cable wouldn't be any worse than a pendant requires, and simple to connect.

Maybe just a pipe dream  :scratch:
I love it when a Plan B comes together!
Steve
https://www.youtube.com/watch?v=4sDubB0-REg

Offline gerritv

  • Full Member
  • ***
  • Posts: 115
  • Country: ca
  • St Catharines
    • My Hobbies
Re: Raspberry Pi, Arduino, Shield, GRBL, CNC, etc.
« Reply #19 on: December 28, 2014, 03:54:34 PM »
Just use the Android to Remote Desktop into the RasPi? http://www.raspberrypi.org/forums/viewtopic.php?f=63&t=65264

Lots of cheap tablets around in the post-Christmas sales.

Gerrit

Quote
Another thought -- In my tiny shop, it would be great to get away from the need for a keyboard and mouse and monitor (or even a laptop in a 6' x 8' shop).

An ideal (at least in size and portability) would be something like an Android tablet for feedback and control similar to Urly's Bluetooth DRO project that Modeldozer is writing about in his thread.

Offline vtsteam

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6466
  • Country: us
  • Republic of Vermont
Re: Raspberry Pi, Arduino, Shield, GRBL, CNC, etc.
« Reply #20 on: December 29, 2014, 09:36:43 AM »
Thanks Gerrit -- I was wondering how much lag there might be -- I didn't try it RDP with Android yet, but last night I did download a few more things to play with on the RPi:

TightVNC server
FTP server
Florence onscreen keyboard

And VNC'ed to the RPi from my Linux laptop successfully. Interestingly the RPi with the particular VNC software I used didn't forward screen 0, but added new screens  (screen 1, 2 etc.) when requested). So I couldn't see the laptop activity on the main RPi screen, and the laptop didn't see what was already open on the RPi. Not a big deal for the CNC purpose of running headless, and probably there's a solution somewhere anyway.

I did try aFreeRDP client on Adroid, but couldn't apparently get the parameters correct to connect via VNC (I tried ports 5900 and 5901, and the IP xxx.xxx.xxx.xxx:1 methods). This also probably has a solution in settings somewhere.

Finally the Florence onscreen keyboard wasn't working via VNC, but does work normally on the RPi, so it's possible to get rid of the wired physical keyboard for doing simple work (like CNC). That's one less wire and device going to the board. My mouse is an IR mouse, so now the board only has to be located near the screen, with no wires draped across the living room floor (or shop, when it comes to it).

I do have a bluetooth keyboard and a bluetooth USB dongle, I might try to see if I can get those to work with the RPi this evening.

BTW, the Florence keyboard seemed to have some small bugs -- there were unlabeled function keys -- only the alphanumeric keys had labels. In the past I had tried another virtual keyboard that I liked a lot -- I think it was called xvkbd or something -- I'll have to look that up -- I think I even customised it at one point.

Another possiblility for CNC, is that there is a lot of talk about a new official low cost touchscreen about to be released for the RPi. That would make a very good combo, and make a pendant style setup easily possible, assuming a useful GUI for GRbl could be found to run on it.

In the past when I tried something similar to control LinuxCNC on a  dedicated computer from an 8" tablet, all of the GUI's I tried had checkboxes, touch controls and virtual buttons that were WAY too small to hit reliably without a stylus, which is clumsy and unreliable for this kind of thing.  So while it was possible to run LinuxCNC on something via VNC or RDP on a tablet, it wasn't useful. The same will be true of Grbl without a purpose made tablet GUI that has big buttons.

Enjoyable playing around with this thing  :coffee:
I love it when a Plan B comes together!
Steve
https://www.youtube.com/watch?v=4sDubB0-REg

Offline vtsteam

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6466
  • Country: us
  • Republic of Vermont
Re: Raspberry Pi, Arduino, Shield, GRBL, CNC, etc.
« Reply #21 on: January 01, 2015, 09:43:49 PM »
Just to update things:

I ordered an Arduino compatible UNO board and a screw terminal breakout board (shield) for it last week.

I've compiled and installed GRBL Controller from the zapmaker website on the Raspberry Pi.

I've compiled XJKBD 3.3 virtual keyboard for the Raspberry Pi. It works perfectly now.

I've successfully connected to the Raspberry Pi with Remote Desktop Protocol (RDP) from both my laptop, and my 8" Android tablet (Acer A1-830).

Just waiting for the Arduino stuff to arrive before hooking it together to try it out.  :zap:
I love it when a Plan B comes together!
Steve
https://www.youtube.com/watch?v=4sDubB0-REg

Offline vtsteam

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6466
  • Country: us
  • Republic of Vermont
Re: Raspberry Pi, Arduino, Shield, GRBL, CNC, etc.
« Reply #22 on: January 03, 2015, 09:40:03 AM »
The  Uno (clone) arduino board and the screw terminal shield (board) arrived last night. Total cost with free shipping was $14!

The Uno included a USB cable and header pin strips for connecting to the terminals on the board, but the shield will replace these with wiring terminals.

I was confused by the terminal board when I first got it as it was a single PC board, and it didn't seem to match the header positions on the Arduino. I eventually figured out that there was a score line on the board and you simply needed to snap the board into two individual boards and to rearrange them to plug into the Arduino. I almost sent it back to the seller! :doh:

Below are the parts received:

I love it when a Plan B comes together!
Steve
https://www.youtube.com/watch?v=4sDubB0-REg

Offline vtsteam

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6466
  • Country: us
  • Republic of Vermont
Re: Raspberry Pi, Arduino, Shield, GRBL, CNC, etc.
« Reply #23 on: January 03, 2015, 09:50:22 AM »
And here are most of what it takes to run a CNC rig the way I'm going to try it:

Raspberry Pi B+ board
Uno (arduino clone) board
Screw terminal shield (shown here plugged into the Uno board)
IR USB mouse (not essential -- you can run headless via RDP if wanted)
5V 2A wall wart -- (the Arduino doesn't need one -- it receives its power via the USB connection to the Raspberry Pi)
Stepper driver (this one would drive one axis and can handle up to 5 amps)



Not shown:

Monitor -- (or you can probably run headless via RDP)
Stepper power supply
Stepper motor
Wiring

Optional:

Hard keyboard (I use a virtual onscreen keyboard -- the mouse picks the letters)
USB wireless modem (or ethernet cable to RPi) if you want to use RDP to run headless)

Software:
Grbl
Grbl Controller

I love it when a Plan B comes together!
Steve
https://www.youtube.com/watch?v=4sDubB0-REg

Offline vtsteam

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6466
  • Country: us
  • Republic of Vermont
Re: Raspberry Pi, Arduino, Shield, GRBL, CNC, etc.
« Reply #24 on: January 03, 2015, 10:07:33 PM »
I've hooked the boards together and run the Grbl Controller software on the Rasperry Pi which is now controlling the Arduino running Grbl itself.

And tonight after some exploring I've finally managed to get my laptop computer to wirelessly connect to the Raspberry Pi and run the desktop.

I could now disconnect the mouse, keyboard and monitor from the RPi and just run things from the laptop.

As an experiment, from the laptop I ran the Grbl controller, and loaded an old G-code file and ran it. Here's a snapshot of the running job:



Now to see if instead of the laptop, I can run it from my 8" android tablet.
I love it when a Plan B comes together!
Steve
https://www.youtube.com/watch?v=4sDubB0-REg