Measuring the flatness of a surface with a laser and a webcam to microns over large surfaces.

2024 ж. 15 Мам.
97 515 Рет қаралды

Because of how image sensor technology has progressed, we can use that as the basis of a highly accurate measurement device. This tool works by reading the laser sensor’s intensity values on a webcam with its camera lens taken off. An image sensor off a typical $15 webcam is about 3mm wide and has a resolution of FHD (1920x1080). This means that each light sensor is in the range of 1-5 microns in size.
The camera sensor is mounted at 90 degree angle so the wide direction is vertical. This gives a high coverage to sense the beam and also reduces power source based noise like PWM noise in switching power supplies.
The laser beam can be a point or a preferred horizontal line (like in a self leveling laser that I am using). We take the mean of each row (ex 1080 pixels wide) reshaping the 2D image into a 1D array. We then take this 1D array and fit a gaussian curve to it to find the center point. Finally converting the pixel position into physical height from calculations based on the physical size of the sensor to its resolution.
Further improvements reaching sub-pixel noise can be done by multisampling the results, smoothing out the luminosity noise in the 1D array, and removal of outliers by percentage.
Adjusted sample location is done with linear regression and the deviation is the error from the fitted line.
Links:
Software sources files here:
github.com/bhowiebkr/laser-le...
Released binaries of the tool here:
github.com/bhowiebkr/laser-le...
PrintNC Discord where the main thread of my experiments and development of the tool are (sign-up is free):
/ discord
Original thread by the original creator of this workflow (highly recommended reading)
www.mycncuk.com/threads/12966-...
Please consider supporting me on Patreon:
patreon.com/user?u=56767327

Пікірлер
  • See the update video on this: kzhead.info/sun/bMOSp9p6bolnnoU/bejne.html I'm working on the laser side if this workflow by using a hard drive as a spinning reflector. Because of how image sensor technology has progressed, we can use that as the basis of a highly accurate measurement device. This tool works by reading the laser sensor’s intensity values on a webcam with its camera lens taken off. An image sensor off a typical $15 webcam is about 3mm wide and has a resolution of FHD (1920x1080). This means that each light sensor is in the range of 1-5 microns in size. The camera sensor is mounted at 90 degree angle so the wide direction is vertical. This gives a high coverage to sense the beam and also reduces power source based noise like PWM noise in switching power supplies. The laser beam can be a point or a preferred horizontal line (like in a self leveling laser that I am using). We take the mean of each row (ex 1080 pixels wide) reshaping the 2D image into a 1D array. We then take this 1D array and fit a gaussian curve to it to find the center point. Finally converting the pixel position into physical height from calculations based on the physical size of the sensor to its resolution. Further improvements reaching sub-pixel noise can be done by multisampling the results, smoothing out the luminosity noise in the 1D array, and removal of outliers by percentage. Adjusted sample location is done with linear regression and the deviation is the error from the fitted line. Links: Software sources files here: github.com/bhowiebkr/laser-level-webcam Released binaries of the tool here: github.com/bhowiebkr/laser-level-webcam/releases Original thread by the original creator of this workflow, the java tool and other resources (highly recommended reading) www.mycncuk.com/threads/12966-DIY-Laser-levelling-using-webcam-and-laser-level

    @BryanHoward@BryanHoward Жыл бұрын
    • Maybe it's written somewhere in the GitHub repository that I can't read from my mobile so forgive me if my question is redundant, but how does it reduce PWM noise?

      @AccidentalScience@AccidentalScience Жыл бұрын
    • @@AccidentalScience Webcam sensors read from top to bottom row-by-row. If you rotate the sensor on its side, any noise similar to PWM or mains transmission frequency doesn’t shift the luminosity to one side or another. It’ll get averaged out uniformly for that frame. This happens when converting the 2d image into the 1d luminosity array in the worker class github.com/bhowiebkr/laser-level-webcam/blob/dedd825f3080401046179c6e5afea68b8ed1395d/laser_level_tool/Workers.py#L132

      @BryanHoward@BryanHoward Жыл бұрын
    • you should perhaps slightly angle the sensor so to average out and interpolate the dead area etween pixels.

      @chargehanger@chargehanger Жыл бұрын
    • Instead of grinding to perfection, but just make it good enough - and then could it be shimmed? Or calibrated in sw using this method? I have a China CNC, and would like to get better precision, so this is super interesting! 👍👌Great work and thanks for releasing the info💪🙂

      @TheStuartstardust@TheStuartstardust Жыл бұрын
    • looks like linear sensor from scaner would work fine

      @Ritefita@Ritefita Жыл бұрын
  • Conceptually this is a clever idea, but I would suggest a number of things. First, watch a couple of Oxtools videos, one is "how thick is a Sharpie mark (spoiler, about 3 microns), another shows a surface plate being calibrated . You are tossing around microns rather cavalierly. A sheet of notebook paper is about 75 microns thick. There is overspray (or areas where you didn't fully remove the paint) and as you observed, the tube itself is warped transversely. At the very least I would clean off the tube a bit more and carefully clean the surface of the tube and your contact surface of your CMOS sensor. A spec of grit can be 50 microns, if that gets between the steel beam and your test sensor, you are just going to get garbage data. Next thing is why are you using a spinning laser? Seriously, use a single dot laser. I would not trust a spinning laser beam to remain stable, you are using something that was designed for mm accuracy, not micron accuracy. You can level your beam by taking a measurement close to the laser and one at the far end and adjust accordingly. In fact level is not really necessary for what you are doing, just that the beam is parallel to your laser beam. You are doing optical metrology and it would serve you well to read up a bit more to understand how much of this was done with autocollimators and telescopes. I would strongly suggest you do a sanity check on your readings by testing over a 3-4 inch section and check it against results you get with a decent straight edge and feeler gauges. You can also get a cheap dial indicator and mount it separate from the beam and put the indicator adjacent to the sensor and place a weight on the beam, when the beam deflects you should see it in the movement of the dial needle on the dial indicator, that should roughly correspond to what your sensor tells you. If not, I would examine your set up. Finally, I would replace your CMOS base with a budget 1-2-3 block, probably without the holes and also mount you sensor a little bit lower. I don't want to sound hyper critical, that is not my intent, in fact what intrigued me is your using a cheap sensor to locate the position of a laser beam, something I have a specific application for, so, thank you for this post and good luck.

    @John-ro2yk@John-ro2yk Жыл бұрын
    • I've seen his videos, there great. I haven't finished prepping the gantry and will be doing this off camera. This video was more of here's this idea of measuring, here's the Python tool, the workflow, my findings working with it, etc. I've tested this with a red point laser and it works fine. You can't use all the width of the sensor so the noise floor is higher. End goal is to use this on a custom made line laser so I can measure 2d points instead of being limited to a 1d line. These cheap import laser levels don't have any spinning parts to direct the beam. They use a conical reflector that I show in the video. Micron accuracy is achievable and measurable with this setup. While building the tool I was able to get repeatable measurements to around 0.4um with the both the green self leveling laser and the red pointer laser. Red pointer laser blows out the pixel values so it didn't make a good laser source for testing. In a more ideal setup Havering the diode current and voltage controlled is the way to go for controlling intensity on the sensor. Leveling the laser or the part to be measured does not need to be done actually. Just eyeballing it to make sure the projected beam is on the sensor at both ends is good. The software corrects for slope using linear regression. You don't need a very precise or sharp laser beam. On the sensor. Finding the center of the gaussian distribution of intensity values works very well as long as the laser intensity is not clipping. It can wonder around if it's chipped. I've done a bit but by no means an expert. Just a guy in his garage. I primarally write software in the VFX and game industries. An autocollimator, which is a great tool, is the wrong tool for this. I'm needing to measure change in height. Not angle. It can be done that way but is not the ideal tool. I've checked the setup on an 18" surface plate and it shows that things are working as expected. I don't have a longer flat reference than that so I cant compare it measuring that way against the gantry. Pretty much the whole drive of this was to find a good long way to make a flat reference. Unfortunately because the webcam sensor circuit board is so tall, in kinda stuck with it being so offset from the surface. The math works out to be just under 1um of error for a sensor to be 3" off the surface with a slope of 0.005"/1“ I'm fine with this for what I'm using it for, but other people wanting to build such a device may want higher accuracy. As mentioned the steel tube is not in any way flat, it dips alot in the middle so I opted to make a flat surface about the same width as the rails. I might change it up in the future if I'm measuring something different. Probably put 3 steel balls bearings on there. I was worried about the pitting in the steel to cause me problems hitting a low spots but the steel tube was in good shape enter taking the paint off. But yeah this was like writing a book! Lol I'm still working on the hardware and workflow. Figuring it out as I go. Building a new laser setup that will improve on many things from using the laser level, most importantly the wobble. Even the laser pointer held in a small vice wobbles by a measurable amount on the webcam sensor but the multi sampling and other filtering parts of the software do a good job cleaning up a lot of the noise.

      @BryanHoward@BryanHoward Жыл бұрын
    • @@BryanHoward It looks like you considered most of the issues. I didn't realize it was a non-spinning laser even though, you pointed it out in your video. Quarton makes some under $100 line laser's that are fairly nice and you have some options with angles and power, in this case reducing the intensity is probably helpful in preventing oversaturating the pixels. I suspect air currents are some of the cause of instability. Your overall approach is clever and effective, I was just pointing out some of the things that jumped out at me as possible sources of error.

      @John-ro2yk@John-ro2yk Жыл бұрын
    • @@John-ro2yk I’m actually in the middle of trying out a method of making a straight line with a fast spinning motor. See this test: kzhead.info/sun/nNR6d7CwkJhofok/bejne.html Not 100% sure this will give me the results I'm looking for, but sofar looking promising. Using a computer hard drive motor because the runout is low. All things inherent to a motor setup like this like vibration, surface imperfections, even the runout all get averaged and blurred out because it’s in constant motion. A blurry line with no change is what I'm looking for. The gyroscopic effects of the motor spinning also self stabilize it from any wobble effects too. I need to do much more polishing on the motor’s cylinder as you can tell from the reflected light. Alignment of the laser to the cylinder is critical but can be done accurately using 3 points on a sufficiently big enough line using the same methods of taking 3 points on a 1d line. Keeping track of the error/offset of the middle point. Those 3 point references can then be used to calibrate the alignment of the laser to the cylinder by adjusting till the arc curve is removed. WIth the lowest powered objectives on my microscope 4x and 10x, here is what that reflector surface looks like kzhead.info/sun/pLmjcbqNmHuCnoE/bejne.html at those optics I couldn’t see any machine marks, or any artifacts for that matter. I’m guessing the tip is turned and maybe cut with a diamond tip to get such an optical quality finish. I’m not sure how they make these things so precise. I couldn’t use any higher objective lens due to not being able to illuminate something that close. Even if I could, the DOF would be too great to make sense of things. Using a scanning electron microscope would be a better tool for checking the surface finish of this. The laser diode is a whole other story, the emitted raw dot is not a dot at all and more of the shape of a cat's eye iris. This will probably be the source of error on the projected line due to it being magnified more as it goes out.

      @BryanHoward@BryanHoward Жыл бұрын
    • @@BryanHoward Fyi, an autocollimator is the standard tool for this. You measure change in angle while stepping the target mirror along the surface you're measuring, then use trig to calculate the profile. The target mirror sits on a base with 3 feet, so you're getting the change in height of one end of the base with each measurement / calculation. It's similar to what you're doing just with an extra step of math. My autocollimator setup has about 0.02 microns of height resolution. I think the downside of using an autocollimator versus what you're doing is that error accumulates with the autocollimator as you move the mirror since each segment of the profile you're measuring is dependent on the previous segment. You can also use a laser interferometer with a dual beam path setup along with the same angle measurement technique to get the profile of a surface. That's possibly cheaper these days if you can't find a cheap used autocollimator. That might all be overkill for what you're doing though. Anyway, cool project! Thanks for making a video about it.

      @JohnSheerin@JohnSheerin Жыл бұрын
    • @@JohnSheerin With the autocollimator you basically have to check your measurements twice or more. Compare the profiles and if they don’t line up the data is invalid and you have to start over. The more samples also more acclimated drift. I like this method with the webcam sensor because the samples are direct and are not dependent on previous samples. Also comparatively cheap due to the cost of a quality autocollimator vs a $15 webcam and laser. If I ever got an autocollimator to play around with it’d be nice to compare the 2 methods, Having an autocollimator would be a very nice tool to have.

      @BryanHoward@BryanHoward Жыл бұрын
  • Very interesting. I've seen commercial equipment like this but it is prohibitively expensive. If you made a nice 3D printed enclosure for the camera part, with a cover to protect the sensor, you'd have basically the same thing for almost nothing. Thanks for sharing this and also working on the software. Looking forward to seeing how flat you can get it and how the grouting goes.

    @gizmobowen@gizmobowen Жыл бұрын
    • Yup, I would have printed some protection but don’t have any black filament on hand. I also need to make a hat for the 360 laser to act like a big barn door and only allow a sliver of a couple degrees of beam to come out. Would make it safer and be around and cut down on reflective noise on the sensor. There are lots that can be improved on the laser side. I’ve thought about taking the motor out of a 2.5” hard drive and putting a mirror on a 45 degree angle. Those motors have zero slop in them. Stick that in the line of the beam and you can get a near perfect 360 planer beam. Would be useful for aligning 2d surfaces like 2 Y axes to each other or other things.

      @BryanHoward@BryanHoward Жыл бұрын
    • Agree.

      @eduardodiaz5459@eduardodiaz5459 Жыл бұрын
    • I made one. With some features to remove any rotation of the base as flatness changes. Thinking about the best place to share the cad

      @daynosdr@daynosdr Жыл бұрын
    • @@daynosdr grabcad.com/ is a pretty good place for this kinda stuff

      @BryanHoward@BryanHoward Жыл бұрын
  • Dude, freaking sick! I love this

    @cylosgarage@cylosgarage Жыл бұрын
  • This is such a great idea! Thank you!

    @mlefe09@mlefe09 Жыл бұрын
  • I have a laser pointer mounted on my QCTP right now because I was musing on how to measure my way deflection. I'm really glad I found your video, you've got most the leg work done already!

    @dw0r@dw0r10 ай бұрын
  • Really awesome stuff !

    @RoboCNCnl@RoboCNCnl6 ай бұрын
  • Simple but effective technique, I like it!

    @cncrouterinfo@cncrouterinfo Жыл бұрын
  • Interesting method, thanks for sharing!

    @huaweiphone4357@huaweiphone43577 ай бұрын
  • Awesome project /work

    @dennisw7731@dennisw7731 Жыл бұрын
  • Woaw thank you for sharing!

    @felixdostie9024@felixdostie9024 Жыл бұрын
  • This is absolutely brilliant! I was looking for a solution like that while building my CNC machine but haven't gotten far. I will definately try this method on the next build. Thanks!

    @CHIPLOAD@CHIPLOAD Жыл бұрын
    • At least, you have a perfect surface!! Great lathe, by the way))

      @TheDIMONART@TheDIMONART Жыл бұрын
  • Wow, learn something new from smart people everyday. Another item mentally cataloged for a future project. Thanks for sharing!

    @kwaaaa@kwaaaa Жыл бұрын
  • Brilliant!

    @DotaBillfuc@DotaBillfuc Жыл бұрын
  • This is beautiful, thanks for sharing.

    @capcloud@capcloud Жыл бұрын
    • Thank you! Cheers!

      @BryanHoward@BryanHoward Жыл бұрын
  • This is really interesting. I had a similar idea but thought the laser would have had a too coarse beam so I skipped to give it a try. Your test proof that it could be accurate indeed. Great job.

    @AccidentalScience@AccidentalScience Жыл бұрын
    • Yeah as long as all the beam lands on the sensor, the center of it can be calculated to a high degree of accuracy.

      @BryanHoward@BryanHoward Жыл бұрын
    • @@BryanHoward that would have been greatly helpful in checking the ways of my diy lathe. I regret not having tried it. I think you would need some sort of collimator though, it would prevent the possibility of orthogonal errors. As it is now there's nothing that discriminates on reading a tilt in place of a variation in height. With a collimator, or better an auto-collimator in this case, the tilt is excluded allowing the measurement of the variation in height only ...I think.

      @AccidentalScience@AccidentalScience Жыл бұрын
  • Ohh, genius stuff! It got me an idea to solve a similar levelling problem I’m having! Thank you so much for sharing it! 🙏🏼

    @EnricoGolfettoMasella@EnricoGolfettoMasella Жыл бұрын
    • You're very welcome!

      @BryanHoward@BryanHoward Жыл бұрын
  • Very cool! Do you think you can increase the precision by tilting the sensor at an angle, so that the same number of pixels covers a smaller distance? 60 degrees off vertical could hypothetically cut your step length in half, at the cost of half your range. Maybe also try passing the beam through a slit to clean it up a bit.

    @bridgetshepherd5202@bridgetshepherd5202 Жыл бұрын
    • I've been working on a new laser setup and shining it through two razor blades to clean it up after it comes out of the diode. Lowering the height of the sensor closer to the surface helps with the minute error due to slope.

      @BryanHoward@BryanHoward Жыл бұрын
    • @@BryanHoward oh, I meant you could tilt the sensor *intentionally* to get better resolution. If the same 3um covers two pixels instead of one, you could get more precise measurements. Also it just occurred to me, if you put the sensor on three points instead if a block, you could possibly avoid the work of flattening the bottom surface.

      @bridgetshepherd5202@bridgetshepherd5202 Жыл бұрын
    • I was about to say the opposite! I think the beam would refract in the protective glass over the sensor if at an angle.

      @larrybud@larrybud Жыл бұрын
  • Very clever! I love this. It's probably already been discussed, but would it make any sense to use a laser pointer placed on a dampened pad? That could give you both X axis and rotational position (Z-axis?) simultaneously.

    @seanbosse@seanbosse Жыл бұрын
  • Fantastic video. Thank you for sharing this great new tool

    @seanmcdonald656@seanmcdonald656 Жыл бұрын
    • Glad you liked it!

      @BryanHoward@BryanHoward Жыл бұрын
  • Looks interesting. I noted that you touched the metal plates of the sensor each time which could transfer enough heat into them to introduce some error into your measurements. Perhaps some kind of 3d printed handle or enclosure or similar you can use to hold it instead?

    @ashort01@ashort01 Жыл бұрын
    • It would for sure. Temperature is playing a big factor in getting down to 1um. Everything has to be running warmed up for a while and the environment can’t be changing temps. I find it pretty cool that this setup of the absolute cheapest repurposed things can measure to a resolution that the temperature becomes one of the main sources of error. After making the video, even though I let the webcam sensor warm up for a good while, I didn’t think about the temperature inside of the garage. It's winter and the garage is insulated but cold. I didn’t have the heater on, but just by being in the garage for an hour I would have been warming up everything. Next time I run this when I fix the laser wobble, I’ll warm up the garage for an hour so the measurements don’t keep on drifting by ~1um/second

      @BryanHoward@BryanHoward Жыл бұрын
  • Would like to mention, everything needs to be in a controlled and known manner for which the part that is being measured. For which the part (linear beam) it sits on needs to be known as flat as possible, else if the part moves in the future, it's flatness would change. This is a great way to measure flatness and scrape it flat without expensive tools. I guess adding some feets that can be adjusted might allow it to hold it's intended flatness. Whatever the part is resting on should be super flat, this is because if it is not, any twist or bow would be applied to the part and after scraping or moving the part it will mess with the results. Thanks for sharing this demonstration and explaining it.

    @sto2779@sto277910 ай бұрын
  • Very cool! I can already imagine using this idea for true-ing a cnc frame. A couple of ideas: * 3d print a mount for the laser on one end of the tube & lock the laser at level so it doesn't keep self-leveling * automate the capture bt enclosing the sensor between two small boards for the entire length of the tube, then hook a string to the sensor and pull it with a small stepper or servo for predetermined amounts of distance and then have the software record at each stop. Loved the idea of fixing the deformations with screws and cementing in place with the filler. Of course that works better for low spots, unless you pull those spots down from a bottom bolt.

    @KarlMiller@KarlMiller Жыл бұрын
    • haha automating the process is a bit too much :D your hands won't fall off :D

      @chronokoks@chronokoks Жыл бұрын
    • @@chronokoks the issue I would address is not about the effort, but improving the granularity and determinism of the process.

      @KarlMiller@KarlMiller Жыл бұрын
    • @@KarlMiller check out my comment above, some similar ideas. And yes, truing a CNC frame was exactly one of the use cases on my mind.

      @keithwins@keithwins Жыл бұрын
  • Wow, Bryan, just came across this and had to subscribe. Thanks for the video and the files - I am definitely going to give it a try in the near future. Thanks for sharing

    @terencem9962@terencem9962 Жыл бұрын
    • I'm trying out a new idea for an improved laser line emitter that should in theory make a better line. I'll make an update on this once it's further along.

      @BryanHoward@BryanHoward Жыл бұрын
    • @@BryanHoward Awesome!

      @terencem9962@terencem9962 Жыл бұрын
  • Interesting idea. I think maybe a laser pointer might be a better line source. Is the warmup thermal distortion of the laser level casing? Your concrete fill will also distort your tube so you might want to revisit this exercise when you've got a more-or-less completed beam.

    @AndyRRR0791@AndyRRR0791 Жыл бұрын
  • This is awesome. There are lots of things addressed in the comments as well. What does it matter that it's not an autocollimator? It could be made to serve as one with a little work and a few more dollars. Seeems like one could cobble something together with some mirrors and a precision ground level vial and end up with something that could rival a very costly, high resolution level as well.

    @nodriveknowitall702@nodriveknowitall7029 ай бұрын
  • Way cool! Thanks for sharing.

    @randomrouting@randomrouting Жыл бұрын
    • Thanks for watching!

      @BryanHoward@BryanHoward Жыл бұрын
  • You're a pretty smart dude!

    @Chris-oj7ro@Chris-oj7ro Жыл бұрын
  • Damnnn....you blew my mind like a volcano

    @sourabhkumawat4863@sourabhkumawat4863 Жыл бұрын
  • That is surprisingly accurate. You could make this wireless and mount it on a toolholder. That way you could measure the flatness of your axes as built and apply corrections to the gcode. 3D printers do "auto levelling" but I think it's actually auto tramming where it measures the print surface and then compensates for error in the flatness of the bed by adjusting the z height. A sloppy build could be compensated to the accuracy of your measuring system.

    @senorjp21@senorjp21 Жыл бұрын
    • I'd bet you could mount a raspberry pi zero in the same footprint as the camera and then use a tiny OLED and a few buttons to make it a standalone unit, could even have it serve the whole gui as a webpage for more detail

      @JackieBright@JackieBright Жыл бұрын
    • I've thought about this early on in the making of the tool. Thinking about automating parts of the process into linuxCNC. You couldn't really on the z axis to place the sensor onto the surface but could make it spring loaded so it's pressed down. Similar to how you would do it when attaching a pen to a CNC and have consistent down force. Sending the whole sensor feed wireless is problematic. Using a raspberry Pi to process some of the data like turning the 2d image into the 1d luminosity array would significantly reduced the bandwidth where wireless would be feasible for real-time stream. The sensor image feed is no longer needed but could be sent in a highly compressed form and wouldn't compromise the data.

      @BryanHoward@BryanHoward Жыл бұрын
    • I haven't tested it but the whole tool might run without much performance issues on a pi4 an long as PySide6 including the media modules are compatible with it. The tool is an Python so someone will probably try it.

      @BryanHoward@BryanHoward Жыл бұрын
  • wow thanks i will use this for my cnc build

    @misamokuzelpizu@misamokuzelpizu Жыл бұрын
    • Yeah best time to use it. Even though there's more technical challenges using a set of such as this, it's far cheaper than the large surface plate or a long reference surface.

      @BryanHoward@BryanHoward Жыл бұрын
  • This is what everybody in machining from PROs to diy cnc amateurs have been waiting for. Interferometers (Renishaw) with which you can measure all kinds of parameters in machine geometry have been insanely expensive - so are digital or analog precision levels (not talking about typical machinist levels) . I already see tens of ways this can be improved and add things like measuring perpendicularity and etc - or even measuring relative deviations in 2 axes (you can measure if your axis moves in a straight line). Oh my god this is godsend. Share this video guys to everybody you know.

    @chronokoks@chronokoks Жыл бұрын
    • I think with a split beam reflector there could be some pretty interesting measurement devices made for the cheap. I haven't got one currently but might look at this stuff in the future. Electronics and software is solved thing for many of these applications in DIY instruments. The cost of hardware is also coming down and a lot of these devices can be conceivably made very well in a DIY manner using such things as 3D printers and other DIY friendly manufacturing methods.

      @BryanHoward@BryanHoward Жыл бұрын
  • That's super cool! Serious question though: since your measuring on the micron level, would plastic deformation and creep effect the measurements over time due to the 3d printed plastic mount your using for the Webcam sensor?

    @bluegizmo1983@bluegizmo1983 Жыл бұрын
    • The 3d printed plastic part should work well with thermal expansion when touching it. Better to pick it up from there and not the metal base. I’ve got the white part made in PETG. PLA might be better because it is more rigid than PETG. I’m not sure about the thermal expansion of both though. The main thing is to keep everything at the same temperature once it’s all warmed up including the room at a constant temp. This becomes more of a factor depending on Key factors to get good results is to not have any vibration on the laser. Using a green point laser clamped in a small vice should help greatly with vibrations. After that keep on taking measurements of the same point till you find the the center point stops drifting in one direction or another.

      @BryanHoward@BryanHoward Жыл бұрын
  • This is cool! I don't even have a need for this but now I am think maybe I should.

    @Luke-Barrett@Luke-Barrett Жыл бұрын
    • One step closer to experiencing true level kzhead.info/sun/mbWogsqhnIyAq4E/bejne.html

      @BryanHoward@BryanHoward Жыл бұрын
  • Very inventive and smart use of cheap technology! Measuring flatness from a non-flat surface must take a lot of patience and throw a lot of doubt on the whole process at times! The moving metal base alone probably causes a lot of repeatability error and tail-chasing!

    @Bob_Adkins@Bob_Adkins Жыл бұрын
    • Well the trouble of going to this is because I found cutting metal on the CNC machine and you want things to fit, will, metal isn't going to bend like wood will to make it fit.

      @BryanHoward@BryanHoward Жыл бұрын
  • something...is bugging me about this setup...I worked on some quite precise stuff about 30 years ago...with cameras, sub-pixel software, et al...my head's a bit fuzzy today, will try to think about this a bit more...great basic plan!

    @lohikarhu734@lohikarhu734 Жыл бұрын
  • Great Idea and well explained, I really like it.

    @MetalWorkerTools@MetalWorkerTools Жыл бұрын
    • Thank you very much!

      @BryanHoward@BryanHoward Жыл бұрын
  • Nice I have a newborn as well and it's a deal alright. God bless and keep having them.

    @brothertyler@brothertyler Жыл бұрын
    • My second one. I wish they gave me an instruction manual the first time around.

      @BryanHoward@BryanHoward Жыл бұрын
  • Very cool. You could use a green laser line module. They draw a laser Line with lenses and won’t suffer the wiggle your spinning laser has. It also has adjustments in the lens to make the laser beam smaller or wider widths.

    @justtesting555@justtesting555 Жыл бұрын
    • There is no guarantee that the laser line lens is accurate, however. Though this might not matter too much unless you're measuring a 2D plane. Note that the wobbling is due to the laser using a pendulum system to obtain a level line, and not due to something spinning. These laser levels generally use a lens or conical mirror to generate the line.

      @JMMC1005@JMMC1005 Жыл бұрын
    • These 360 degree lasers actually produced the line by reflecting it off a conical mirror pointing at it. I looked at one I took off the laser level under the microscope and they are very well made. Optical quality, no machine masks. I presume most of the inaccuracies of these laser levels are because of the laser diode itself. The dot coming out of the diode is usually an oval for the shape of a cat's eye Iris in the case of the one I took off. Here's a video of what it looks like kzhead.info/sun/pLmjcbqNmHuCnoE/bejne.html

      @BryanHoward@BryanHoward Жыл бұрын
  • Glad I googled this. Been thinking of figuring out how to build this exact thing myself so thanks for the video. One thing I've been thinking about but not sure if its right or not would be for x,y measurements. Say If say the laser set off the corner of 0,0 then you used (0, 0), (x_max, 0), (0, y_max) and (x_max, y_max) as reference points did all your measurements then flipped the laser over 180 and did it all again and used that somehow to correct for errors in the line of the laser would that work? Thinking more along the lines of cheap laser pointer with a line lens rather than a 360 laser level

    @riley8824@riley882410 ай бұрын
  • Really interesting method. It’s great to see these ideas shared. Thanks. Will you adapt this idea when you are looking to get the beams level with each other

    @davidaustin967@davidaustin967 Жыл бұрын
    • On the next laser setup I'm doing I should have the beam straightness solved. Then sampling 2D points is possible and I could then use it as an actual levels or at least a relative level of getting for instance to Y axis rails planner to each other.

      @BryanHoward@BryanHoward Жыл бұрын
  • First thing I think about... If we talking about um mesurements - I'm afraid we can get distortion even from the camera's cable that stuked on 6:15, pulled the plastic printed flange of the cam and bend itself making the cam to bow to the laser. I think (not sure, just thinking...) may be mount bracket sould be more rigid. I'm not try to getting bored 🙂 You made cool video (and tool), I'm just going to face with the same task and your solution is inspiring. I believe it will very helpful! Thank you!

    @jcco1973@jcco19734 ай бұрын
  • Silly question and it may have been covered, if you tilted the sensor ( not the base because that should be flat) and measured the detection across the vertically tilted pixel set you would get a scale where you can verify in a different way, would you lose your mean but you may be able to get a more refined value, you would have to calibrate but would be interesting. Great solution

    @paulfblackburn@paulfblackburn Жыл бұрын
  • How did you align the taper with laser level , didn't understand , highly skilled , and can you sharpen the labor beam

    @sheetalamanji9509@sheetalamanji9509 Жыл бұрын
  • Congrats on your nice new seismometer ;-)

    @RogerBarraud@RogerBarraud Жыл бұрын
    • With the self-leveling laser works pretty damn good at that. Could be the basis of a home alarm system too as it detects anybody moving in the house.

      @BryanHoward@BryanHoward Жыл бұрын
  • Super cool and clever! A couple ideas: -sample only a band of pixel in the center, should clean up the peaks even more -looked like maybe the sensor was clipping when it was closer to the laser? -since you're only doing a 1D line measurement, could you use just a laser pointer? I suppose it would be a bit of a pain to get the horizontal alignment, but maybe not too terrible? -wonder if there's some kind of diverging lens you could put in front of the sensor that can spread the beam vertically to improve the resolution... (not that this particular gantry needs that kind of resolution) -it would make things much more complicated, but to adapt this idea to a finer resolution between sampling locations: a 3-footed base with a telescoping single-point mount for the sensor could give a whole lot more practical sampling for cases where more localized flatness is more important?

    @MikeyAntonakakis@MikeyAntonakakis Жыл бұрын
    • Yeah the clipping becomes an issue if it's large enough. If it's small then smoothing the array of data helps around at the peak getting the algorithm to find the center of the gaussian distribution a better time. Using a laser pointer also works, no you don't get to use all of the width of the sensor because you need to keep the dot from clipping off the sensor. You effectively have less data to average but it still works decently well. When I did this method I mostly used the line level like a laser pointer but just wide enough so the line goes off the sides. Blocking the beam from close to the laser emitter also helps get everything collinear. The original Java tool had a few options on what part of the data set it's trying to find a maximum of the peak. When I have some time I'm going to go through all the other options and also see what is also available in scipy to do the same thing. It's possible some of the noise can be cleaned up this way. The size of the laser beam on the sensor in ratio to the size of the sensor needs to be balanced for the maximum in minimum deviation you want the tool to find. A lens making the beam larger should get you more accuracy due to the fact you just using more pixels on the sensor. On an extreme setup you can use a full frame 35 mm sensor and expand the beam up to 80 or so percent of the size of the sensor if you know you're going to have very small deviations on what you're measuring but want to be extremely accurate.

      @BryanHoward@BryanHoward Жыл бұрын
  • Nice work. fun to see how sensitive. wonder if a simple lazar pencil could work. let the beam shine through a slit in a card beyond and level the beam on the wall - cutting out the bounce may be the hard part.

    @davidgleatham9966@davidgleatham9966 Жыл бұрын
  • This is just lovely, but I wonder if you could have just used a point laser or a pointlaser with a line-lens on it to widen out the beam for the cmos sensor a bit. That way the shakiness would be much less and it would cost $1.

    @1kreature@1kreature Жыл бұрын
  • I would love to see a collaboration with you, ROBRENZ, and/or Oxtools. There is a common thread of clever and knowledgeable problem solving amongst the three of you. I would suspect that combining the particular specialties of each would result in some very interesting results. Perhaps there is a combination of economical components that could result in metrology devices for diverse applications far exceeding current options. There is definitely a niche for the gap in options between expensive professional equipment and hobby level equipment.

    @JM-iq8qc@JM-iq8qc Жыл бұрын
    • Those guys certainly have an edge on me when it comes to machining capabilities and I've learned a ton by watching their videos. There is a lot these types of problems that can be solved by hijacking hardware and electronics and hooking them up to a computer.

      @BryanHoward@BryanHoward Жыл бұрын
  • Fantastic idea and implementation. Which low-cost webcam(s) do you use for your 'sensor' ? Thanks for the inspiration and code work.

    @1moregarden@1moregarden Жыл бұрын
    • I've got a DIY method that seems to be working out still everything from scratch need a laser diode. So far it doesn't suffer from any problems of wobble or artifacts from the reflector. I'll make a video about it in the next week or so. I would hold out till then.

      @BryanHoward@BryanHoward Жыл бұрын
    • Thanks Bryan. Yes, I think a separate laser diode...perhaps with the 'line' output and a stable power supply may be ideal for the source. Looking forward to the next video !

      @1moregarden@1moregarden Жыл бұрын
  • Also you can use the same setup by using endpoint to either measure the pitch of the beam or adjust the beam to level by shimming or a fine thread machinist jack

    @kentswan3230@kentswan3230 Жыл бұрын
    • Yeah that works pretty good for finding the slope. I used some metal shims on one end so I could get the projected laser on the sensor at both ends. I’ve got a good master precision level that I’ve used to get parts of the machine in the same plane (like the 2 Y rails). If someone wanted to use the laser as a precise level in the same way there’d be a number of changes necessary. The laser beam will need to be static and not auto leveling (best to make a dedicated laser source without any moving parts). Some 3 point leg adjustment screws to adjust how level the laser beam is. The laser would have to be resting on a surface plate that has been calibrated with a master precision level. Then finally measuring some sample points with the webcam sensor on another flat reference surface from varying distances to calculate the theoretical fitted line and adjust the laser angle till the regression line in software is zero. Then you’ll know that the beam coming out is perfectly flat and you can use it to measure how level something is. In probably 90% of the time it’d just be easier to use the master precision level in the first place but I guess if you had a situation where you needed to check how level something 50ft-100ft long in a lab environment is, This would work well because it wouldn’t be susceptible to localized displacement of the surface that would be throwing the results off. Instead you could get the average slope from end-to-end.

      @BryanHoward@BryanHoward Жыл бұрын
    • @@BryanHoward Since you don't have a surface plate and IF your machine master level is both long enough and has a verifiably flat base then a trick I've seen is using the level's base as a blued reference surface. Your laser measuring system will tell you where the high spots are and a blued base will mark those spots for scraping. Just an Idea.

      @kentswan3230@kentswan3230 Жыл бұрын
  • Agreed simple but effective. I would verify its characteristics by performing the same measurements on a reasonably sized surface plate.

    @kentswan3230@kentswan3230 Жыл бұрын
    • I’ve got one and once I fix the laser issues, I’ll be checking off of it. It’s 18” diagonal. Just large enough that I can have a laser on one end and the sensor on the other. 150lbs should help with any vibrations during testing too. It’s just annoying because I don’t have a proper stand for it built so it stays on the floor.

      @BryanHoward@BryanHoward Жыл бұрын
    • @@BryanHoward That's a reasonable approach. I'm interested in your use of common sensing equipment to achieve near laboratory-level accuracy. This approach will also come in handy when you're aligning the two rails for both matched levelness as well as (with a few more tricks) horizontal spacing of the rails and then aligning the whole machine. I've decided to follow your innovative approaches to achieving precision. Too bad you're not in a position to put on a way scraping machine or a machine-level surface grinder using these techniques to align the part to the way scraping/grinding machine but, with sweat, you'll probably achieve that level of precision.

      @kentswan3230@kentswan3230 Жыл бұрын
    • @@kentswan3230 Getting 2 rails aligned together is rather hard with this setup. It means having a better horizontal laser plane than the conical reflector can produce. This can probably be done by taking a highly precise hard drive motor from the smaller 2.5” drives and sticking a good quality mirror onto it. This should give a much better planer beam to get 2D samples and not just 1D samples like I’m doing.

      @BryanHoward@BryanHoward Жыл бұрын
    • @@BryanHoward You're right in that converting this 1d flatness technique to a 2d surface alignment requires some additional cogitating. Adding rail-to-rail parallelism and distance alignment further complicates the issue. Mmmm... You might need to look to think about how you might use your laser setup and imager along with prisms and mirrors simple stable mounts on your flattened rails. I'm reminded about the corner-to-opposite-corner equal string technique to test the squareness of a frame. Edmund Scientific is a useful resource in that regard with mostly acceptable but not cheap pricing. Once you know what you want to experiment with you can go to other sources but you'll have to use your own judgment as to the dependability of those suppliers. There are a number of reasonably priced optical components used with laser cutting devices that also might work in that regard.

      @kentswan3230@kentswan3230 Жыл бұрын
    • @@BryanHoward do you have the calibration protocol from the manufacturer of the surface plate? I've lost mine but have a photo of it :D Thank god

      @chronokoks@chronokoks Жыл бұрын
  • Brian, very interesting, always thought about something similar to calibrate a surface plate but my math and coding skills were not up to the task. Current they use autocollimators or electronic levels to do this, don't have access to either. What OS does the code run on? Thanks for the video. Craig

    @craigs5212@craigs5212 Жыл бұрын
    • This is written in pure Python so it’ll run on any OS. I have a binary build for Windows to greatly simplify running the app (download the exe and run). BUT it’s very likely that your windows computer will think its a virus due to false positives. You can read in greater detail a reply in the Issues tab on Github for the repo. It runs slightly faster as a binary vs Python, otherwise it’s the same.

      @BryanHoward@BryanHoward Жыл бұрын
    • ​@@BryanHoward Is the windows binary on github? I thought i only saw the python sources...

      @jackbombeeck4958@jackbombeeck49583 ай бұрын
  • How did you get the gantry to be coplanar to the laser? This is well thought out and very interesting - thank you for sharing.

    @MM-24@MM-24 Жыл бұрын
    • I didn't have to, I just had to get the laser level enough so it's somewhat in the middle of the sensor at both ends of the beam. It gets corrected with linear regression so what you see in the end is as if the laser was perfectly aligned with the beam.

      @BryanHoward@BryanHoward Жыл бұрын
  • Did you do any image unwarping? Seems like the camera output has some pincushion warp applied. This could introduce bias towards the edges and screw up averaging across rows. Another thing to test for could be the effect of the bayer sensor layout. Maybe aggregating channels separately would be interesting to see if there is a shift between the images in red green or blue. Really cool idea!

    @deluksic@deluksic Жыл бұрын
    • Yeah there's clearly something going on with that I noticed it right away when I was first testing with the lens removed. I think it might be due to the physical shape of the individual pixel sensors picking up the laser from the sides. When I'm done with figuring out the laser line I'll go back to the webcam sensor and see if I can improve things. Maybe restricting the laser line down I'll pick tube so the individual pixel sensors don't see any light coming in from the sides. It's a really strange phenomenon because it looks like something you would come across with an optical lens.

      @BryanHoward@BryanHoward Жыл бұрын
    • @@BryanHoward I think camera manufacturers “undo” lens warping in software because webcams are simple single lens devices usually, with bad distortion.

      @deluksic@deluksic Жыл бұрын
  • Measuring flatness to micron level using inexpensive methods is very interesting❤ 👍. I also think the techniques could be useful in the production of holograms, that need absolutely zero vibrations along with precise alignment of laser paths before creation of the intereference pattern. Just some 💭

    @aware2action@aware2action11 ай бұрын
  • Thank you for sharing, something I couldn't get. How are you making sure that the gantry is leveled witht the ground and the laser is the same and the camera is exactly 90degree on its mount and the mount is as flat as It can get. To my understanding if any of this factors off it will effect the measurement because there is no flat known surface that is being measured against. Or I got it all wrong?

    @mogilogi1956@mogilogi1956 Жыл бұрын
    • With this method there are no assumptions that the laser or the surface being measured is level. We instead use linear regression which will fit a line to the points and return an error value which is the offset from that fitted line. It ends up being a clever and simple solution to that very problem. Seeing it visually might make better sense: data-science-blog.com/wp-content/uploads/2022/05/linear-regression-error-term.png The exact location in the code that does this is located here: github.com/bhowiebkr/laser-level-webcam/blob/003e17f78e2e9459275e03ede66185cf40a678a6/laser_level_tool/utils.py#L80-L98 Because the slope is constantly changing and averaging out with every new sample, we have to loop over all the samples to recalculate the regression line and the error/offset every time a new sample is added.

      @BryanHoward@BryanHoward Жыл бұрын
  • A readout on the sensor module would for most be the practical position. Reading data is knowledge but doing something with it is progress. Most times people are checking for planar correctness, they're adjusting at the point of reading.

    @mrrberger@mrrberger Жыл бұрын
  • I wonder how far away from the Galaxy you'd truely have to get to make a absoulte true level since gravity & magnetics can even affect laser beams? Would you need to go all the way to were voyager 1 or 2 are now? Heilo sphease or interstellar space or possibly farther ?

    @kevinerbs2778@kevinerbs2778 Жыл бұрын
  • i think this is an amazing tool. my approach for getting the rail straight however would focus a lot more on the assembled, final rail than the naked girder without the linear rail installed and torqued; get your girder preformed within +-25um (one thousandth), then get yourself some half-thou shim stock and a pair of scissors and get your linear rails on there. torque the thing down, get your numbers, cut your shim, reinstall, re-check. not sure how the epoxy setup is going to be worth the trouble when you can bolt down solid over brass or stainless.

    @Keechization@Keechization Жыл бұрын
  • Very good. To mitigate laser vibration you could try mounting the laser to a heavy item to give it more inertia. Might then put that on a damping material so that vibration can transmit to it.

    @benargee@benargee Жыл бұрын
    • That's a great suggestion.

      @geekoid183@geekoid1834 ай бұрын
  • Seeing as lasers can measure distances at micrometer accuracy as well if used correctly (if I remember you need a pulsed laser for it), you could even automate the process by mounting the laser on one lineair rail carriage, and the webcame with its sensor on the other carriage mounted to the same rail. All you need to do is tweak some lines of code so that it does both distance measurement and flatness measurement and plots both values to Excel, then plot that to a graph with distance on the X axis and deviation from flatness on the Y axis!

    @pieterveenders9793@pieterveenders97936 ай бұрын
  • Interesting setup. I was once thinking to make one but didn’t, because I thought it’s not going to be accurate enough. I’d need to take absolute measurements from my lathe, which is pretty difficult other ways. Now when someone else have made the job, I’ll try. I was worried there would be some systematic error because the beam is spreading and all rays are not coaxial in cheap lasers.

    @teropiispala2576@teropiispala2576 Жыл бұрын
    • The beam spreads out a little bit but that doesn’t matter because fitting the gaussian distribution finds the center regardless how wide it becomes. The laser side still needs work. When I get around to it, I’ll try this out with a powell lens as a line generator. The sensor size works great. I have some ideas on measuring the localized slope which might add a small bit of error if your surface is out by a lot (the closer the slope is to zero the less it matters) For the precision of measuring I need for my gantry, the laser level works totally fine. Even the wobble which accounts to most of the issues due to it moving +-10um up and down on the sensor gets reduced by a significant amount after multisampling. On a lathe, I’d look into directly working with a powell lens and no self leveling on the laser. This should greatly improve the laser side of things.

      @BryanHoward@BryanHoward Жыл бұрын
  • this is brilliant! you have won my sub and a thumbs up! what an awesome idea! I'm also making a CNC and was using green laser level and thought about something like this but would NEVER be able to actually implement! Good stuff. Would u be willing to share your program?

    @theGraphicAutist@theGraphicAutist2 ай бұрын
    • I have the code on github. See the description.

      @BryanHoward@BryanHoward2 ай бұрын
    • @@BryanHoward Ya I quickly realized that after I commented! like seconds after. those levels have vertical perpendicular lines too. How awesome would it be to have a system that almost automatically trues up all your axis' with either just shims or some kind of adjustments b4 tightening down?

      @theGraphicAutist@theGraphicAutist2 ай бұрын
  • Im wondering if its possible to sharpen the laser point. Also to remove the echo reflections.

    @MD_Builds@MD_Builds10 ай бұрын
  • Super interesting. Questions: How do you calibrate that thing? At one point, you will need to set "1 pixel = Xµm" in the software. Did you find those specs for a cheapo webcam? Or are those sensors always the same?

    @fabianluescher@fabianluescher Жыл бұрын
    • Image sensors come in many different sizes. The way I did this works decently well. If you don’t have the specs of the sensor itself you can do the following. Measure a repeatable length Of the whole circuit board with some decent calipers. Take a vertical top down photo with a camera you know that has low camera distortion or photograph a checkerboard so you can distort the image (especially with phone cameras they warp the image by a considerable amount). The photo should be zoomed in enough looking at the sensor that also includes the circuit board extremities you took the measurement on. With your corrected image, load it up into some CAD software like fusion360, freecad, Solidworks (which is what I use) and scale the image so the physical measurement you did correctly matches the units. Now you can measure the sensor much more accurately without the possibility of scratching and destroying the image sensor with metal calipers. You’ll want to be measuring the width of the sensor (eg on a 1920x1080 sized sensor you want to measure the 1920 side). In the tool where it says Sensor Width replace that value in millimeters with your value. The tool works on the full size of the image sensor without cropping so we take the sensor width and divide that by the number of pixels in width to determine the physical pixel size. In my case it’s around 3um

      @BryanHoward@BryanHoward Жыл бұрын
    • ​@@BryanHoward That makes sense! I'm wondering but as you have found out, the initial physical measurement seem to be enough for the desired precision. thanks for the explanation.

      @fabianluescher@fabianluescher Жыл бұрын
  • How about the Idea of using this tool, to level the machinehead "on the fly" while the machine is working?

    @petermeier4953@petermeier4953 Жыл бұрын
  • Thats awsome. I have a thought though if you can turn the auto leveling off you may be able to get a cleaner image . I'm not certain but just a thought you have also had me subscribe instantly

    @OutDoorsMan1342@OutDoorsMan1342 Жыл бұрын
    • Yes the self leveling laser is not that great it's better to use a dedicated laser diode and a line lens.

      @BryanHoward@BryanHoward Жыл бұрын
  • Welded the 2 tubes so they are conical??? Coaxial maybe.

    @dougaltolan3017@dougaltolan3017 Жыл бұрын
  • Does the laser spin a mirror to generate that line? Makes me wonder whether or not a periodic error, some kind of wobble, is being introduced at the motor through to the mirror, and hence the laser output. Would explain that vertical up and down movement. This is cool as hell. Can't wait to see updates.

    @dittilio@dittilio Жыл бұрын
    • Laser level works by a pendulum with some copper and magnets in the base to generate eddy currents to oppose movement. The reflector is a cone and the cone points directly at the laser directing its beam 360 degrees. I’m working on a new laser and took one of the laser-level laser diodes out. Here is the cone reflector under magnification. Its surface finish is really good. Much better than I thought it would be. kzhead.info/sun/pLmjcbqNmHuCnoE/bejne.html

      @BryanHoward@BryanHoward Жыл бұрын
  • Excuse me if this is just stupid: If the laser level autolevel is on, I would suggest locking it. Some of that noise may be the autolevel feedback and one ought to be able to autolevel it in situ and then lock it. Even if it's bumped a bit when doing that well you'll have a linear error in your data, that's way better than noise. It did seem apparent that the laser line was jittering so when that's sorted it'll be quite good.

    @giles5966@giles5966 Жыл бұрын
  • this is awesome, when is the Kickstarter 🙂

    @nickj2508@nickj2508 Жыл бұрын
    • No Kickstarter. All free open source. Start today there's nothing holding back.

      @BryanHoward@BryanHoward Жыл бұрын
  • Great setup. Maybe some of that movement from precession caused by imbalance in the mirror head or from sloppy bearings in your $C90 laser? Would a fixed laser and half cylinder lens work?

    @lennywintfeld924@lennywintfeld924 Жыл бұрын
    • I've disassembled the laser level and it's built decently well for what it is. There is a ring if neodymium magnets and a copper puck on the bottom. They did this in the hope to have the magnets produce eddy currents that would oppose any movement. I think it's a used bigger magnets and more copper it would have worked.

      @BryanHoward@BryanHoward Жыл бұрын
    • Fixed laser and cylindrical reflector is the way to go. Over the last week I've been building a new laser emitter from one of the green laser modules I will out of the level. I'm bouncing the laser off the motor of a hard drive while it's spinning and have been getting pretty good results. This method averages the full circumference of the cylinder multiple times as it spins. Also the gyroscopic effect of it keeps it from wobbling. The main issue I'm running into is polishing the surface good enough to bounce a laser off it and keep a consistent beam. I'll have a video of the progress of this in the next couple days.

      @BryanHoward@BryanHoward Жыл бұрын
  • This is great. I’ve been wanting to look at 2D PSD sensors for years but the cost is so high! This sounds like a great option… But I would need around 12mm x 12mm of sensor area. I wonder if a camera exists with that size. Great video! Thanks!

    @wez50@wez50 Жыл бұрын
    • DSLR cameras have big sensors. The full frame ones are 35mm on the diagonal. These cameras new cost a small fortune but you can find used ones that are 5-10 years old for next to nothing. The only thing you gotta watch out for is if they are cropping onto the centre of the sensor when recording video vs using the full sensor frame. Another option is to look at shutterless cameras. Taking the lens off should expose the sensor and you would not need to have to disassemble it destroying the camera. Must of them have a video feed out.

      @BryanHoward@BryanHoward Жыл бұрын
    • @@BryanHoward thanks for the pointers! I will research and see what I can pick up.

      @wez50@wez50 Жыл бұрын
  • Very interesting setup indeed. Does the setup rely on that the laser beam and the steel bar are both installed to horizontal level? Or is it just deviation from the straigth line what is considered?

    @htchtc203@htchtc203 Жыл бұрын
    • Because the software corrects for the slope using linear regression, the laser and/or the gantry don’t need to be very level to each other or the world. The laser needs to be level enough so that the line hits the sensor on both ends of what you are measuring. When the values are corrected with regression, the error from the regression becomes the deviation for that sample to the virtual line that gets fitted to all the sames. This whole setup can be used to measure how level something is but it involves first calibrating the laser to be level using a surface plate and a master precision level. You then either adjust the laser to be level or track it’s slope to than subtract from the surface being measured.

      @BryanHoward@BryanHoward Жыл бұрын
    • @@BryanHoward Tjanks. Quite much as I expected. This would be perfect solution for my needs of levelling a sawmill.

      @htchtc203@htchtc203 Жыл бұрын
    • @@htchtc203 This setup would work very well on big machines. If the sawmill is outside, I would set up during the day and run it at night. That way the sensor doesn’t pick up any ambient light from the sun. Could enclose the sensor in a black box too. Depending on the length you are measuring, changing the laser from a “laser level” style to a point laser would probably work better. The light intensity doesn’t fall off by the square.

      @BryanHoward@BryanHoward Жыл бұрын
  • This is really interesting, thanks so much for this. I wonder why you think all the bouncing around is in the laser and not in the beam which is resting on the same table as your computer so there's a fan contributing vibration, etc. Anyway this is super impressive, thanks so much

    @keithwins@keithwins Жыл бұрын
    • Yeah the whole setup still has vibration especially with the laser just hanging out there on stand it's going to vibrate with anything. At least with the motor spinning, I think that component won't have much issues with vibration the vibration that gets into it just blurs out the laser line and makes a little fatter. When I have a working laser line and a more finalized setup, I'll probably cast the hard drive base into a block of grout with a good amount of weight. That should help with vibrations and then I can also put some rubber feet on the bottom of it to help isolate it from external vibrations.

      @BryanHoward@BryanHoward Жыл бұрын
    • ​@@BryanHoward So I just bought two crosshair laser modules, set me back a whopping $8: Ideally I'll figure out how square the beams are to each other, or better yet someone reading this will know or check. The real value/beauty of this approach isn't so much the "level" aspect associated with the self-leveling laser IMO, but the _flat_ element associated with, well, light. If one can get that PLUS perpendicularity... oh there's a lot of things that become possible. I don't so much want (in the short term) to do an analysis of flatness, I want to be able to put a sensor somewhere and know how far out of flat it is wrt another point or set of points, for purposes of shimming/adjustment in real-time (I think this is what you really want also). as an aside, I would try to put the detector as close to the surface as possible to reduce the accumulation of errors in the mounting, but that will be application-specific. One can imagine this approach used in real-time to control tool movement. This echoes a project I worked on 40 years ago involving diffraction patterns for 3d spatial location (not my project: I was a near-clueless grunt). The thing I love about it is the simple/cheap hardware. I wonder if one would want to throttle/filter/limit the laser to help avoid sensor overload/burnout: I suppose the crosshairs are already smearing the photons around a lot, maybe it's not an issue. Perhaps frequency would be the bigger issue there. I think mounting the laser crosshair in some little jig that allows easy (magnetic?) mounting and precise 3 rotational axes adjustment (not sure if I really need 3 translational axes: application specific.) would migrate this from experiment towards working tool. Wow, this just collided with another back-burner project of mine. Unfortunately both are like 20 projects down the list, and I only work on 19 projects at a time. And nothing ever gets finished. This is some inspiring stuff here, thanks so much for documenting/sharing it. I'm easy to find online if anyone wants to talk more extensively about this. As another aside: even if the perpendicularity were poor (I'm guessing it's pretty good), the crossing point provides an index that might be used for all kinds of magic. I'm thinking the translational axes are more important than I first thought.

      @keithwins@keithwins Жыл бұрын
  • Awesome job. I think you'll have a job using your screw method to aim for flatness as the screws will not move each spot independently. Each screw will have an effect on the whole piece. Maybe better to leave it in a relaxed state and scrape/abrade each spot on it's own. Once you've got a good average flatness, you can also use the linear rail to spot for contact. Good surface contact helps rigidity.

    @lawmate@lawmate Жыл бұрын
    • Very likely and also filling in with grout is probably going to move things around as well as it solidifies. For doing the ground all I really care about is getting the really large deformations out of the beam. After the grout I'll do epoxy replication transfer method and then test and verify the flatness and scrape if necessary. If I can get 10 to 20 microns of flatness I'll be happy. No way I'll be able to get down to want to microns. Mostly pushing the resolution and accuracy of the system is for benefit of others that I want to try it. Currently right now I have no need to measure anything down to these levels but it's entirely doable with this method.

      @BryanHoward@BryanHoward Жыл бұрын
  • Interesting technique and clever software. I definitely think you're right to consider how planar the laser light really is or isn't with cheap lasers. I used a (very cheap) line laser a few years ago, and discovered it's last 'plane' was not planar, but conical, by quite a bit! Over short distances it wasn't very noticeable for what I was doing, but where the beam shot past what I was doing onto the wall about 8m away, the line was noticeably curved. Obviously at first I assumed it must be the wall which isn't flat. However, a bit of experimenting later (aligning it with a steel beam in the all which i could look along and see it was pretty straight) showed that the laser 'plane' wasn't anywhere near planar. Over about 10m, the smallest misalignment I could get the 'plane' to align with the beam was something like 100mm! Then turning the laser upside down, the closest I could get was about 100mm out in the opposite direction. It was a 'line lens' type rather than a rotary laser level. Could the red laser being less successful be due to the camera sensors being twice as sensitive to greens as reds, rather then infra red? If I remember right, don't webcam CCD's have twice as many green sensors as red or blue, to simulate the way our our eyes detect colour? It'll be interesting to see how it does or doesn't retain the shape once filled with grout. When measuring to microns, and filling the gap between the tubes with something heavy, the weight of the infill and how the tube is supported while it cures is bound to change the shape.

    @richardjones38@richardjones38 Жыл бұрын
    • All very good points. I wouldn't trust the import laser levels to produce a sufficiently flat line in order to do two dimensional point measurements. I'm so far limiting the setup just to be a one-dimensional straight line by having the axes to be measured to be in line with the laser so I'm just using the laser as you would a point laser. Working on a new laser emitter with some big changes to improve the line. I think I found a reliable way of making a very straight line with these cheap diode lasers. With a setup I should be able to do two-dimensional point measurements on a surface and get reliable results back. For the gantry I'm expecting it to move around a bunch when all the grout is filled into it. Gravity will have an effect and also curing will probably change it in some way while it dries. I'll go back over a second time and probably use epoxy replication method to make the final surface for the rails.

      @BryanHoward@BryanHoward Жыл бұрын
    • @@BryanHoward I searched for a sensibly priced proper optical rod lens to split the beam into an actual plane, rather than the wavy plastic line lens in my cheap diode lasers, but didn't find one. They were always insanely expensive. I bought a small helium neon laser which came up on eBay, hoping it's beam would be rounder than diode lasers, to use if I found a rod lens, but without knowing what its output power was. I only turned it on once, firing it out of the window in the middle of the night at a distant hill (probably not the best idea) to see how far the beam went. It was many times brighter than my cheap 3mW diode laser so I sold it on. Reluctantly because I'd wanted a laser as a kid, before diode lasers cost next to nothing, and having a 'proper' laser seemed cool. But ultimately it was dangerous, and of no use.

      @richardjones38@richardjones38 Жыл бұрын
    • @@richardjones38 Even this extracted green laser is ridiculously bright as a single beam. I have it current and voltage controlled so it’s just over the minimum power limit before it shuts off. I’m going to shoot the beam through 2 razors a couple inches away from the laser diode. It should cleanup and give me an initial clean line dot to work from. I don’t know much about lasers and haven't worked with them, their types, but it seems like the cheap laser diodes are getting more powerful these days. I’m seeing laser cutters commonly having 20w laser diodes in them now.

      @BryanHoward@BryanHoward Жыл бұрын
    • @@richardjones38 I’ve seen that very video and find it quite comical. I bet most of these consumer grade devices coming from china are using higher than rated class lasers. From the customer’s perspective in reviews, they’ll be quick to comment that this laser has a much brighter beam than the dewalt one. In reality it’s because the chinese one is largely unregulated while the dewalt ones are. The cheap laser cutter cnc’s that are out there all come with these “protective eyewear”. Some aren’t even the same color of glasses for the given wavelength. I’ve flashed myself the odd time with auto darkening TIG welding hoods and it hits you in your sole it’s so bright. I couldn’t imagine what a focused beam from a laser cutter would feel like.

      @BryanHoward@BryanHoward Жыл бұрын
    • @@BryanHoward It's not directly relevant to your laser measuring, but have you seen the video on laser microjet cutting, on a channel called ESSEL Engineering? The video is rather annoying as it's part in English, part in Hindi, but the technique is so clever. It uses a microscopic jet of water as a wave guide / 'fibre optic' to effectively keep the cutting laser beam focused over 100mm, and apparently achieve a kerf width of 20-80Nm. Apparently it's been around since the '90's, but I'd never heard of it before.

      @richardjones38@richardjones38 Жыл бұрын
  • Could you lean the sensor forward or backwards 45 degrees to effectively shrink the vertical measurement of the sensor size to further increase accuracy?

    @russtuff@russtuff Жыл бұрын
    • I'm not sure. It might work it might level artifacts. It will limit the maximum amount in height you can measure before the laser comes off the sensor. It might be better to just buy a bunch of different cheap USB cameras with different sized sensors.

      @BryanHoward@BryanHoward Жыл бұрын
  • Does the laser pose a risk to the sensor if left in place for too long? I do know with some camera sensors I've worked with, when subjected to a standard laser pointer; the sensor will end up with burned out spots.

    @BretBowlby@BretBowlby Жыл бұрын
    • The total power of such Lasers is 5-15mW, but they get distributed in all directions. The power that reaches the sensor with such a line laser is thus much lower than 1mW, and even this power is distributed over the whole size of the sensor. A laser pointer on the other hand can easily focus the whole 1mW on a very small spot on such a sensor. So the local power density is way lanrger than with a line laser.

      @Pidrittel@Pidrittel Жыл бұрын
  • Brilliant. You have to make a video of the python coding and GUI.

    @fe6646@fe6646 Жыл бұрын
    • I might do some stuff with python and Qt. This tool has pretty good documentation doc strings and all. Comments throughout the stuff that is less clear. See also my simple note editor too on GitHub. It's pyside6 with custom widgets to make a node editor.

      @BryanHoward@BryanHoward Жыл бұрын
  • Very interesting, actually Hamar lasers works like that, thuogh very expensive, I'l sujest to lock the self leveling and work out the slope removal with the software

    @lucascostanzo8368@lucascostanzo83683 ай бұрын
  • I was wondering the other day why is it that nobody had created a little cube sensor that you move around and place on the 4 corners of a table surface, and with the use of any self-level laser, it can help you level the surface with really good accuracy. No different that the grading lasers used in heavy construction where they bip when in line whit the laser, but more compact. This thought came as I wanted two level two table coplanar to each other. and now I come across this video which I may want to try. I guess I need to figure out basic Python skill to be able to run your program first. Thanks for sharing

    @jp8479@jp8479 Жыл бұрын
    • there are binaries available :)

      @chronokoks@chronokoks Жыл бұрын
  • Could you not use a laser pointer on a stand

    @gordr8024@gordr80246 күн бұрын
  • Do you plan on making adjustments to the software in order to process a visualise a 2D plane?

    @SSukljian@SSukljian Жыл бұрын
    • I do but haven’t had the time to do much coding lately. I also need to make some hardware for the laser level and webcam that I’ll do on the cnc machine. Also build an attachment to the spindle plate so I can do automated grid height measurements. I probably won’t touch the software for that for a couple months though.

      @BryanHoward@BryanHoward Жыл бұрын
  • I just bought a "Huepar" laser level from Amazon. I can't speak to the long-term durability yet. But the design of the tool is really impressive. Chinese manufacturers don't seem to skimp on features.

    @andybrice2711@andybrice2711 Жыл бұрын
  • To maintain the position of the block you could use a jig that would drop into the rail screw holes. 3d jig that goes around your block and into the two pins would improve the repeatability.

    @jt6802@jt6802 Жыл бұрын
    • I actually need to put bolts and all those holes so I can push the little spots up so I'll be measuring between holes.

      @BryanHoward@BryanHoward Жыл бұрын
    • @@BryanHoward Set scews below the surface may be more convenient? (won't get in the way of putting a level or straight edge) Or simply design the jig to fit around heads. Any jig should help your repeatability and simplify measurements. Have you considered how you will achieve straightness? There are several videos of using screws pressing against a small rod to dial in rail straightness using screw pressure against the rod. I'm in the middle of a router build with some similarities. (using cast iron table tops set into precision grout) I hope to be doing final grinds on the sides this week and pouring next week. I have had some problems with the sides (three cut cut up tables bolted and epoxied together) I temporarily mounted some 45mm rails so I can grind the 1500mm rail surfaces of each side on a small mill. After that, I will place the ground surfaces on a big surface plate for the upside down pour and hope the cure doesn't change the rail surfaces. You might want to consider something similar. Temporarily mount your rails to side of the beam and attach a grinder to your beam to grind in place. If you don't have a flat surface for your rails (lengthwise and side to side) you aren't going to get rigidity an micron resolution.

      @jt6802@jt6802 Жыл бұрын
  • Great Video, I have been looking for something like this for sometime now , can you please share the software? Thanks again

    @marianodiaz461@marianodiaz46111 ай бұрын
    • I did, see the description

      @BryanHoward@BryanHoward11 ай бұрын
    • @@BryanHoward thank you! In regarding to a higher polish in the aluminium, the only thing that may work is a glass cylinder glued into an aluminium nest, that will fit into the locating step on the rotating HDD Hub, I believe that from memory, these hubs have some tapped holes into it, you can silver the surface of the glass if you need more reflection.Hope that this helps

      @marianodiaz461@marianodiaz46111 ай бұрын
  • How much deflection does the cable drag cause? It might be random, but it looks like your flatness deviations fits with different levels of vertical strain on the cable. Having it wireless might be advantageous.

    @MrMartinSchou@MrMartinSchou Жыл бұрын
    • I'm not sure, I'll have to check that out with the cable. The multiple chunks of 1/4" steel add a good deal of weight to the sensor and is very bottom heavy. It might not have an impact at all but I'll have to look at that. Wireless might work but the raw stream data rates of the 1080p signal will probably bog it down. Speed is not critical but makes the multi sub sampling take much longer. Would probably be a by use case thing if wireless would be beneficial.

      @BryanHoward@BryanHoward Жыл бұрын
    • @@BryanHoward I don't think the bottom part is moving at all - as you say that's heavy. I'm more wondering if the flex is in the board part of things. It should be easy to check though, as you can take a spot measure and then move the cable to a different location and check again. It might also be easy enough to fix with some cable strain mounted to the metal.

      @MrMartinSchou@MrMartinSchou Жыл бұрын
  • gotta build a simple mag lev table for the laser to rest on to reduce the vibration from the house. youll still get vibration from the sensor on the work material but it might help a lil bit maybe?

    @seebuch93@seebuch93 Жыл бұрын
    • I’ve got a pretty cool improvement on the laser side of this setup that should fix a lot of the issues when using an off the shelf laser line generator.

      @BryanHoward@BryanHoward Жыл бұрын
  • Does the power cord throw it off at all? It looks kind of heavy compared to the webcam. If you support the weight of it or make it go out the back instead of off the side, does that affect the reading at all?

    @DFPercush@DFPercush Жыл бұрын
    • I'm probably going to go back again and check that area closely cuz it's really suspect why it's so low compared to the rest of the beam. It's at the end of the rail so maybe I bent it when I was messing around with the servos.

      @BryanHoward@BryanHoward Жыл бұрын
  • This is really cool. Does it need to be a rotating laser or would it be possible to use just a normal laser?

    @startoftext@startoftext Жыл бұрын
    • You can use a point laser and get similar results. A laser line just makes it easier and slightly better results due to using the full width of the sensor.

      @BryanHoward@BryanHoward Жыл бұрын
    • @@BryanHoward How much is involved in configuring this for different webcams. I assume the sensor dimensions and resolution make some difference. I am tempted to try this out. I only do wood working so this is over kill but its cheaper then an 8 foot long straight edge.

      @startoftext@startoftext Жыл бұрын
    • @@startoftext The best way to measure the sensor size on your camera is to take a photo of the whole electrical board of the webcam. Use calipers to measure the width or some other known reference length of the board (keep the calipers away from the sensor or else you’ll damage it). Load that photo up in a CAD program like fusion 360/ solidworks and determine the Width of the sensor by drawing a line over the photo. In the tool, the width of the sensor you input is in mm.

      @BryanHoward@BryanHoward Жыл бұрын
  • очень круто, спасибо!

    @EvgenMo1111@EvgenMo11112 ай бұрын
  • Instead of a floating laser shining onto I assume a spinning mirror, try a stationary laser shining through a wine glass stem. You dont want anything not locked down, even that laser gimbal. At least stuff some paper towel in it to keep that mechanism from swinging around( I do this with a red laser stud finder when I need a line that isnt horizontal). But this is cool! Im gonna have to dig out one of my old webcam guts and try this!

    @zombieregime@zombieregime Жыл бұрын
  • If your displays not clipping when your heart beats in linear mode, it's just not sensitive enough....lol If you havn't already, check out the flatness setups the guys use lapping granite ref surfaces using percision retroreflectors. Awesome job dude !

    @sparkyy0007@sparkyy0007 Жыл бұрын
    • Lol I swear when I was testing the tool in the house on a wood table I'm convinced it was picking up my heartbeat as I was on the couch. As a side use using a laser level in one corner of the room and having the webcam sensor and the other corner. Makes a very good burglar detector. It'll pick up any movement in a house.

      @BryanHoward@BryanHoward Жыл бұрын
  • So interesting when you stomped your feet the raw image wiggled. Is this because of the shutter scan ?

    @hommadi2001@hommadi2001 Жыл бұрын
    • The self leveling laser is highly sensitive to any vibration. Later in the video when I was doing it all by itself it was probably the neighbors heating HVAC system making a wobble as there was nowhere else in my house that would have been a source for vibration. Self leveling laser is great for testing all this because it gives you a reasonably flat line and at least the vibrations give you a unknown variable that you have to account for with multi-sampling and throwing it out liars in the data.

      @BryanHoward@BryanHoward Жыл бұрын
  • Maybe instead of a bouncy laser level...use a laser-pointer held securely in a fixture. It won't be 'level', but will be straight. You could just put your sensor at one end, then to the other extreme end, & use a screw adjuster to bring to the same distance off the laser. 🙂

    @videostarish@videostarish Жыл бұрын
  • Awesome what your doing - and the info on what came before. FYI Windows reports V0.3.2.exe has a virus detected.....

    @ianloy1854@ianloy1854 Жыл бұрын
    • I changed the releases page with more info. It's a false positive and I'm going to remove the pre compiled binaries on future releases due to there being no way to fix the false positive virus detection. I would suggest you run it as Python instead.

      @BryanHoward@BryanHoward Жыл бұрын
  • Just a thought but you mentioned using a laser pointer. Would you get a sharper response using a laser pointer shining over an edge then looking for the peak of the edge diffraction curve?

    @elanman608@elanman608 Жыл бұрын
    • I don't think it would make any beneficial difference. Fitting the gaussian curve works really well.

      @BryanHoward@BryanHoward Жыл бұрын
    • @@BryanHoward Sorry I think I miss spoke I was really thinking about your problems with beam stability since you will be dealing with 2 fixed points (the laser and the edge). The edge would also give you control of the horizontal plane of your reference. On the other hand. I have since watched your subsequent video and you mention shaping the beam with 2 razor blades depending on the number of wavelengths spacing you will get either a step function with ringing on the rising and falling edges(due to edge diffraction) or a single slit diffraction pattern. Though the single slit diffraction pattern closely approximates a Gaussian the width will be a function of distance from the aperture. I don't know if this will matter as I don't know how the software resolves for the the peak.

      @elanman608@elanman608 Жыл бұрын
  • I assume you have to characterise the camera sensor in the software - for it to know the pixel pitch? Random thought - I wonder if the camera's rolling shutter could add inaccuracies to the process. There's a new Raspberry Pi camera with a global shutter that, while lower resolution (640x480 I think), may give more stable measurements. I'm glad the mighty algorithm put this in my feed - and look forward to seeing where this is going.

    @dav1dsm1th@dav1dsm1th Жыл бұрын
    • Rotating the webcam sensor 90° solves the rolling shutter issues, the webcam sensor I'm using as square pixels. I wish KZhead algorithm will tell me beforehand they're going to push this video and I would have put more polish into it!

      @BryanHoward@BryanHoward Жыл бұрын
    • @@BryanHoward Cool. The spec says the new pi global shutter camera has square 3.45μm pixels (described as "large") so may have reduced resolution compared to the one you are using - but the higher frame rate could make sampling quicker - and the tighter control over exposure times, etc. may be useful. I've got to go take a look at your previous videos 🙂

      @dav1dsm1th@dav1dsm1th Жыл бұрын
KZhead