Author Topic: Rebuild  (Read 1433 times)

GD George

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
Rebuild
« on: May 15, 2020, 12:32:33 PM »
Hi Folks,

This thread started as a question in Zax's T2 support thread.  As I move further into the project though, it has become clear that I'm doing a bit more than adapting T2 so I've moved the thread here. 

Background

About five years ago, I purchased a Gear-Bbang-Best 5W laser kit. I think it sat for about six months before I assembled it. I didn't use it much, but as time passed I've had several cool projects including engraving some wooden challenge coins, clocks, and coasters.  I built a 3D printer last year and printed some upgrades that I want to add to my machine, and  I want to put a set of limit switches as well. The other thing that has happened is that due to moving work online, I repurposed my shop computer for my wife's use and I don't see myself getting it back anytime soon. 

The Gear

  • 5W laser (no idea of the specs beyond that.)
  • Generic XY axis aluminum frame with acrylic joinery
  • Dual Y axis, single X axis stepper motors
  • Benbox L7 card with GRBL .9 flashed
  • Raspberry Pi4 controlled (software TBD)

The Project(s)
  • Add focus knob
  • Add air assist
  • Add limit switches
  • Move from Windows box to Raspberry Pi for control
  • Add web cam

So that's where I am, gang. I've started with a lot of this but will try and write up each step as I implement it.

Best,
Jerry
echo4golf


GD George

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
Control Software
« Reply #1 on: May 22, 2020, 02:24:08 PM »
The biggest issue that I've had to deal with is finding software to control the machine via a Raspberry Pi. Surprisingly I found only two server-based packages that function via a web based front end: LaserWeb 4 and OctoPrint. I never got the former working correctly and the latter worked out of the box with g-code generated by T2.

LaserWeb4

In retrospect, this isn't the first time that I've tried LaserWeb and it was problematic for me in the past. In fact, if I recall correctly, it was my experiences with it last time that led me to choose T2. For me it hasn't been simple issue of the package not having a specific feature or two, but rather getting it to run the laser at all. Had I remembered this I probably wouldn't have tried it again.

I did give it a shot though and that I wound up doing was following the instructions here. The short version is that you need your Pi on the network with Internet access enabled. The application is NodeJS based so the first thing you have to do is install that package to a clean and updated Raspian (Debian Jessie) installation. The Github site says that LaserWeb will run on a RPi 2 or 3, and I had no issues installing to a Pi4b. Once you've got NodeJS installed and running, install git if necessary, and pull the repository to your installation, set the server up to start automatically if you want, and then start it. That's the easy part. Pull the IP of your Pi (ifconfig) and point a browser to; http://[RPiIP]:8000. There's a front-end client that you can install to a Intel based desktop. It comes in Windows, Mac, and Linux flavors but I like using a browser for access and it's probably a good place for you to start.

Here's where things went sideways for me.  Simply plugging in the laser usb and power saw the machine traveling on both axes, although I had to reverse the Y axis. It also saw the laser start. And burn. And burn... I cut the power, reset the whole system, and once again I had motor control but couldn't turn off the laser.
Some research led me to update GRBL on my machine. Much to my surprise, I was running version .9 and the minimum for LW4 is 1.1f or better.  So I flashed a version of 1.1f. Upon starting the system, I still had motor control and, lo, the laser didn't light off.  Unfortunately, the laser didn't start when I told it to either. At this point, I started to wonder if I had hardware problems. I knew that the machine had been working when I disconnected it and so I stopped there.

OctoPrint / OctoPi

I pulled the micro-SD card out of the Pi, flashed another with OctoPi, and set that up. For those unfamiliar with it, OctoPrint is a package designed to control a 3d printer. Like LW4, it's free, open source software. It also has really good support and a robust plugin library. The creator, Gina Häußge (@foosel, passionate code monkey, Geek, Gamer) works full-time on development and maintenance of the package and it shows. Additionally, OctoPi is a Raspian-based distribution of Häußge's package, maintained by Guy Sheffer. It can be burned directly to a micro-SD card and starts the OctoPrint server out of the box. After you make the SD, about the only thing you need to do is set up SSH or VNC and add a desktop if you intend to use any of them. They're actually not necessary as the server allows configuration of everything via the front-end. Once you've installed it and started the RPi, simply log to: http://[RPiIp] and you're there. There's a set up wizard that takes you though the basic process.

OK, that's great but, as we all know, a laser engraver is not a 3d printer. What makes OctoPrint relevant to the world of laser machines is a plugin called Better GRBL Support. It  worked with my machine with no fuss, no muss. I had motor and laser control out of the box. One warning about the plugin: it overwrites settings. Do not attempt to install it on a machine that controls your printer as you will quickly discover why you took that backup. You *did* take a backup first, didn't you?

Link to video of the machine running a simple T2 demo square.

Best,
Jerry
« Last Edit: May 22, 2020, 02:36:47 PM by GD George »

ggallant571

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3194
    • View Profile
Re: Rebuild
« Reply #2 on: May 22, 2020, 02:37:47 PM »
I've been running a home brew Linux application for about 4 years now. Have a few RPi around here and will try building it on one. It uses the GTK graphics so it may take a few tries to get the development tools working.
SARCASM - Just one more service we offer here.

ggallant571

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3194
    • View Profile
Re: Rebuild
« Reply #3 on: May 25, 2020, 06:16:25 AM »
Are you still attempting to control a diode laser via RPi? I had zero problems installing dependencies, building from source, and running. Built on both RPi 3 & 4, ran on 4 only. My RPI4 came with OS installed on SD card.

Now looking into making a gui that runs on a small touch screen lcd module.
SARCASM - Just one more service we offer here.

GD George

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
Home switches
« Reply #4 on: May 27, 2020, 09:11:46 AM »
I've got the control pretty well fleshed out. I'm running Octoprint via Octopi on a/an RPi4. I tweaked some of the $settings using an old post of yours, the thing is running nicely. Now I've moved on to getting a Wyze Cam (running the RTSP firmware) to work with it and installing home switches.

I'll write about the cam some other time, but it's been a challenge.

In terms of the switches, I'l looking at two options. The laser is run by an Eleks L7 card. I have it pretty well dialed in and it looks like I need to get to run my switches in a cirtuit between a couple of pins on the Nano (D9 and Ground). That doesn't look impossible for me solder-wise but it seems to me that there should be a riser that I could put between the nano and the card.

The other possibility is replacing the L7 card with a different one.  I have a Keeyees 4 axis card and shield that is earmarked for a router at some point, and I'm wondering if it would run GRBL without too many modifications. Or (third possibility) I could pick up a newer EleksLaser card with the header already attached.

Edit: the other thing that I should take into consideration is that I'd really like to be able to use variable power control of some sort on the laser.  It's got two wires going to the board but I wonder what i'd need to do to get PWM to work.

Any thoughts?

Best,
Jerry

« Last Edit: May 27, 2020, 09:16:49 AM by GD George »

GD George

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
Home switches...
« Reply #5 on: May 27, 2020, 09:48:15 AM »
What if I cut down a protoboard and used it as a breakout?  Has anyone had any luck with that?

Jerry

ggallant571

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3194
    • View Profile
Re: Rebuild
« Reply #6 on: May 27, 2020, 01:09:25 PM »
If your laser has 2 wires then you need a controller with the on-board switching MOSFET.
SARCASM - Just one more service we offer here.

GD George

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
Re: Rebuild
« Reply #7 on: May 27, 2020, 01:39:45 PM »
If your laser has 2 wires then you need a controller with the on-board switching MOSFET.

Example please?

I'm going out to cut down that proto board and see what happens.

GD George

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
Re: Rebuild
« Reply #8 on: May 27, 2020, 02:31:09 PM »
I'm going out to cut down that proto board and see what happens.

Hmmm. Couple of minutes with the band saw bench sander and it fits pretty nicely.  All of the 'd' pins except d12 are accessible via the proto-board cutout, and everything seems to still work.  I'll call that a tentative success.
« Last Edit: May 27, 2020, 02:33:32 PM by GD George »

ggallant571

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3194
    • View Profile
Re: Rebuild
« Reply #9 on: May 27, 2020, 02:34:04 PM »
I build my own. If you like soldering I will mail a blank. The pcb shops run specials where you can get 5 boards for 5USD. Sometimes with free shipping. Have been looking into getting the fabrication also done. I started with a L7 and it was random. Bought an L2 which died in 2 minutes.
SARCASM - Just one more service we offer here.

ggallant571

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3194
    • View Profile
Re: Rebuild
« Reply #10 on: May 27, 2020, 02:36:34 PM »
Careful - you will get a reputation as a real hacker!!
SARCASM - Just one more service we offer here.

GD George

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
Re: Rebuild
« Reply #11 on: May 27, 2020, 02:42:16 PM »
I build my own. If you like soldering I will mail a blank. The pcb shops run specials where you can get 5 boards for 5USD. Sometimes with free shipping. Have been looking into getting the fabrication also done. I started with a L7 and it was random. Bought an L2 which died in 2 minutes.

Your own breakouts? Nice. I think this will work. Soldering will be minimal. Thanks!

GD George

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
Re: Rebuild
« Reply #12 on: May 27, 2020, 02:53:28 PM »
The next question is about the mechanical endstop units.  If I understand my hardware:
  • I don't need pin 4 at all. That's 5v for the LED, and while I wouldn't mind having the LED working, it's not important.
  • Pin 2 (Ground) is not wired into the plug that comes with the module.
  • Pin 3 is also ground.
  • Pin 1 is signal.
  • If I wire the green (pin 1) into one, and the black (pin 3) into the other end of my meter I get no continuity.
  • If I close the switch, I get tone.

Therefore the switch is normally open and I should wire switch-1 green to pin 9, switch-1 black to switch-2 green, and switch 2-black to the ground pin next to d2.

Thanks,
Jerry

ggallant571

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3194
    • View Profile
Re: Rebuild
« Reply #13 on: May 27, 2020, 04:36:55 PM »
You probably should check the source code. First to make sure limit switches are supported. Second to see which NO or NC is selected.
SARCASM - Just one more service we offer here.

GD George

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
Re: Rebuild
« Reply #14 on: May 27, 2020, 07:07:25 PM »
It's the default version of GNEA 1.1h flashed from a hex. (https://github.com/gnea/grbl/wiki/Frequently-Asked-Questions)

It looks to me like the default is normally open.  The FAQ says that it will work with either though. What I'm not seeing is anything about pin 9 and ground. I think I got that from some things that @zax has posted. I'm not controlling the machine with T2 though at this point though.

So what I did is pull the source code, change it to 2 axis homing, and then flashed my machine. I'll check that it

My only question is where in the config to make sure that the Nano looks at pin9? OK, wait...One more question: the machine seems to be working well with this version (without the homing change, at least) but are there other things I need to look at?


« Last Edit: May 27, 2020, 08:23:15 PM by GD George »