Author Topic: LaserShark / Openlase / Raspberry Pi ?  (Read 30601 times)

Fabrice

  • Newbie
  • *
  • Posts: 20
  • Karma: +0/-0
    • View Profile
LaserShark / Openlase / Raspberry Pi ?
« on: November 24, 2014, 03:41:00 AM »
Hi ,

 ;D First of all thank you very much for this useful forum , i'm very happy to have discocered such a great place !  ;D (and aopologize my poor english Frenchie inside...)

I'm dreaming of owning a laser projector for quite a long time now and i have finally purchase the necessary hardware (galvo, drivers, laser source and laserShark kit) but I'm a total newbie in the linux world. :'(

So please may i ask you if I have any chance to use the raspberry pi with the Lasershark and openlase software ?

Which Linux distribition should I install on the Pi and please, could you tell me what kind of modification i must do in order to make Openlase and the included demos work ?

Sorry to be such a lamer but if someone could take the time of writing a kind of install-tuto , i'm sure that it would help lot of people ...

Thank you so much for your kindness and your patience .

Have a nice day

Macpod

  • Administrator
  • Full Member
  • *****
  • Posts: 179
  • Karma: +3/-0
    • View Profile
Re: LaserShark / Openlase / Raspberry Pi ?
« Reply #1 on: November 24, 2014, 09:38:48 PM »
Hi Fabrice,

For 3d printers (which use bulk transfers) the raspberry pi should be fine to use however for real-time laser projector use it won't work... or if it does it will work very poorly. The raspberry pi is simply too slow for real time laser displays.



I would encourage you to install linux on your computer for development. You can install two different operating systems on the same drive, install a new internal drive and install linux onto this, or even purchase an external hard drive and install/boot off this.

Fabrice

  • Newbie
  • *
  • Posts: 20
  • Karma: +0/-0
    • View Profile
Re: LaserShark / Openlase / Raspberry Pi ?
« Reply #2 on: November 25, 2014, 03:30:01 AM »
Hi Macpod,
Thank you very much for your answer, i'm really feel lucky and beholden to have find a such a great forum ...

I have well understand that Raspberry is not the right tool.

May I ask you if according to you, the use of a booting usb key with ubuntu 10.04 would do the job please ? I'm sorry to bother you with my poor level in linux operation but everything is still to discover for me ...

thank you very much for your time and your help Macpod ...

Have a great day

Fabrice


 

Macpod

  • Administrator
  • Full Member
  • *****
  • Posts: 179
  • Karma: +3/-0
    • View Profile
Re: LaserShark / Openlase / Raspberry Pi ?
« Reply #3 on: November 25, 2014, 07:18:59 PM »
Hi Fabrice

Booting from a USB key is slow but will work. If you have a computer with USB 3.0 ports (they are blue instead of black) then definitely try use a USB 3.0 thumb drive (it should be a little bit faster).

This will also give you an opportunity to play with linux :)


c60

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: LaserShark / Openlase / Raspberry Pi ?
« Reply #4 on: December 07, 2014, 05:59:12 PM »
I've used a raspberry pi with an audio dac using laserboy's info.  I basically just used the pi as a playback device.  I made up the multitrack audio files by recording the output of openlase and just using vlc with jack on the pi for playback.


Macpod

  • Administrator
  • Full Member
  • *****
  • Posts: 179
  • Karma: +3/-0
    • View Profile
Re: LaserShark / Openlase / Raspberry Pi ?
« Reply #5 on: December 07, 2014, 06:07:44 PM »
Running the LaserShark or JACK isn't the issue on the PI, it's OpenLase itself. In real-time it calculates where points need to be drawn to generate lines/etc and the PI is not suited for this.

Speaking of Laserboy, this is the reason I made the lasershark_stdin app. Time keeps escaping me but I intend to either made a LaserBoy extension to output proper output for the LaserShark.. or simply make a LaserBoy WAV to LaserShark format converter. Since the display wouldn't need to be calculated in real time for this, you could definitely use a PI+LaserShark to display pre-canned shows

Fabrice

  • Newbie
  • *
  • Posts: 20
  • Karma: +0/-0
    • View Profile
Re: LaserShark / Openlase / Raspberry Pi ?
« Reply #6 on: February 03, 2015, 09:42:06 AM »
Hi,
Sorry to return to the attack but may I ask you if you think that the brand new Raspberry PI Model 2 would be able to run openlase efficiently please ?

Thank you very much for your help ...

Have a great day

Macpod

  • Administrator
  • Full Member
  • *****
  • Posts: 179
  • Karma: +3/-0
    • View Profile
Re: LaserShark / Openlase / Raspberry Pi ?
« Reply #7 on: February 03, 2015, 10:51:01 PM »
Hi Fabrice,

It should work better than it would on the 1st gen stuff, but to what degree I'm not sure.

Ideally what needs to occur is a code inclusion to take advantage of NEON for arm7 builds.



maxem

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: LaserShark / Openlase / Raspberry Pi ?
« Reply #8 on: February 20, 2015, 04:08:20 AM »
Hi, I am interested in what the simplest form of a Linux computer you could use to run the LaserShark.  I know nothing about linux so I was hoping the Rasp Pi 2 would be powerful enough cause there is so much Rasp Pi documentation on setup and stuff.

You say for "bulk transfers" the Rasp Pi should be good enough.  I have a bit of an odd use for the LaserShark I would like to use it to help with part/material alignment on a cnc machine. Like this:
http://www.carterproducts.com/technology/z-laser-model-lp-hfd-pattern-generator

Basically I would have all the cnc files ready to cut for the day with the matching patterns for the LaserShark galvo scanner to help with material loading/placement.  I would just call up each pattern for each part, nothing fancy changing live just a still pattern projection.  Would this work with a simple Rasp Pi and say the files loaded on a usb or memory card? 

I would maybe use something like the frame creation tool near the bottom of this page:
http://elm-chan.org/works/vlp/report_e.html

I only need to make one pattern frame per cnc program to load the material properly. 

I know this is kinda a weird question/request but any input would be appreciated.  The price on those professional laser pattern projectors is way out of my league and also I don't need it to be as precise.
Thanks,
-Max

Macpod

  • Administrator
  • Full Member
  • *****
  • Posts: 179
  • Karma: +3/-0
    • View Profile
Re: LaserShark / Openlase / Raspberry Pi ?
« Reply #9 on: February 20, 2015, 06:41:30 PM »
Hi Maxem,

You should be able to run the lasershark_stdin application on a raspberry pi (1 or 2) to accomplish what you want. This is located in this repo:
https://github.com/macpod/lasershark_hostapp

To use this program you pipe in ascii commands that tell the lasershark_stdin application where to steer the galvos to and at what intensity the lasers should be set at.

The format of these ascii commands can be found here:
https://github.com/macpod/lasershark_hostapp/blob/master/lasershark_stdin_input_example.txt
Side note: I have noticed some individuals are confused by the fact that there is only one sample in this file. Normally you would have way more s= lines.. this file is just supposed to serve as a demonstration of the command format. It is not intended to be run as-is.

There is also a program in that repo (lasershark_stdin_circlemaker.c) that demonstrates how to dynamically generate these text commands in order to continuously draw a circle.


If you are able to convert your patterns into the lasershark_stdin command format, then you should be able to load them onto a usb stick which can then inserted into the raspberry pi. On the raspberry pi you can make a script which will detect when a usb stick is present and then pipe whatever patterns may be on the stick out to the lasershark_stdin application.


So to speak that is just one way to skin the cat. You could also make a program which takes your patterns directly and output the ascii command language used by the lasershark_stdin application. You could also set this up so you could transfer files over a network/etc. The sky is the limit!
« Last Edit: February 20, 2015, 06:52:05 PM by Macpod »

maxem

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: LaserShark / Openlase / Raspberry Pi ?
« Reply #10 on: February 25, 2015, 08:50:06 AM »
Thank you  for the quick reply.  I have been looking into this more and see that I can even control the Rasp Pi from a windows computer through something like Tight VNC.  The cnc machine is controlled by a windows pc and would be great to control both laser projector and machine from one computer screen. 

From what I understand about the sample code format  x,y,a,b,c,intl_a

X and Y are positions
A and B are only used if you have a laser that is power controlled via analogue
C is only used if you have a ttl power controlled laser
and  intl_a  is like a  safety thing that is either on or off ?

If its really this simple I would imagine that I can take my CAD files and output them as a CSV file and convert the XY data into this format for the laser shark with the proper header and footer added to the file.

Even if the laser would be constantly on causing connecting lines between the different shapes I think it would still be very easy to discern the boundaries of shapes.

This is very interesting, even though I know nothing about coding I think this could be done in a way that makes it worth while to help speed up machine loading times.   I just have to find the fastest/least effort way to make it worth while.  The alternative is using a home theater projector and setting up a fixed camera view in the modeling program I use 3D Studio Max and projecting the camera view rendered image. But of course ambient light and focus are a problem.

  Perhaps a Script can be written in 3DS Max that can take the selected objects and create the lasershark file directly. 
That would be amazing.  I will be looking into this some more...
Thanks for all your help!
-Max


Macpod

  • Administrator
  • Full Member
  • *****
  • Posts: 179
  • Karma: +3/-0
    • View Profile
Re: LaserShark / Openlase / Raspberry Pi ?
« Reply #11 on: February 26, 2015, 01:53:46 AM »
Yes, you are correct on your assumption for the sample format for the lasershark_stdin. Requirements like yours are exactly why I made this app :)

I'm not sure if I would recommend running a VNC server on the PI, instead what I would do is either setup a web server that you can upload your designs to to or alternatively use ssh and scp.


If you are new to programming I would suggest having a look at python. It is often taught as a starter language and due to the availability of pre-written libraries can be surprisingly powerful.

 

maxem

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: LaserShark / Openlase / Raspberry Pi ?
« Reply #12 on: March 04, 2015, 07:58:26 PM »
Sorry for the long delays between posts, been busy with multiple projects.

I know this is way off topic, not sure if I should start a new thread about this...
I have been thinking about using the lasershark to help with alignment of material and hold down supports on a cnc machine. 
This year I will be building a large cnc machine from scratch for simple cutting out of sheet goods with a spindle and also a tangential razor blade for cutting veneers.  I need to make this machine idiot proof because I will not be the only one running it. 

I think lasershark would help an operator see where the toolpaths are going to go before hitting the Start button so that crashes with hold down screws/fixturing does not happen.  Also it would help with alignment of veneers and odd shaped materials.  Or to tweak placement to avoid knots in wood etc.

I don't know how much experience you have with cnc machines but I have been thinking maybe its possible to use a CAM program to output the lasershark program.  Normally in CNC operations you create your G-code in a CAM program that has a post processor that matches your machine or you make your own custom post processor to work how you want it.  Maybe its possible to make a post processor that will output the format that the lasershark wants to see for X & Y movements and then the Z axis height output is used to vary the intensity of the laser.  Where the lowest Z height equals the highest laser intensity and the highest Z height equals the lowest laser intensity.  So that transfer moves, where the cutter picks up out of the material and moves to a new location and continues cutting, would either be of lower intensity or not appear visible at all.

This way you could output the toolpaths for the machine to cut with one CAM post processor and then switch to a lasershark post processor and output the lasershark file.

One problem with this is when using a cnc machine you usually have two different positions for home or X0,Y0,Z0  One is the machine coordinates that the machine homes or zeros itself to and then there are work offset coordinates that the operator sets to where the material is placed on the machine bed and the gcode is run from there (typically a G54,G55,G56 etc.).
  The problem with running the lasershark is that it would essentially always be aligned to the machine coordinates and getting it to change on the fly when the work coordinates that are changed by the operator would put the displayed pattern off of alignment from the cut.

It makes me think that the best way to go about this is to build a plugin to Mach4 that after you have loaded/opened the toolpath gcode file for the cnc machine, you could press a button to display the toolpath via the lasershark and the plugin would look at the machine gcode and subtract the current work offset coordinate from the machine coordinate and then output a file to the lasershark by saving it in a network folder for display for the lasershark.  And have the Rasp Pi or whatever always watching that folder and display that file automatically.  Every time you press the display via LaserShark button in Mach4 it would overwrite the file that the lasershark is looking for.

I still use Mach3 for one of my cnc machines and WinCNC for another.  The new machine I will build will be run by the new Mach4 controller.  I know writing a plugin for a CNC controller program might seem a little crazy but Mach has a huge diy cnc user base and just came out with the long awaited Mach4: http://www.machsupport.com/

I would like to explore this more when the new machine is built.  I really don't know anything about programming at all, I've built several arduino projects and understand that code but I know that's total beginner stuff. I'm really just a cnc guy that's good at 3D modeling. 


***OK this is embarrassing I just rechecked your youtube video before posting this and see you have your own cnc milling machine.  Where's that emote? oh yeah :-[  :-[  :-[

Please ignore the cnc explanation stuff I'm sure you know it all already, I could rewrite this post but maybe it will give someone else an idea or something.  Also it looks like you use linuxCNC so would you would not be interested in a Mach plugin, ugh.  Anyway the lasershark would be for a flatbed machine like this one I currently own (a video from 2 years ago:http://youtu.be/jeUpjhqeiHE ) but with an even larger bed for cutting thin sheet materials.
I know it wouldn't be useful on a milling machine like yours but on cnc routers like mine where the material is usually a 4'x8' sheet of plywood it could be useful because the easy way to hold down a plywood is to screw it down to your table in strategic places but avoiding hitting the screws is crucial and I think the lasershark could help a noob operator avoid hold downs and feel confident running the machine.
Sorry for the epic post.

Macpod

  • Administrator
  • Full Member
  • *****
  • Posts: 179
  • Karma: +3/-0
    • View Profile
Re: LaserShark / Openlase / Raspberry Pi ?
« Reply #13 on: March 07, 2015, 01:56:20 AM »
Hi maxem

Yes, this sounds like an interesting idea if you could affix a mount atop of your router in a permanent manner.

It would require you to add an f-theta lens or account for the non-linear projection surface intrinsic to laser displays but that should be trivial to do in software with whatever software is developed to convert from g-code to something the laser can display. You would also need to perform some per-machine tuning based on the dimensions of the machine and the machine home.

Having a script to show the next cut does sound like an ok way to go... no, I probably wouldn't be interested in making this because I'm using a mill vs a router and also because I'm not operating a production shop.

If you elect to continue forwards with this effort you should remember that in all you have a 4095x4095 grid of possible points this laser can be aimed at. As such it certainly won't be as accurate/precise as your cnc router's precision but may still be good enough to verify you won't hit any work-holding components/fixtures.
« Last Edit: March 07, 2015, 01:58:02 AM by Macpod »