. .
Page 32 of 33 FirstFirst ... 2230313233 LastLast
  1. #311
    Thanks for this great thread. So if going the wire route, is it best to use the USB microscope?

    Sent from my SM-G991W using Tapatalk

  2. #312
    This is a great tool. There are some things I’d like to add to it, so I started writing my own version of it in python.

    Written in python, uses imageio and the ffmpeg backend to capture the camera (opencv is slow and clunky). Multi threaded, I’ve got the camera part of the tool running in its own thread. Some things

    I ran into some problems with the java tool as the measurement was off from the real world. I measured a glass slide with a dial indicator and compared that to the calculated scalar value i used for a physical pixel size it was off. The difference I think is due to the java tool reading the webcam sensor at 640x480 but the webcam I’m using has an FHD sized sensor 1920x1080. When it reads at a lower resolution it’s reading a center crop of the sensor so you’d need to account for the reduction of size of cropping the sensor vs using the full sensor.

    Working on the sampling part of the GUI now. I think I’ll keep the functionality mostly the same as the java tool but add some extra things like filtering out a percentage of edge cases when it’s multisampling.

    Thinking it's probably a good idea to setup PyInstaller so I can build the python app into an exe file. That way people can just download and run without needing to know anything about python.

    The python code can be found here:
    https://github.com/bhowiebkr/laser-level-webcam

    Here's a video of how the tool functions in early development.

  3. #313
    Great to see you playing around with this method. I ended up using the wire version with a microscope to straighten the master rail, i.e. 1D. The original version you are copying works fine but unless you have access to a precision scanning laser it can't be used for 2D leveling (bringing two rails into plane), the optics in a normal line leveling laser are insufficient as the line is not straight enough.

    Also we would need a different type of sensor to pick up a scanning laser.

    What are you planning to use it for?

  4. #314
    Hi Bryan Howard

    Gee It was great to see this project moving again.
    Devmonkey inspired me when he first posted this great idea

    I am still very keen to build an open source surface straightening device using a webcam and stretched wire. Using a small milling cutter to flatten a surface point by point. All I need is a signal that tells me the webcam software has found center of the wire, from a PC or microprocessor via a hardware port. Ideally a digital Value +- signal to enable me to find the wire more easily when moving the camera over the wire.

    I know I can build the hardware and provide the XYZ Motion control, Its just the webcam reading code that is beyond me.

    Extensive testing that proves the accuracy of stretched wire was done, all my results were posted earlier on this thread a few pages back.

    I also posted an early concept open source 3D model on Github

    Cheers
    John

  5. #315
    I’ll have to read up on the wire version, I saw mention of it buried in this thread but couldn’t find the description on how it works. I suppose it is along the lines of finding the center of a thin wire using a webcam sensor with a 40x-100x optical element on it? Correcting for the gravity dip over the span of the wire length?

    I want to use this to measure the flatness for the surface of a single linear rail.

    You mean the conical reflector in self leveling 360 degree lasers is just not good enough? I was thinking about that too but I guess if I’m trying to get just the surface for a linear rail flat all I gotta do is have the surface and the laser beam collinear? Then the precision of the reflector won’t be a factor.

    I’ve found this whole method work well with a single point red laser pointer but without the IR filter it tends to blow out the sensor pixel values. It might work better in my case because the “self-leveling” part of the self leveling 360 deg lasers wobbles all over the place.

    I don’t think I'd be able to get down to 1 um of flatness on the rails but if I can get down to 10um id be happy.

    I’ve got most of your original code converted to python. I need to get the raw points transformed from the fitted line figured out and I’m not sure what you are showing in the scrape and shim vs the residual columns. I thought those should be the same?

    Anyways, here's what I’ve got so far. I’ve found around 100 sub samples and throwing out up to 50% of the outliers gives me the most accurate measurements. I turned the camera on without letting it warm up so the values drift up and takes about 5 min of running before it equalizes. It kinda runs slow when recording and it not being compiled to C with nuitka.



    Here is with a red laser pointer. Sensor gets blown out so probably need a filter or Neutral density (ND) filter so the peek isn't flat/clipped. Furnace turned on so there is a bit of vibration as well as not getting warmed up.

    Last edited by BryanHoward; 08-03-2023 at 12:15 AM.

  6. #316
    I think I might have seen the model on GrabCad as well? I think having a PC and sending values to a microcontroller like an arduino would be the way to go. Then your microcontroller would be driving the steppers/servos. Communication would look like this in Python:

    import serial

    # configure the serial connection
    ser = serial.Serial('COM3', 9600) # change 'COM3' to the appropriate serial port name

    # send the message
    ser.write(b'Hello, world!\n') # the 'b' before the string converts it to bytes

    # close the serial connection
    ser.close()

  7. #317
    Using wire has the advantage over a laser beam when it comes to defining the boundary of the image formed on the webcam Microscope sensor. the thickness of the wire is known. and depending on the magnification of the microscope it will cover a certain number of pixels. There will always be aberrations; if the image not perfectly focused or if the lines in the camera sensor are not perfectly aligned to the wire. The the existing algorithm corrects for a fuzzy image rather elegantly.

    Placing a black background behind the (illuminated wire) provides a very sharp contrast.

    As I posted I got very good results using a manual lash up. using a micrometer. This method will provide all the data needed to flatten a surface. (Sag in the wire amounts to a couple of tenths over 2400mm, 8feet) You can use the Catenary formula to correct your measurements if you require higher accuracy.

    The machine I posted on Grabcad simply automates the process and employs a small cutter to flatten a surface in this case held vertically, No sag to worry about. It moved the camera (It is mounted on the cutting head slide) until it is centered on the wire then makes a tiny cut. It will be a slow process, several hours but in the end there will be a very flat surface developed.

    If this goes ahead I better dig up the ball screws and linear bearings I bought for this project. :)
    Last edited by John McNamara; 09-03-2023 at 04:25 AM.

  8. #318
    GrabCad Model

    I made a 3d Model to be made from laser cut parts that should be able to prove the viability of using stretched wire and a webcam microscope sensor.

    The design uses two webcams to sense two suspended vertical wires with a weighted end suspended in Oil. This will guarantee that the two wires are parallel in two planes. This will eliminate any twist in generated surface, it will be a true plane.

    I designed the mechanism using a laser cut frame and 100mm square tube and parts I have on hand.
    There is minimal machining to do mainly small size lathe work.

    To clear up any uncertainty The webcam sensor is moved mechanically until the image of the wire is Is centered on the webcam sensor. The size of the image will be determined by the magnification used. Small errors in the optics can be ignored as we are always using the same part of the lens.

    https://grabcad.com/library/machine-...linear-rails-1

  9. #319
    I’ve got the whole python tool complete in comparison to the java tool minus an export csv button. Some other things I’ll add which would be nice - replacing the selected sample in the table with a new one. https://github.com/bhowiebkr/laser-level-webcam

    Edit instead of adding another post bump. I've made another version fixing with export and some visual feedback on selecting table samples, a replace sample button which I'll find very useful as I can adjust an area and resample over and over till it's where I want it. Tooltips on everything so you should be able to figure out what everything does by just hovering over the widgets.
    Last edited by BryanHoward; 11-03-2023 at 08:45 AM.

  10. #320
    Here's my first real test of measuring the flatness of my gantry with a laser and webcam sensor. I’ll have to modify the laser level to disable the self-levelling of it because it’s wobbling all over the place.



  11. The Following User Says Thank You to BryanHoward For This Useful Post:


Page 32 of 33 FirstFirst ... 2230313233 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 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
  •