. .

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Hi Kitwin
    Glad you got the software going, pity you are so far away From Melbourne.

    Hi Devmonkey

    This weekend I experimented with the tools I had to hand. An Aldi Cheapie Laser and the Microsoft webcam. I wanted to understand my tools better.

    This session I left the lens on the camera and to avoid the distortion caused by the lens, I pointed the laser at a piece of flat finished black cardboard. I aimed the camera at the cardboard As you can see this cardboard caused the beam to appear very dim visually. However as the Graph below shows the camera responded very well to the beam. The software was able to discriminate the bright beam against a dark background very well. A nice sharp Gaussian peak was produced. i Am not sure what the white flecks are I grabbed the screen and each time they were in a different position They did not affect the resulting graph.

    However the setup reminded me that using a lens will change the resolution of the device.

    See the spreadsheet image below. For no particular reason I had placed the camera at a distance from the target that meant that the area covered was about 3.8 inches. This means that the 640 pixels of the image sensor will be divided over the 3.8 inches.

    I used gauge blocks to measure a distance of 0.05 inches. a difference of about 8.4 pixel lines. This means that the setup as illustrated can not resolve more than about 6 thousandths of an inch.(I did not attempt to read more than 1 digit past the decimal point in the output box) The results were repeatable.

    Clearly if a camera with a lens is to be used from wide angle to microscope the resolvable distance will be determined by the magnification power. A microscope would increase the resolution. As I am interested in wire alignment, using a lowish power microscope is worth consideration. Depth of field needs to be investigated.

    Yes I knew this before but making a test brings it into focus. (Excuse the pun!) It also made me think on other applications that may benefit from a wider field of view at a lower resolution. As tested 6 thousandths of an inch resolution over 3.8 inches is excellent. EDIT There may be some lens distortion of the image and therefore the linear accuracy that would need to be taken into account.

    My next tests will be with wire no lens.

    Regards
    John

    Three images below.
    Click image for larger version. 

Name:	0366 26-08-2019 8-45-57 PM.jpg 
Views:	2407 
Size:	68.6 KB 
ID:	26316

    Click image for larger version. 

Name:	25-08-2019 10-59-56 AM.jpg 
Views:	2491 
Size:	66.2 KB 
ID:	26317

    Click image for larger version. 

Name:	Calcs 26-08-2019 9-10-02 PM.jpg 
Views:	2376 
Size:	363.5 KB 
ID:	26318
    Last edited by John McNamara; 27-08-2019 at 05:37 AM.

  2. #2
    John,

    Great stuff. The latest version of the software allows you invert the intensity so it should work with a wire (as a shadow camera). You can also input a pixel to um scale (or inches or whatever) so it reads in your calibrated units rather than pixels. There is a preferences option in the menu. Note it leaves the webcam image unchanged performs the inversion on the intensity profile before fitting the gaussian.

    FWIW the usb 1000x microscope I took apart to start this project at mid (say 100x) magnification is effectively 1:1 with the sensor area hence why it works so well without the lens. The magnification of these things seems to be defined as the multiplier of the subject size to screen size when displayed, i.e. it fully depends on the pixel pitch of your screen, thus should be largely ignored.

    My screen is 1440 pixels tall and has a height of 330mm therefore a vertical pitch of 1440/330 = 4.36 pixels/mm. Given the 640 pixel height we are using this implies a screen height of 147mm, so without the lens a 2mm test subject that appears 147mm tall is equivalent to magnifying 73x using the above very ropey definition of magnification.

    The depth of field of the usb microscope lens at the magnification you need is a few mm, should be sufficient. Non-linearity of your lens would have to be measured by focusing on a microscope scale, I have a couple of these that came with the cheepo usb microscopes.

    To my mind much easier to think it terms of subject size to sensor pixel pitch, e.g. with no lens and 640 pixel rows over 2mm we get 3um.

    Also something you must be aware of if trying to use a camera lens is that none of them are firmly fixed to the camera board meaning they will wobble and generate huge error as you move the camera around. The only solution I came up with for this was to find the focus/magnification you need then super glue the lens assembly in place. Also related is that the camera boards themselves are quite often not firmly fixed into the webcam cases causing the same problem. This is why I built a highly stable cube mount for the sensor (sensor is bolted hard to the delrin cube).


    Cheers, Joe
    Last edited by devmonkey; 26-08-2019 at 03:59 PM.

  3. #3
    Hi all,

    I've put a new version up with some major improvements, starting to turn into a piece of software I might use!

    So it will now allow you to record a bunch of measurements against a particular zero, and you can export these to the clip board for pasting into excel or whatever. It will also allow you to average the samples used in taking a measurement, this is set in the preferences and defaults to 10. Remember once you have calibrated it you can put in the scale per pixel so you get real units displayed and measured rather than pixels.

    Click image for larger version. 

Name:	screen_shot_2.png 
Views:	2305 
Size:	338.3 KB 
ID:	26319

    Get the latest version here:
    https://github.com/betzuka/laserleve...r.zip?raw=true

    Cheers, Joe
    Last edited by devmonkey; 26-08-2019 at 06:26 PM.

  4. The Following 3 Users Say Thank You to devmonkey For This Useful Post:


  5. #4
    Quote Originally Posted by John McNamara View Post
    Hi Kitwin
    Glad you got the software going, pity you are so far away From Melbourne.
    I'm far away from everywhere!
    An optimist says the glass is half full, a pessimist says the glass is half empty, an engineer says you're using the wrong sized glass.

  6. #5
    Joe,
    It's all working, giving a good display even with the B&D laser which I thought might be a problem. The only issue I have now is that my not-quite-full-HD 768 line laptop monitor can't show me the table of results which wants to be at the bottom of the screen rather than the side as in your picture. Looks a treat on the desktop monitor though. I wonder what the chances are of my wife lending me her swanky new full-HD touch-screen hybrid laptop for use in the shed? I could fold it over into tablet mode, put it keyboard down on top of a pile of sharp, greasy tools and then enjoy a slow, painfull death
    An optimist says the glass is half full, a pessimist says the glass is half empty, an engineer says you're using the wrong sized glass.

  7. #6
    Hi guys,

    Fixed some UI issues so it should work on a 1024x768 laptop screen (just for you Kit). I've also added linear regression to the measurements taken. This is because the best way to use this imho is not to try to align to the reference plane (the laser) rather to calculate the error to the reference plane and then to shim or scrape such that these errors lie in a straight line. Please let me know if this makes sense to you. It is kind of a fudge and only works because given our vertical resolution is only +/-1mm and we are using it over a range of over 1000mm (or however long your x rail is) giving a worst case divergence angle of ~0.1degrees, i.e. the laser and the linear regression are very nearly paralllel. This implies a worst case vertical error of the residual caused by the divergence of the regression line from the laser is a rather small 1 nanometer, 1000x smaller than our sensor resolution.

    The app now plots both the absolute and residual errors and tells you how much to shim or scrape at each point. So this is everything we need to level a rail, and when operated with a vertical laser line everything we need to straighten a rail. When I get around to it I will add two further measurement types, one for getting two rails planar, the other for tramming the spindle.

    https://github.com/betzuka/laserleve...r.zip?raw=true

    Click image for larger version. 

Name:	screen_shot_3.png 
Views:	1103 
Size:	356.5 KB 
ID:	26321
    Cheers, Joe
    Last edited by devmonkey; 27-08-2019 at 02:48 PM.

  8. The Following User Says Thank You to devmonkey For This Useful Post:


  9. #7
    And he does all this whilst standing on one leg and juggling with knives.

    Kit
    An optimist says the glass is half full, a pessimist says the glass is half empty, an engineer says you're using the wrong sized glass.

  10. #8
    Just for fun I tried the system out with the very cheap line lasers you can get on Amazon and ebay for £3. These don't use a glass cylindrical lens, rather a plastic ridged grating with multiple ridges. Although the software was able to get a solid lock on the beam I personally wouldn't trust this, the lens seems to create multiple lines that when focused land on top of each other, giving us multiple guassians. The depth of focus is also not good. See the pictures:

    Click image for larger version. 

Name:	cheap_laser.jpg 
Views:	1004 
Size:	93.3 KB 
ID:	26340
    Click image for larger version. 

Name:	diffraction_laser.png 
Views:	1091 
Size:	340.9 KB 
ID:	26341

  11. #9
    Last edited by John McNamara; 29-08-2019 at 11:34 AM.

Thread Information

Users Browsing this Thread

There are currently 16 users browsing this thread. (0 members and 16 guests)

Similar Threads

  1. WANTED: K40 laser
    By dfox1787 in forum Items Wanted
    Replies: 0
    Last Post: 23-10-2018, 08:34 PM
  2. Newbie - Help With Laser Cutting Speed And Power - 60W Laser
    By nickpscott in forum Laser Machines & Building
    Replies: 2
    Last Post: 11-11-2015, 10:07 PM
  3. FOR SALE: K40 laser not working (laser fires)
    By calida in forum Items For Sale
    Replies: 0
    Last Post: 31-03-2015, 08:45 PM
  4. WANTED: GCc Laser Pro or Epilog Laser Cutter Machine
    By Brownhills school in forum Items Wanted
    Replies: 1
    Last Post: 10-05-2012, 04:30 PM
  5. help with cnc laser
    By swinds in forum Laser Machines & Building
    Replies: 11
    Last Post: 09-01-2012, 10:15 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •