PDA

View Full Version : DIY Laser levelling using webcam and laser level



Pages : [1] 2

devmonkey
11-08-2019, 11:39 PM
Hi,

Update 26/8/2019
Software to experiment with can be downloaded from here:
https://github.com/betzuka/laserlevel/blob/master/builds/laser.zip?raw=true
Unzip and run (double click) the laser.bat file. You need to have java installed on your system.

The source code is available on github:
https://github.com/betzuka/laserlevel


I'm a long time follower of this group but this is my first post. I built a 1500x1500 steel and aluminium and servo driven gantry machine about 10 years ago. This machine has been badly rusted during a house rebuild (was stored in a tent!) and long story short I'm about to build a new one, that will be a separate thread.

The focus (no pun intended) of this thread is to explore using a very cheap webcam (~£15) and a laser level to achieve both accurate planar and line (straight) alignment.

I've been playing with some projects using cheap webcams for various measuring tools and other things they weren't designed for. In thinking of how to perform the various levelling operations my new machine build will need I looked at the laser line level and detector I used during my house build. This is a dewalt model (line generator lens, not rotary), works great for tiling and putting up shelves/lights and for building straight walls, however with the matching dewalt detector in high sensitivity mode it only resolves down to 0.5mm at best.

Anyway I figured a webcam and a bit of custom software could do better. I put together a very crude test using a usb webcam (actually a microscope but that isn't relevant). The webcam is placed in a box to shield it from stray light and a small window is cut in the end of the box. The window is 'glazed' with a bit of white paper to act as a screen. The webcam is focused on this screen.

The laser line is then fired at the screen. I wrote a quick and dirty program to grab the webcam frames and perform some image processing. In short this takes the sum of brightness across each row of the frame to plot the natural gaussian of the laser beam then uses some clever maths (not mine) to fit this gaussian. The mean of the gaussian is the centre of the beam with respect to the cmos sensor.

With the laser a few meters away (all though distance doesn't matter within reason) the tool can resolve height variations down to ~0.01mm (a piece of copy paper that is 0.08mm thick resolves to a height change of ~12 pixels of the cmos sensor). This could be increased by increasing the magnification of the sensor, currently I have it set quite low and this setup is extremely crude thrown together in a few minutes.

Anyway I thought I post some pics of the setup here to see if you guys thought it has any legs. It could be extended to read horizontal variations using the laser in vertical mode which could be used to lay rails straight for example. If I progress this the next step will be to build a solid metal housing for the image sensor (discarding the body of the webcam) then it can be clamped to things like hiwin carriages. I would then extend the software to take multiple samples say along each X axis and display the error from the plane so that this can be corrected. First use will be to get the table i'm going to weld the frame on into plane.

Cheers, Joe


26192
26193
26194
26195

Kitwn
12-08-2019, 12:51 PM
Your workshop is as neat and tidy as mine!
I'm all in favour of using your head to save your wallet, that's a really interesting project.

Kit

AndyGuid
12-08-2019, 03:02 PM
Here's an interesting thread that may provide useful input to, or even solve, part of the problem you're looking at :

http://www.mycncuk.com/threads/12534-Calculate-Error-from-uneven-rail-and-reference

cropwell
12-08-2019, 03:03 PM
I was just wondering (mentally wandering !) if you could get three mirrors on right-angle blocks, you could set up your rails to be co-planar by directing the laser back to the sensor at the same place.

devmonkey
12-08-2019, 05:14 PM
A little bit more experimentation, some good news and some irritation. Firstly I stripped the sensor out of the microscope and used it without a lens, to my surprise this works very well. Effectively we are using the cmos sensor as a very high density light detector, it seem undamaged with direct exposure to the laser beam. This also means I can repackage it in a nice compact unit.

26201

The new issue that has appeared having removed the optics entirely is that this Dewalt laser level is crudely modulating its beam. I presume this is some sort of vendor lock in mechanism so that if you buy a Dewalt detector it will only work with Dewalt laser, or maybe i'm being unfair and it is to discriminate the laser source from other light ;-) Anyway this screws up the rolling shutter on the cmos image sensor, you can see the banding in the left hand frame grab below, not present in the next frame.

26202

So either I need to detect and discard frames that contain this banding, open the laser level and disable the modulation or buy a laser line generator from amazon for a couple of quid, although this wouldn't be a self levelling pendulum, which will make setting it up more of a hassle. On the last point although the dewalt unit is self levelling this isn't useful as a repeatable (between measuring sessions) reference plane, it just means the reference plane generated between switching the laser on and off after the session is roughly (~0.3mm per meter) level with earth.

devmonkey
12-08-2019, 05:20 PM
I was just wondering (mentally wandering !) if you could get three mirrors on right-angle blocks, you could set up your rails to be co-planar by directing the laser back to the sensor at the same place.

I was thinking you'd put the laser on some fixed external support, e.g. a stack of bricks, and mounting the sensor on a hiwin block and plotting heights relative to the laser reference plane by sliding the block up and down the rail, then off the rail and onto the other rail. Best fit a plane to these 3D points and show the height error to each point, then shim and repeat. This is the same process you would use with a machinist level but possible more accurate.

devmonkey
12-08-2019, 06:20 PM
I've now fixed the problem with the dewalt modulation, quite elegantly I think. The modulation was interfering with the rolling shutter on the sensor. All cheap camera sensors employ a rolling shutter, what this means is unlike a real film camera or a DSLR that have global shutters, i.e. the entire frame is exposed simultaneously, a rolling shutter is simply the sensor allows each row to integrate (usually from when it was last read out) and then reads the pixel value for that row after the previous row. This means that each row of the image is exposed at a slightly different time leading to horizontal artifacts such as banding due to 50hz AC lighting, motion blur where an object moving horizontally across the camera may appear to have the bottom leading the top, or vica versa, or in the case of a Dewalt laser level the light source being annoyingly flickered on and off a banding of black lines that moves up the image frame to frame.

Since we are only interested in one dimension (height) the simple fix is to make this dimension perpendicular to the direction of the rolling shutter, i.e turn the sensor through 90 degrees! This has the added advantage given the aspect ratio of the sensor is wider than tall like your TV screen, in giving us more vertical resolution.

Now works like a dream, short video of me deflecting my desk which the sensor is sitting on with light finger pressure, maybe 0.1-0.2mm, watch the PC screen behind reacting. Note you can still see the banding from the modulation but this is now vertically aligned and traveling horizontally so doesn't interfere with our nice gaussian beam.

https://www.youtube.com/watch?v=n21xyH77PJ8

AndyUK
13-08-2019, 10:16 AM
Great little project, right up my street! You're making a good amount of progress in a short time as well!

I would have started with a simplistic full-width half-max of the profile, but Gaussian fitting is probably better and more noise tolerant (but as you say, more complex!).

I assume you're summing the image across the horizontal. r.e. rolling shutter, might be helpful to perform some frame averaging?

Out of interest, whats the cost of the laser? I can see it replacing a DTI and precision straight edge, and being very useful for performing the measurements in the same plane.

devmonkey
13-08-2019, 10:30 AM
Great little project, right up my street! You're making a good amount of progress in a short time as well!

I would have started with a simplistic full-width half-max of the profile, but Gaussian fitting is probably better and more noise tolerant (but as you say, more complex!).

I assume you're summing the image across the horizontal. r.e. rolling shutter, might be helpful to perform some frame averaging?

Out of interest, whats the cost of the laser? I can see it replacing a DTI and precision straight edge, and being very useful for performing the measurements in the same plane.

I think the laser cost about £100 but you can buy the same thing on amazon without the pendulum for £5 see here:
https://www.amazon.co.uk/Focusable-Laser-Module-650nm-3-5V/dp/B07PVPT44K/
Also they sell units like mine from non-brands for about £20-£30, would do extactly the same job.

Yes frame averaging would maybe help a bit although it is pretty stable. I could take a moving average of the gaussian beam centre to stop it wobbling too much as you slide it around, can do anything to the software really.

The major unknown at the moment is how straight the line from the line generator in the laser actually is, I expect it is pretty good over the 30 degrees or so we would need, I can't test this until I have the sensor mounted in a decent fixture. Any ideas how to test this without a precision straight edge would be much appreciated.

AndyUK
13-08-2019, 01:07 PM
To give you some background, I'm a physicist, and at work I use similar lasers on each wall of the room (ceiling, left wall, right wall, and back wall), all pointing to a single point in space at the middle of the room - part of the job is to ensure these lasers are accurate and are planar with one another.

Assuming the laser is meant to self level. I'd mount it at one end of my garage, with the CNC at the other end. I'd then get a long transparent flexible pipe, and mount one end infront of the laser. I'd then take the other end of the pipe to the other end of the garage past the machine.

Then, fill water into the pipe up to the level of the laser; the meniscus will be at the same height in the room on both ends; the laser should pass through both meniscuses. The deviation (or depth of the meniscus as an error measurement) and distance between the two points will tell you how accurate the laser is self levelling. By moving left to right this will show any 'twist' in the horizontal projection of the laser.

The 'straightness' of the laser isn't an issue - light travels in straight lines unless you're bending it with something in the middle ;) The laser will defocus with distance, but as you're looking at the centre of the profile I don't think its a problem.

Kitwn
13-08-2019, 01:39 PM
How satisfying to read a 21st century physicist suggesting the use of a technology which may have been used by the Egyptians when building the pyramids!
You don't have to use the latest technology, just use the appropriate technology. I've just remembered have a Black&Decker laser level somewhere, I must dig it out and see what I can do with it to check the accuracy of my own machine.

Kit

devmonkey
13-08-2019, 01:41 PM
Thanks Andy. Yes i know the laser light will travel straight, what I meant was the straightness of the line that is generated by the cylindrical lens that is presumably a function of how accurately machined the lens is? Is testing this what you meant by twist in the horizontal projection? How do you measure this at work, do you use a water level?

Before starting this laser project I did something similar with the image sensor focused on a clear tube that was part of a water level, although I could easily repeatably locate the bottom of the meniscus to around 0.01mm resolution I had a problem getting much measurement accuracy due to the meniscus 'sticking' to the glass tube due to capillary action so gave up.I only used a short u-bend setup, maybe this was the problem and having much more volume of water in the system would overcome this problem.

AndyUK
13-08-2019, 02:01 PM
How satisfying to read a 21st century physicist suggesting the use of a technology which may have been used by the Egyptians when building the pyramids!

Haha. When it works it works... :) I once had a trainee who looked very thoughtful when we showed them this method, and after about thirty seconds, came up with the question: "But how do we know the water is level?"


Thanks Andy. Yes i know the laser light will travel straight, what I meant was the straightness of the line that is generated by the cylindrical lens that is presumably a function of how accurately machined the lens is? Is testing this what you meant by twist in the horizontal projection? How do you measure this at work, do you use a water level?

Yes, this is what I mean by checking the horizontal by moving left and right. I was covering all bases with the later comment about light travelling in straight lines - you never know who you're talking to... ;)

Measuring absolute level is rarely done at work, because its more important the lasers are planar with one another than they're absolutely level as such, but this is how we do it when needed. The beauty of course is that the accuracy increases with distance, so its best used over distances over a couple of metres.

When we need absolute level in a slightly different situation, we use a large tank of water with a travelling probe. The probe has two wires, one longer than the other, that dip into the water and they measure the resistance between them. The probe moves from air down into water; when the second shorter wire touches the water's surface, the resistance decreases substantially. This is performed at three corners of the tank, from which the angle between the probe's movement mechanism and the water's surface in two directions can be ascertained.



Before starting this laser project I did something similar with the image sensor focused on a clear tube that was part of a water level, although I could easily repeatably locate the bottom of the meniscus to around 0.01mm resolution I had a problem getting much measurement accuracy due to the meniscus 'sticking' to the glass tube due to capillary action so gave up.I only used a short u-bend setup, maybe this was the problem and having much more volume of water in the system would overcome this problem.

Yep - hence my comment about the 'depth' of the meniscus being the error in the measurement. Try to use reasonably large diameter pipe, and a touch of washing up liquid in the water will reduce the surface tension.

devmonkey
13-08-2019, 02:50 PM
Ok so just talking about testing whether the line generator generates a straight line. Although the thing is self levelling it definitely wont be level wrt to earth within the resolution of the sensor and we don't really care about our axis being planar wrt earth, rather to each other.I understand you use the water level to check the work lasers are planar to earth but how do you check the projected lines are straight?

Would you suggest sampling the projected line against an earth reference (using a water level and a microscope) at a number of points then calculating a best fit line. Then take the error between points measured and this best fit line to determine straightness? How straight are the laser line generators your work with?


If I had a long precision edge I could just do the same thing with that, unfortunately I don't...


IDEA (EDIT)
Could be done in two stages with the current setup, first setting a rail to be straight wrt to the laser by sending the beam along the rail then using the now straight rail to check the line laser is straight with the laser positioned orthogonal to the rail.



Cheers.

AndyUK
13-08-2019, 03:14 PM
Ah, so you're worried about the wobble in the horizontal projection. The thing is, because of the way the laser leaves the slit, it's going to be quite smoothed out.

If you just swoop left to right with the pipe and it stays within the meniscus, you're laughing. A 4m projection distance and a 2mm meniscus means that you'd be within 0.05mm (back of the envelope..), which is on par with a ~£100 precision straight edge. To know if it's better than that, just increase the distance further and further - if you can extend it to 10m you're down to <0.03mm for example.

Sent from my SM-G950F using Tapatalk

devmonkey
13-08-2019, 03:29 PM
Ah, so you're worried about the wobble in the horizontal projection. The thing is, because of the way the laser leaves the slit, it's going to be quite smoothed out.

If you just swoop left to right with the pipe and it stays within the meniscus, you're laughing. A 4m projection distance and a 2mm meniscus means that you'd be within 0.05mm (back of the envelope..), which is on par with a ~£100 precision straight edge. To know if it's better than that, just increase the distance further and further - if you can extend it to 10m you're down to <0.03mm for example.

Sent from my SM-G950F using Tapatalk

Thanks for persevering with me Andy. This is what I mean imagine the laser line generator is aimed at a wall and we are looking at that wall:
26203
So given we know that the 'self levelling' laser is going not going to be perfectly level to earth, we want to check the error between the generated line (red) and a true straight line (blue) to determine how straight our generated line is.

These lasers generate lines by firing through a cylinder of glass mounted vertically in front of it, when the light leaves the curved surface it refracts in one dimension causing it to fan out, therefore projecting a horizontal line. The glass cylinder cannot be perfect so there must be some imperfection in this projection. Any idea how much before I bother trying to measure it?

Or am I missing some fundamental understanding and that the physics implies the line generated will always be perfectly straight?

AndyUK
13-08-2019, 05:13 PM
The more I think about it, the harder it becomes! I'm not sure there is a good way to measure it without a precision straight edge as reference.

Essentially, I don't think it's worth worrying about - I say this because of how that lens is working - if the laser was a single point source then each bit along the horizontal line comes from a different part of the lens, and you'd be right to worry about lens defects causing wobble - but the laser isn't a point source, it has some width. This means that the contribution to any position along the horizontal is an average of a few positions on the lens, so any minor defects are smoothed out. Furthermore, the signal you detect is an average of the laser speckle, which is interference at the detector from a lot of different path lengths.

Not convinced? Okay, what happens if you move the laser slightly and repeat the measurement? If there isn't any systematic variation in the laser, you should get the same result. So my advice is average a few measurements with your system after moving the laser a few times; the standard deviation will be a combination of all your errors, including the wobble in the profile.

Sent from my SM-G950F using Tapatalk

devmonkey
13-08-2019, 05:39 PM
Thanks Andy.

I guess if the lens was canted slightly so the beam was not hitting the cylindrical face at the lens normal you would get a bowed line, but this should be easy to spot and also probably not hugely important for aligning two rails in a plane if you positioned the laser inline with the mid point of the rails.

I will start building a proper mount for the sensor and share the software incase anyone else wants to experiment.

John McNamara
14-08-2019, 03:12 PM
Hi All

As some of you may know I am interested in using a stretched very fine .008" piano wire to determine straightness using a microscope.

I posted my thoughts through this post here on this site. http://www.mycncuk.com/threads/12534-Calculate-Error-from-uneven-rail-and-reference

Subsequent to those posts I found an excellent thesis written by Boris Borisov

"New optical sensing system applied to taut wire based straightness
measurement". Doctoral thesis, University of Huddersfield.

http://eprints.hud.ac.uk/id/eprint/24846/1/oborisovfinalthesis.pdf

I was quite surprised that the accuracy of high end industrial lasers was inferior to the optically sensed stretched wire method he developed over longer distances >2m. See the graph on page 28 of the thesis.

Even more surprising was the simple sensor he used, Omron EE-SX1096 and EE-SH3 photomicrosensors Cost about 2 dollars on ebay!

This is definitely something I want to try. The levels of accuracy he has achieved are outstanding; a few um.

Regards
John

devmonkey
14-08-2019, 05:51 PM
Hi All

As some of you may know I am interested in using a stretched very fine .008" piano wire to determine straightness using a microscope.


I want to try this too John.

As for the sensors, certainly the one i'm using, the resolution is simply amazing. This sensor that came from a £7 webcam from amazon has an active area ~2mm wide, this is 640 pixels, so ~3um pixel spacing. You can quite easily with the averaging achieve sub pixel accuracy. That thesis is excellent, looks like he averaged a few thousand frames.

I've decided to use this new sensor as it is easier to mount and seems to behave exactly the same with the laser as the one I was previously testing.
26225

It is out of one of these:
https://www.amazon.co.uk/gp/product/B01L1XAQAS/

John McNamara
15-08-2019, 09:29 AM
Hi Devmonkey

I have been discussing alignment with a good mate who is planning a very nice servo driven router, he may pop in here. We built an arduino driven device to sense a stretched wire buy mechanical contact. He did the electronics I did the mechanical s. Being driven by the arduino we were able to cycle it thousands of times. the attached dial indicator never varied by more than a couple of tenths 90% of the time. occasionally there was an error probably caused by a dirty contact. or maybe some mechanical stiction.

The software looked for a break of contact. First finding the wire on contact then slowly moving away.
A couple of times per cycle.

The mechanical system used a 10:1 lever, a flexure and a stepper driven with 4:1 reduction M8 (1.25mm pitch) screw drive. It was accurate to better than .0001"

I would like to try using a webcam as you have described instead of the electrical contact and compare the results. Being non contact it should not have the dirty contact issues.

I would love to try the software you have worked on if you are willing to share it? . Is it running on a PC? or a micro?

Regards
John

This photo is a little unclear. I still have the unit I will take some better photos. It was made from scrap material I had to hand as a test of concept only prototype.

26229

Kitwn
16-08-2019, 02:54 AM
I was wondering about how a taught wire might be used for measurements and very much like the arrangement John describes. I have a box full of Arduinos waiting for something to do.
Joe, One idea to throw into the melting pot... If two wires are stretched one above the other, separated by a distance slightly less than the diameter of the laser beam (wrapped around two suitably chosen drill shanks for example), can your sensor be used to accurately show the relative illumination of the two wires as the beam moves horizontally along them? Quite small variations of height might show up as significant variations of illumination brightness or width on the wires.

Kit

John McNamara
16-08-2019, 04:08 AM
Hi Kitwin

I would like to avoid a laser altogether. Instead ideally I would like to use the shadow of the wire over the sensor backlit with a dispersed light source. This would avoid any focussing issues. There would be a shadow formed on the sensor with a normal distribution characteristic darkest in the center. to lightest near the two edges.

Borisovs paper mentioned earlier uses omron sensors in this manner, no optics.

As the camera sensor is only about 2mm square. with .008" wire I can imagine that the workable measurement range would be about 1mm at best. This is where the device I made would help. It has a range of about 5mm, It could be used to center the sensor. Once this is done the current count of the stepper would represent the null point on the sensor.

These counts could be plotted along the wire giving a chart of the flatness of the object being measured.

For longer distances over a metre the catenary sag of the wire will become noticable. This can be computed as the measurements are taken along the wire assuming the drive is stepper or a servo with an encoder.

Alternatively glass optics, I guess however there are many hurdles to a perfect arrangement.

Note
One of the very practical reasons for using wire is that it can be positioned very accurately prior to measurements being taken. Both endpoints can be fixed and very accurately aligned to the surface being measured. and once fixed they stay put.

I also have a Taylor Hobson alinement telescope. It works well but not to .0001" of an inch. (.002" is achievable) Setting it up buy aligning the targets is no easy matter. An hour can easily pass. If a target is knocked you have to start again. pointing a laser will be the same. Using both systems there is no obvious error. It can only be found out by checking.

When I did work on my lathe I used stretched wire mounted at each end on the bed. Here I used a Microscope. A digital camera sensor should be a lot more accurate. Scroll down to near the bottom of the following link.

https://www.model-engineer.co.uk/forums/postings.asp?th=136771

Regards
John

Kitwn
16-08-2019, 09:23 AM
John,
I had a look at the other thread on this forum where you described the taught wire system on your lathe and also scanned through Borisov's paper, though I must admit to not studying all 170 pages in detail. Cunning use of cheaply available sensors and I can well understand not wanting to involve adjustments to both the wire and the laser. I was thinking more of Joe's desire to check the horizontal flatness of the beam from his commercial laser device when the 2 wire idea came to me.
As someone who plays with a DIY CNC router as just as one of several hobbies I'm always on the lookout for ways of accurately aligning my machine without having to buy several expensive measurement devices that will only ever get used a handful of times. There's also a great deal of satisfaction from devising a method which is inexpensive but effective... which I haven't quite managed yet. I only cut wood, for the present at least, so my current aim is achieve 0.1mm accuracy. So I shan't be worrying about the sag in the middle of a 1200mm taught wire anytime soon:joyous:

Kit

devmonkey
16-08-2019, 05:48 PM
Just a quick one but surely if you are going to use a image sensor it is easier to reference off the perfectly straight laser? I'm also not sure why the stepper motor part is needed, wouldn't you just read the error straight off the image sensor and convert pixels to um?

In my opinion and how I visualise this is you are only ever measuring errors to a known reference you don't need to be parallel to it whether it is a wire or a laser or a precision straight edge. What you are trying to do is ensure these errors lie on a straight line, or in the case of two rails in the same plane.

If you want to use the cmos sensor as a shadow camera without optics my software would work if I inverted the image intensity as you'd get a guassian shadow from a round wire strongly back lit. Mechanically with no optics you need the wire very close to the sensor which may complicate things both wrt protecting the sensor but also aligning your wire in the first place. I would just rebuild a USB microscope at fixed focus in an aluminium block.Ideally you need to measure in 2D not 1D so you can set it straight in both dimensions at the same time, this can be done with two microscopes setup orthogonally on the same block. With a normal dot laser (if you are worried about twist then use a cross laser) pointed directly at an image sensor you are measuring 2D with a single sensor, with a wire you would need two sensors as you cannot 'look' down the wire. The cheap £15 microscopes on Amazon at mid resolution have a depth of field that could maintain focus on your wire if your setup error is within 0.5mm or so. Just be aware that you have to remount the guts of it in something rigid as the assembly that lets the optics slide in and out and the part that holds the sensor pcb can wobble. The latter reason is why i've dropped the optics all together as it simplifies mounting it.

devmonkey
17-08-2019, 05:16 PM
No more blutack!

A few happy hours with the milling machine and I've finished a rigid sensor mount. I surfaced the base plate so it the two faces are planar, then drilled it for the hiwin block. Then milled a true cube of Delrin with 6 sides surfaced in planar pairs, machining a cavity in one face to house the camera. Finally a window was milled. The glass in the window is a microscope slide cover slip, extremely thin, not sure how long it will last.The cube was drilled in two directions so it can be rotated 90 degrees for using the laser as a straight edge rather than a plane.

The cube is loaded onto the base plate with a bolt and a spring so it can still be rotated about the Z axis when in use, this means I can transfer it from one rail to another and pivot it back to look at the laser. Hopefully since I surface milled the contact surfaces it will remain in plane when rotated.

For reference that is a 20mm hiwin block. I managed to get a smudge on the sensor, doesn't really impact performance.

26235
26236
26237
26238

John McNamara
18-08-2019, 02:34 AM
Hi Devmonky
Hi all

I agree that you could use the output from the sensor to directly plot position.
Using a simple webcam with a 2mm sensor to centre a .008" piano wire or laser, the effective measurement range would be maybe 1mm. The active area of the sensor needs to be found in some way, unless the wire or beam is positioned within the active area all the time.

As you can see below, I have been thinking of making a device that flattens surfaces by "Pecking" using a small cutter stepped over a work piece. The overlapping pecks will create a flat surface that in the end will look like an engine turned surface. Another way of thinking about it is as if the surface was scraped. As with scraping practice the last step is to lightly stone the surface to remove burrs and correct any high spots.

When the positioning device shown earlier was being designed the range of motion was considered - what sort of materials would be measured and for my purposes flattened? I was thinking rolled 50-100mm square steel sections, weldments etc. I reasoned that maybe a 5mm range of motion would be desirable to flatten these objects. Large bends in thin walled tube would obviously not work if severely bent, and would be cut right through without the addition of some sort of built up face made from Steel, Aluminium or Epoxy, standard practice in industry.

My design intent was to design a simple machine to flatten objects that could be built from very low-cost materials. There are numerous posts on the Web regarding the creation of flat surfaces on DIY built CNC Routers Mills and other machines, various methods are used, some quite costly. Many are not entirely successful.

As I described earlier the test jig uses a lever flexure and screw driven by a stepper motor. I used the same mechanism to position a grinding jig to within a repeatable mechanical accuracy of .0001" 2.5 microns. I know it works. It has a range of motion of 5mm.

The mechanism is able to apply a significant force the 10:1 primary lever and flexure provides enough force to easily position the Z carriage. (Flexures are free of backlash although geometric errors have to be considered).

My plan is to also drive the mechanism with a crude Y motion that guides the sensor head and cutter along the work piece. I imagined using a piece of steel, say a piece of I beam or other available steel section with simple ball bearing rollers guiding a carriage along it, the piece being flattened would be placed upon it. The accuracy of the flattening is determined by the wire and sensor not the beam or mechanism. The only preparation of the support beam needed would be to hand grind and stone the surfaces that the ball bearings run on for smooth running.

Two possible arrangements are:

For a horizontally disposed flat surface generator.
The x axis requires very little travel, maybe 75mm will cover just about any bearing surface I can imagine. I am still thinking on this. Moving the work piece laterally on two small slides would be simple enough for shorter lengths. Longer lengths would be a different matter - they would require mid span support or they will deflect slightly due to cutting forces and gravity. The X axis motion will require high precision, however over a very short distance. The two or more slides will all have to be coplanar.

For a vertically disposed flat surface generator. (This has always been my preferred option.)

This solves a number of the design issues of the horizontal arrangement. The y axis can be the same as previously described (except it now has to be described as the Z axis!)

In this case two alignment wires can be used, one each side of the Z axis support beam, simply suspended with a counterweight (the weights can be placed in a container of thick oil to dampen them).

Using this arrangement there is no catenary sag at all, the wires will be perfectly coplanar at all times.

The Cutting head can be mounted on a small precision X axis slide.
To align the x axis slide to the work piece will require two cameras and two stepper driven positioners as described earlier. The software will need to go through a few iterations to get the two cameras in perfect alignment.

The work piece can be simply clamped to the Y axis base beam.

Cost?
2 web cams
2 wire alignment steppers.
2 timing pulleys and a belt

1 X Axis drive stepper.
1 X axis 100mm slide, bought or built.
1 X Axis screw drive - only low resolution is required.

1 Y axis drive stepper
1 Y axis timing belt drive, this will be a long belt
8 or 10 Y axis low cost ball bearings.

1 Z axis Cutter head drive stepper.
2 Z Axis 20mm slides bought or built.
1 Z Axis screw drive (Must have no backlash)

A computer and interface.

A piece of scrap steel beam or tube as long as needed, assorted scrap steel.
Time

It will depend on what you have in stock?

Regards
John

mekanik
18-08-2019, 09:30 AM
Thanks John
Over the years i have been wondering if it would be possible to build an assembly that could grind a reference plane on a machine base but couldn't think how to make it rigid enough to be accurate, this would be much better than the epoxy faff and you could add flatbar to the frame giving you a decent amount of material to tap into. keep up the good work and plenty of pictures when you get it sorted.
Regards
Mike

devmonkey
18-08-2019, 10:55 AM
I agree that you could use the output from the sensor to directly plot position.
Using a simple webcam with a 2mm sensor to centre a .008" piano wire or laser, the effective measurement range would be maybe 1mm. The active area of the sensor needs to be found in some way, unless the wire or beam is positioned within the active area all the time.


Hi John,

With a self levelling laser hitting a 2mm square target over the entire machine shouldn't be too hard assuming you have levelling feet on the machine, we all do this or better when we put up a shelf. This assumes we can weld the frame to within 2mm.

Should also be noted that it is only the vga (640x480) web cams that have this small sensor area I think these are 1/6" diagonal sensors, other similarly priced but higher resolution cams have larger sensor areas. For example the raspberry pi camera (1/4") has a 4.6mm diagonal and another sensor I have the OV2640 has 4.5mm. It seems that the sensors are classified by the diagonal size of the sensor of which the active area with the pixels is smaller, this is why 1/4" > 4.6mm.

I like the idea of levelling a jig then grinding the surface as an alternative to shimming. What sort of grinder would you use for this?

I can imagine a jig short jig say 500mm that clamps around a piece of box section that can be micro adjusted for twist and level. I we bolted aluminium to the top of the box section you could probably skim it with a hand router with a small fly cutter in it. Skim the section under the jig then move the jig along, re-align it with the laser/wire then repeat. When you finish one rail then move the assembly to the other without moving the reference laser to bring the other rail into plane. Maybe a wood power planer could be used for the skimming, would be scary though.

The jig itself needs to be planar as you say but this should be straight forward on a milling machine.

What are you thinking for differentiating twist from height variation? I think with the laser two image sensors stuck out each side could detect twist same when you tram a mill with two dial indicators on a T bar in the spindle.

Cheers, Joe

John McNamara
18-08-2019, 02:32 PM
Hi John,

"With a self levelling laser hitting a 2mm square target over the entire machine shouldn't be too hard assuming you have levelling feet on the machine, we all do this or better when we put up a shelf. This assumes we can weld the frame to within 2mm."

Assuming a vertical arrangement the only alignment required is to align the rough frame he two counter weighted wires. When a work piece is clamped in position it is also aligned to the wires.

The concept of using a "metrology frame" in this case for one axis is not new.
https://www.google.com/search?q=metrology%20frame%20telescope%20mirror%20-site%3Apinterest.*&rlz=1C1ASUT_enAU791AU791&tbm=isch&source=iu&ictx=1&fir=PV6b07t5sCCs1M%253A%252CO03VsH4mNCSl_M%252C_&vet=1&usg=AI4_-kQGik5EgdDXMkktSO2Vg40EZC5PTw&sa=X&ved=2ahUKEwjesqiuuYzkAhXu8HMBHQNlDlEQ9QEwA3oECAkQC Q%23imgrc%3DPV6b07t5sCCs1M%3A&oq=metrology%20frame%20telescope%20mirror%20-site%3Apinterest.*#imgrc=PV6b07t5sCCs1M:&vet=1

It is important that the alignment wires are in line with the tip of the cutter at the point of cutting. This will greatly reduce any error caused by any angular misalignment of the z axis to the work piece. Abbes principal must always be honored.
https://www.google.com/search?rlz=1C1ASUT_enAU791AU791&ei=FElZXciCDILb9QOz9qfYDw&q=abbe%27s%20principle%20of%20linear%20measurement&oq=abbe%27s%20principle%20of%20linear%20measuremen t&gs_l=psy-ab.1.0.0i8i13i30.3151.3151..6825...0.2..0.159.159. 0j1......0....1..gws-wiz.......0i71.zasns7Fk5YU

------
"Should also be noted that it is only the vga (640x480) web cams that have this small sensor area I think these are 1/6" diagonal sensors, other similarly priced but higher resolution cams have larger sensor areas. For example the raspberry pi camera (1/4") has a 4.6mm diagonal and another sensor I have the OV2640 has 4.5mm. It seems that the sensors are classified by the diagonal size of the sensor of which the active area with the pixels is smaller, this is why 1/4" > 4.6mm."

I think sarting with a low cost solution first then if necessary upgrading to a more expensive camera.

------
"I like the idea of levelling a jig then grinding the surface as an alternative to shimming. What sort of grinder would you use for this?"

I had been reflecting on grinding but had substituted milling, strangely I should have written milling!
Grinders have a lot of inertia and take a long time to stop, they also make a lot of noise. A Small motor driven milling cutter ideally around 3mm can be fed relatively a lot slower and the motor can stop quickly. I suspect having a running spindle near the wire alignment system may cause the wires to vibrate. For high accuracy results it may be necessary to stop the spindle before each alignment cycle.

------
I can imagine a jig short jig say 500mm that clamps around a piece of box section that can be micro adjusted for twist and level. I we bolted aluminium to the top of the box section you could probably skim it with a hand router with a small fly cutter in it. Skim the section under the jig then move the jig along, re-align it with the laser/wire then repeat. When you finish one rail then move the assembly to the other without moving the reference laser to bring the other rail into plane. Maybe a wood power planer could be used for the skimming, would be scary though.

The jig itself needs to be planar as you say but this should be straight forward on a milling machine.

------
"What are you thinking for differentiating twist from height variation? I think with the laser two image sensors stuck out each side could detect twist same when you tram a mill with two dial indicators on a T bar in the spindle."

Two weighted wires suspended vertically will have no twist between the at all. These two wires are our meteorology frame. if we position our cutting stage relative to the wires using two cameras, make a peck cut then move X or Y,, check the cameras are still perfectly centered, make a new cut and so on our accuracy will be determined by the accuracy achieved by the camera system.

No system is without error however if you consider the above scenario the surface generated will have a surface that comprises a series of physical levels some high and some low. representing the accuracy of the measurement cameras and the positioning system.

Using a vertical alignment system, the exciting part is that the wires represent a plane that is far flatter than an inspection grade surface plate. The final result will be a surface that is extremely straight overall. With a surface similar to a scraped bearing surface.

Upon reflection I will make my test setup vertical.

As you may have guessed I have been thinking on this problem for a long time.

Cheers, Joe

Answers above.

devmonkey
18-08-2019, 05:49 PM
Ok, I understand what you are talking about. The larger sensors are just as cheap btw.

This is what I'm going to do with the unit I've built.

26257262582625926260

John McNamara
19-08-2019, 03:22 AM
It looks like the camera approach proposed by Devmonkey can solve two problems.

Generating an accurate plane surface with a Laser and camera as you have shown in his illustration
Or
Using stretched wire and camera's as a reference to machine a flat surface.

A great mind meld!

PS: I have located a scrap beam from a building site. I will have to weld up an adjustable base to keep it vertical. :)

Regards
John

devmonkey
19-08-2019, 08:41 AM
I've tried to measure the cmos sensor under the microscope and it is roughly 2mm in the longest dimension (the one I'm using), will need to calibrate it with known shims to calculate um / pixel but using this rough measurement it is 2/640 = 0.003mm. The scale in the picture is 0.1mm per division.

2626126262

AndyUK
19-08-2019, 09:16 AM
I've tried to measure the cmos sensor under the microscope and it is roughly 2mm in the longest dimension (the one I'm using), will need to calibrate it with known shims to calculate um / pixel but using this rough measurement it is 2/640 = 0.003mm. The scale in the picture is 0.1mm per division.

2626126262Also important to note that as you're using a fitted profile you're able to give a measurement to a higher level of precision than that.

Que the mandatory accuracy vs precision debate...

Sent from my SM-G950F using Tapatalk

Kitwn
19-08-2019, 09:58 AM
A little earlier I was tempted to ask, tongue somewhat in cheek, how, once the long ( X axis in my case) rails are aligned, we now extend these techniques to setting up the gantry. After a little more serious thought I came up with the following. The required equipment is satisfyingly simple and inexpensive. Sorry for a lack of drawings, I'm not at home among all my toys at present and I'm thinking and editing this as I write it. All comments and corrections gratefully received.
-
Depending on your design, the same principles discussed earlier might be used to align the pairs of Y and Z axes rails when building the parts on the bench but we then need to square the gantry and tram the Z axis to bring everything together. Wanting to test for misalignment of rail pairs due to the stress of assembling the parts adds even more complication.
-
I'm thinking that two taught wires (one in front of and one behind the gantry) stretched across the now perfectly aligned X rails could be used with a simple threaded sensor probe mounted in an offset bracket in the spindle in much the same way as a single dial gauge is commonly used for tramming but without the awkward setting up and possible errors of a glass plate sitting on the machine bed. For machines with the rails mounted on high sides this might not work. Design your next machine with your chosen alignment procedures already devised.
-
One complication is that the wires must be perpendicular to the X rails and very close to the exact spacing required to give contact points with the probe arm parallel to the X axis or measured errors will be a compound of several possible alignment errors in the machine. By rotating the probe and adjusting it's height it is possible to use an ordinary multimeter to detect a setting where the probe just fails to make electrical contact with the wires at both front and back. If the spindle axis is not perpendicular to the X rails in the vertical plane these heights will not match. Unfortunately we can’t tell from these measurements if it’s the gantry feet that need shims or the spindle mounting.
-
Testing at either end of the Y axis travel will check for any twist in the Y rails plane and variation of height above the X plane (I'm calling this 'Y axis tilt' ). At least we know where the shims go for these last two. All these errors will need to be corrected before moving on.
-
I'm thinking of using a threaded probe rather than play with the software-driven Z axis height to do this as it's going to be quicker and easier.
-
Your chosen gantry design means it may not be possible to position the axis of the spindle in the ideal position directly above one wire and check for two matching contact heights at two points either side of the spindle along the Y axis but any two points on one wire found by moving the sensor over as wide an arc as possible over a wire as close to the spindle as possible should work. Height differences measured here are only due to errors within the Z axis/spindle assembly alignment if there is no remaining Y axis tilt.
-
Only after all this is done is it possible to skim the bed and then square the gantry by making the machine mark the corners of a rectangle on the bed and comparing the length of the diagonals.
-
Kit

devmonkey
19-08-2019, 12:29 PM
I've put the software up on github if anyone wants to play, I will add features as I need them or they are suggested here.

https://github.com/betzuka/laserlevel

devmonkey
19-08-2019, 07:40 PM
Kitwn, about using it for tramming I would attach my sensor block to a T-bar in the spindle as if I was tramming a mill with a single dial indicator. Rotate the spindle and take sensor height readings at 0, 120 and 240 degrees rotation. Take plane described by these 3 3D points, calculate the plane normal and determine the error to the plane normal of your x axis plane, then shim the z axis until the normals are the same.

I will have a think about squaring but this is usually easy to do with dual x axis machines after skimming the bed by drilling 4 corners of a large square and checking diagonals using a stick with an indicator on the end, adjust home proximity sensors, re-home, repeat.

If at any point after initially bringing the x rails into plane you need to re-establish this plane in order to do something like tramming, it is unlikely the laser can be put back where it was initially. However since the rails are still planar the laser can be setup again and 3 points measured 2 from one rail, one from the other and the x plane normal established relative to the new laser normal. This is similar to moving between machine and workpiece coordinate systems in a CAM programme. For tramming we would align the spindle normal to the x plane normal via the laser normal, i.e. When the two errors are the same the spindle is trammed.

Kitwn
19-08-2019, 11:47 PM
I'm very interested to look at your software on github. I'm no great programmer but have an unused Raspeberry Pi and a Pi camera which my brother -in-law sent me. I've been trying to work out what to do with them so this might be a possibility.This is exactly the sort of application he'd enjoy seeing it used for. It would be a large sensor block though with the Pi included as the camera attaches directly to it.
-
Part of my concern with working out an exact series of measurements is separating the possible sources of a given error and being able to align the machine in a systematic way. There's no point making the axis of the spindle exactly vertical until after you've ensured the axis along which the Z assembly moves is vertical and that can't be done until the Y rails and gantry mountings are set up and so on.
-
Some assumptions might be possible if your mechanical construction is very accurate but my machine is built using welded steel construction, a drill press and hand tools without access to a milling machine or other precision machining, so it's accuracy will only ever depend on being able to make measurements and correct errors with shims. I designed the whole thing with that requirement in mind but it's being able to make accurate measurements without spending more on a variety of gauges than on the machine itself that has made this thread so interesting. Like many hobbyists I have more spare time than spare money and there's great satisfaction in following Arthur Wellesley's maxim.
-
Kit

John McNamara
20-08-2019, 04:13 PM
Hi Devmonkey

I downloaded and set up the camera software from Github.
setting up is quite a process, a mate who is a far better programmer than me led me through the environment variables setup. I am not used to this sort of programming environment.
Once installed correctly the software compiled without an issue.

I was only using the webcam on my laptop and a hand held laser line (not point) generator. It worked very well.

A logitech webcam was also tried it worked but there were strange fresnel like circles produced with the laser. The logitech camera had a quite large lens. The laptop camera did not display the same aberrations. its camera is tiny.

I also tried a fuzzy pencil line drawn on paper that worked OK too.
A piece of wire should be no problem.

Over the weekend when I have time I will set up a test on a granite surface plate with some precision gauges. and a proper camera with and without a lens on a stand.

It will be very interesting to get a better idea of repeatable accuracy. I am sure it will be very good.

Congratulations Joe, great job.

Regards
John

PS:
I have started to draw up the flat surface generator I described,
I want to make it 90% from Laser cut 5mm steel plate. Using a single universal beam as the main frame (100ub 23) I know that that profile is available in Australia and the UK Hopefully Europe and the US too. It will hold an up to 100x100mm RHS Workpiece. To be used as linear rail support beams for routers and mills.
I hope it works! There is only one way to find out.

devmonkey
20-08-2019, 04:36 PM
Hi Devmonkey

A logitech webcam was also tried it worked but there were strange fresnel like circles produced with the laser. The logitech camera had a quite large lens. The laptop camera did not display the same aberrations. its camera is tiny.

I also tried a fuzzy pencil line drawn on paper that worked OK too.
A piece of wire should be no problem.


If you are using a laser with the (crap) optics of a webcam then you will get all sorts of weird patterns and probably more problematic non-linearity meaning each pixel will register slightly different height errors, best to get an old or cheap webcam and rip the sensor out and bin the optics. If you want to stick with optics then use a piece of white paper as a screen between the laser and the camera, focus the camera on the screen.

With the pencil line did the gaussian detection work? I would be surprised if it did as the pencil line would be lower intensity than the paper. I would need to invert the intensity I would think for this to work properly with a pencil line or wire. Also to use as a shadow camera you will need to flood the background with an even light source, maybe a white led behind a piece of diffusion perspex (the translucent white stuff). This is to eliminate false triggering from the otherwise random background intensity of your workshop wherever the camera is pointing.

John McNamara
20-08-2019, 04:51 PM
Hi Devmonkey

Yes the line did produce a gaussian plot. It was a crude test. I just placed the paper in front of the Logitec camera about 150mm away no backlighting just ambient fluorescent (Its night time) I did get the curve plot. it was all hand held testing lots of movement. I really want to test it properly. It will be interesting to try inverting greyscale?.

Cheers
John

devmonkey
20-08-2019, 05:01 PM
To invert the greyscale add the following line to FrameAnalyzer.analyzeNextFrame() below where the rotation is performed:
Core.rotate(mat, mat, Core.ROTATE_90_CLOCKWISE);
Core.bitwise_not(mat, mat); <-- Add this line

John McNamara
24-08-2019, 06:41 AM
Hi Devmonkey
Hi All

First tests!

Today I set up a quick test to determine what sort of accuracy might be achieved using a Webcam and laser.

I mounted the webcam on a linear rail slide, I was going to use gauge blocks against a stop to measure the resolution of the device using a cheap laser that I picked up from Aldi one day. it is the only line laser I have. That did not work because the hard plastic ends on the linear rails were too flexible, I could not get constant results.....

The Webcam is a 640 x 480 resolution Microsoft LifeCam VX -1000. It has an adjustable lens that I was unable to remove quickly so I just used it as is! Pointing the laser directly at the camera produced horrible flare. However angling the camera did work! I am not sure why? Probably something to do with the lens. The next tests will be done without a lens.

I think you could say that the tests were a bit of a comedy of errors!

Fortunately I has also set a magnetic base 0.01mm indicator on the rail. It saved the day. By simply pressing on the linear slide I was able to move the slide laterally about 0.04mm with medium pressure. when i released the pressure the indicator went back to zero. This is all I needed...

Now for the exciting part; Hidden at the bottom of the Gaussian graph there is a tiny numeric value, It followed my indicator movement when I moved the slide. very roughly a value of 1 to 4 on the graph value to 1 to 4 ticks on the 0.01mm indicator. I assume this correlation may not have been planned however with the particular camera I used it was very convenient.

I ran the test several times and it was repeatable.
0.01mm is equal to .00039" (about 4 tenths)
A very good result from a crude setup.

The following improvements will no doubt greatly improve the results.

A better camera with the lens removed.

Controlled ambient light. moving around the room can move the graph also sunlight entering the room moved the graph.
The sensor needs to be shaded as much as possible.

The numeric values at the bottom of the screen needs to be enlarged. Optional rounding and time averaging settings that can be applied to the displayed number would help to reduce the flicker.

I have yet to test the device with wire.

Regards
John

Three images below:

Homage to Johann Carl Friedrich Gauss https://en.wikipedia.org/wiki/Carl_Friedrich_Gauss

And the measurement principal of reversal. https://www.google.com/search?q=measurement%20principal%20of%20reversal%2 0-site%3Apinterest.*&rlz=1C1ASUT_enAU791AU791&source=lnms&tbm=isch&sa=X&ved=0ahUKEwjv_cKS4JrkAhXWX30KHYvtBKwQ_AUIESgB&biw=1053&bih=477&oq=measurement%20principal%20of%20reversal%20-site%3Apinterest.*


26280

26282

26281

devmonkey
24-08-2019, 07:48 AM
Hi John,

Yes the tiny number is the deviation in pixels from where you pressed zero.

I don't think it was ambient light affecting your setup, the laser saturates the sensor. It is so sensitive it will easily pick up deflections in your floor from walking about. This happened when I was testing too, I had to sit completely still. It is less sensitive to walking about on a 6 inch bare concrete slab but you can still move it a few pixels.

You don't need a better camera you just need to rip the optics off that one. The difference in quality between webcams of the same resolution is simply the optics.

John McNamara
24-08-2019, 08:24 AM
Hi DevMonkey

I just did this calc in Excel

sensor size in mm 2
/ pixels 640
Space between pixel lines = 0.003125 mm

I got roughly 1 integer value change to 0.01mm div on the Mitutoyo indicator.
Quite a big variation?

Regards
John

devmonkey
24-08-2019, 11:23 AM
My setup works out at the predicted resolution of 3um per pixel. I don't think you can trust this at all with your setup as the optics are still attached but with nothing to focus on. You are also getting a load of noise on the gaussian, this is probably either a function of the crappy optics on the camera or the laser line is using a diffraction pattern rather than a cylindrical lens.

Rip the lens off the camera, then you will also be able to see if the sensor is indeed 2mm.

If you think about it, without optics and the laser projected directly onto the sensor moving the sensor 1 pixel will shift the maximum intensity one pixel, there is no other option as the sensor and beam have moved relatively and the intensity profile of a cross section of the laser line hitting the sensor has not changed.

John McNamara
24-08-2019, 02:36 PM
Hi Devmonkey

Your comment.....
"or the laser line is using a diffraction pattern rather than a cylindrical lens."

Yes I think there is a problem with the laser source.

Without the lens the graph is far worse with multiple peaks. Upon opening the case there is a shaped plastic stepped prism that limits the beam to 90 degrees of coverage. the step is in the middle of the laser. (There are actually 2 similar laser sources in the unit) both are the same. it is not a tubular lens.

I will have to source a good quality line laser. not sure where yet?

The camera sensor appears to be closer to 3.5mm wide including the border so I guess the active area to be about 3mm wide. Its a fairly old unit but it works well.

Regards
John

devmonkey
24-08-2019, 03:36 PM
Hi John,

I'm just using a bog standard Dewalt laser level, part number DW088.

I'm curious, the laser you have, how thick is the line at 2 and 5 or more meters? If it is still a nice narrow line 2-4mm thick it could still be usable, try moving it further away from the sensor. Also try using the laser without the case on, maybe the window is distorting it as well?

The £3 diffraction based lasers I have that are total rubbish but still work but can only be focused to a fine line line at a specific distance making them useless for any actual measurement we need.

This is what the crap lasers look like looking into the lens:
26294

This is what a cylindrical lens looks like on the DW088
26295

I haven't tried one but this looks like it might work well:
https://banggood.app.link/AAvDRpISpZ
Cheers, Joe

Kitwn
24-08-2019, 04:13 PM
Joe,
I've cloned the repository to my W10 laptop but installing Maven doesn't seem to have worked though I think I've followed the instructions. 'mvn' is unrecognised as an instruction by the Windows command prompt anyway. Is there any chance of a more idiot-friendly installation of your software?

EDIT: OK I've got the Maven path variable correct this time and something's beginning to happen!

Kit

devmonkey
24-08-2019, 04:49 PM
Hi Kitwin,

Glad you are making progress. It is a bit of a pain to do if you don't already have a dev environment setup I agree. When I get time and when the software has evolved into a usable state i'll generate some native executables people can just download an run.

Cheers, Joe

Kitwn
24-08-2019, 05:10 PM
Joe,
That would be good. It's downloaded everything at the second attempt but I'm now having to install java JDK in place of the vanilla version. We'll get there in the end. It's getting late here in WA (just after midnight) but a nightcap over ice is helping pass the time:beer:

Kit

Kitwn
25-08-2019, 02:24 AM
Joe,
So here I am in the bright light of the morning:cool:
No luck with the software I'm afraid. I got the following message from Maven about the lack of a compiler. I loaded the JDK version of Java, deleted and reloaded the vanilla one but nothing's changed. I read the Maven help file referenced later in the error report (not shown here) but didn't get anything I could see how to action from it.
Unless there's an obvious way forward I'm going to wait until you produce the more easily installed package.
-
This has been a very interesting thread to follow, plenty of new knowledge about the use of lasers and taught wires learned. I need to build a more solid base for my machine than the reinforced office table it sits on at present and that will be the time for some minor mods and reworking aimed at improving the accuracy.
Kit
_
c:\cnc\github\laserlevel>mvn package
[INFO] Scanning for projects...
[INFO]
[INFO] -----------------------< webcam-apps:laserlevel >-----------------------
[INFO] Building laserlevel 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ laserlevel ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory c:\cnc\github\laserlevel\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.0:compile (default-compile) @ laserlevel ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 4 source files to c:\cnc\github\laserlevel\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

devmonkey
25-08-2019, 09:04 AM
Kit,

You need java.exe on your PATH and setup another environment variable JAVA_HOME that points to the directory with the jdk in it. e.g. if java.exe is in c:\\java\jdkXXXX\bin\java.exe then JAVA_HOME must point to c:\\java\jdkXXXX

Anyway to help i've put up a build in a zip file here:
https://github.com/betzuka/laserlevel/raw/master/builds/laser.zip

Download that, unzip it and double click on laser.bat

It still requires that you have java installed.

Cheers, Joe

Kitwn
26-08-2019, 09:22 AM
Joe,
Thankyou, that's brilliant. It works as simply as that!
-
For anyone else who want's to try it the only thing you need to know is how to dissable the built-in webcam on your laptop. Go into Device Manager, click on 'Cameras', Right-click on the entry for your buil-in camera and click 'dissable device'. This will cause the software to find your USB camera instead.
-
Unfortunately my Black & Decker 'CrossHair' level doesn't produce a suitable beam, it's a series of dots even though the source inside appears to have a curved lens in front. Perhaps the family of MYCNCUK contributers can come up with a list of commercial laser levels that produce a suitable, unbroken line.

Kit

devmonkey
26-08-2019, 10:21 AM
Kit,

Did you remove the camera lens? Do you have a picture of the laser? If it is a single laser that produces a cross then it does not have a proper lens in my understanding, for example my laser produces a pair of crossed lines but it has two lasers, one vertical, one horizontal.

I have updated the build to include a camera chooser if more than one camera is attached to the computer so you don't have to disable the built in one.

https://github.com/betzuka/laserlevel/blob/master/builds/laser.zip?raw=true

Joe

Kitwn
26-08-2019, 01:04 PM
Joe,
You'll be calling it "Plug & Play" if you carry on like this! Exactly what most of your readers require, thankyou.

I haven't got as far as mutilating my webcam just yet, the B&D laser beastie is many years old and is specifically designed to hang on a wall and produce a straight horizontal and vertical line along the same wall it's hung on rather than a horizontal line across the room. Laser units are cheap on eBay, it's just a matter of working out which ones to buy and how to mount them.
I've yet to decide exactly how I'm going to use your program, with a laser or with John's sugestion using the image of a taught wire, or with both at different stages of setting up the whole machine. More thinking and experimenting is required to devise a method of aligning all the different parts of the machine in isolation and in the correct order to end up with a hand built machine that can cut out pieces with a much higher accuracy than the basic methods used to construct it.

Kit

John McNamara
26-08-2019, 01:18 PM
Hi Kitwin
Glad you got the software going, pity you are so far away From Melbourne.

Hi Devmonkey

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

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

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

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

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

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

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

My next tests will be with wire no lens.

Regards
John

Three images below.
26316

26317

26318

devmonkey
26-08-2019, 03:43 PM
John,

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

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

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

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

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

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


Cheers, Joe

devmonkey
26-08-2019, 06:19 PM
Hi all,

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

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

26319

Get the latest version here:
https://github.com/betzuka/laserlevel/blob/master/builds/laser.zip?raw=true

Cheers, Joe

Kitwn
27-08-2019, 01:44 AM
Hi Kitwin
Glad you got the software going, pity you are so far away From Melbourne.


I'm far away from everywhere!

Kitwn
27-08-2019, 05:25 AM
Joe,
It's all working, giving a good display even with the B&D laser which I thought might be a problem. The only issue I have now is that my not-quite-full-HD 768 line laptop monitor can't show me the table of results which wants to be at the bottom of the screen rather than the side as in your picture. Looks a treat on the desktop monitor though. I wonder what the chances are of my wife lending me her swanky new full-HD touch-screen hybrid laptop for use in the shed? I could fold it over into tablet mode, put it keyboard down on top of a pile of sharp, greasy tools and then enjoy a slow, painfull death:thumbdown:

devmonkey
27-08-2019, 02:33 PM
Hi guys,

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

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

https://github.com/betzuka/laserlevel/blob/master/builds/laser.zip?raw=true

26321
Cheers, Joe

Kitwn
27-08-2019, 11:29 PM
And he does all this whilst standing on one leg and juggling with knives.:smile:

Kit

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

26340
26341

John McNamara
29-08-2019, 11:13 AM
Hi Joe

I wish I knew more about optics.

Cylinder lenses appear to be the cheapest.
I wonder if a piece of glass rod would suffice?

So many choices........

Powel lenses are more expensive,

https://www.laserlineoptics.com/powell_primer.html

https://www.google.com/search?q=powell%20lens&sa=X&rlz=1C1ASUT_enAU791AU791&biw=1024&bih=528&tbm=shop&tbs=p_ord%3Ap&ei=O6NnXdKlMdbcz7sPyfy64A0&ved=0ahUKEwiSr_2T6qfkAhVW7nMBHUm-DtwQuw0I5wMoAg&oq=powell%20lens

General searches .

https://www.google.com/search?q=line%20laser%20lens%20-site%3Apinterest.*&rlz=1C1ASUT_enAU791AU791&source=lnms&tbm=isch&sa=X&ved=0ahUKEwjboq7i56fkAhVXQH0KHTkvAuIQ_AUIESgB&biw=1024&bih=528&oq=line%20laser%20lens%20-site%3Apinterest.*

https://www.dhgate.com/product/2pcs-glass-cylinder-line-laser-lens-rod-lens/397472227.html

https://www.ebay.com/itm/2pcs-Optical-glass-line-laser-cylinder-lens-module-/180869393128


EDIT:

Added
https://www.coherent.com/assets/pdf/Efficient-Transformation-of-Gaussian-Beams-into-Uniform-Rectangular-Intensity-Distributions_FORMFIRST.pdf

https://www.alibaba.com/showroom/powell-lens.html

Regards
John

devmonkey
29-08-2019, 01:44 PM
The cheapest are definitely these plastic grate things, the glass cylinders are much more, then the powel lens are about twice as much again. I think the cylinder is the best choice as the powel is designed to remove the gaussian beam intensity which for our purposes is extremely useful.

The self levelling laser i'm using is 1.3mW and has two lasers each with a cylindrical glass lens. 1.3mW is very weak compared to what you can buy online. Probably wants to be low power to avoid potentially damaging the cmos camera sensor.

If you want something that definitely works pick up a broken Dewalt DW088 on ebay. These seem to fail whereby one or other of the lasers becomes very dim, this is down to the driver board failing, so I would expect the lasers still work perfectly and can be scavenged.

devmonkey
29-08-2019, 01:46 PM
Hi Joe

I wish I knew more about optics.

Cylinder lenses appear to be the cheapest.
I wonder if a piece of glass rod would suffice?


I don't think they are round, rather half round, I maybe wrong. The better ones are made out of something called K9 glass, again I don't know what this is. Maybe Andy can jump in here?

AndyUK
29-08-2019, 02:23 PM
I don't think they are round, rather half round, I maybe wrong. The better ones are made out of something called K9 glass, again I don't know what this is. Maybe Andy can jump in here?

Watching the thread with interest, but unfortunately its been many years since I studied optics, and I'm not massively useful at this point! But I whole-heartedly agree that you want to keep the guassian characteristic where possible, as its a nice structure to fit to. You could use the FWHM from a flat-top profile, but I'd trust the guassian fit better as the regression uses the entire curve, rather than just the penumbras.

Re. lenses; It all depends on the incoming beam width, the radius of the rod/lens, and the refractive index of the material being used; in general I'd guesstimate that given a beam focused to infinity, you're likely to get a wider output spread by using a full rod, but there are so many variables here to play with, i'd be tempted to just go with an off the shelf lens designed for the job which will also guarantee clarity of the beam to a certain extent.

John McNamara
29-08-2019, 02:30 PM
A number of sites show what appears to be a plain cylinder.

https://www.google.com/search?q=line%20laser%20cylinder%20-site%3Apinterest.*&sa=X&rlz=1C1ASUT_enAU791AU791&biw=1024&bih=528&tbm=isch&source=iu&ictx=1&fir=XEfWKgEFIV2rNM%253A%252C2ngrlhq0Jh7MRM%252C_&vet=1&usg=AI4_-kTKKUvUj4dItaa1GTpwCcirTIjg4g&ved=2ahUKEwjoq_iwlqjkAhURdysKHd0GCJ8Q9QEwAXoECAQQC Q%23imgrc%3DXEfWKgEFIV2rNM%3A&oq=line%20laser%20cylinder%20-site%3Apinterest.*

Kitwn
30-08-2019, 03:20 AM
Joe,
The latest software version works perfectly and can be resized to fit nicely on my 'old' laptop. Thanks for all your effort.

Does the software work with a lens-less camera pointed directly at a laser pointer? I'm thinking you could arrange the pointer to provide a straight beam at a set height above a rail and detect how the spot moves around on the sensor as the camera backs away from the source on a carriage. Turning the camera 90 degrees allows measurement of horizontal and vertical errors. This is the quantum version of John's taught wire and requires a rigid, adjustable mount for the laser on the bed of the machine under test.

All,
I advise against trying to remove the optics from your cylindrically shaped, metal bodied, Mircosoft, auto-focus webcam. They're actually very solidly put together and mine is now a small pile of mangled bin-fodder. I've ordered a much more flimsy looking manual focus version from eBay (and a laser pointer).

Kit

John McNamara
30-08-2019, 03:54 AM
Hi Joe and Kit

I have been working on automating the positioning of the sensor to the wire.
To do that it really needs a micro to do the hardware housekeeping, control step motors and limits etc. It also removes the need to lug a PC around.

A mate tried running the cam software on a laptop that runs Debian Linux. It Ran!
He is also into Rasberry PI micros. as said that the software should be fairly easy to port over to a PI. Best a PI 4 for speed. it may be slower than a PC that has to be tested.

I am going to order one and we will try it.

To automate the software will it to address some output registers to hold the current position of the wire or laser relative to the centre point of the camera sensor.

The more I work on this project the more excited I get. Great work Joe.

Regards
John

Kitwn
30-08-2019, 07:04 AM
John,
I have a Pi 4 and a matching touch screen waiting for something useful to do so will be very interested to see your results.

Kit

devmonkey
30-08-2019, 07:39 AM
Software should work on most platforms, that is the point of java. However the native component that talks to the webcam doesn't work on the RPI without some changes, see here from the author.

http://webcam-capture.sarxos.pl/

devmonkey
30-08-2019, 08:47 AM
Joe,
The latest software version works perfectly and can be resized to fit nicely on my 'old' laptop. Thanks for all your effort.

Does the software work with a lens-less camera pointed directly at a laser pointer? I'm thinking you could arrange the pointer to provide a straight beam at a set height above a rail and detect how the spot moves around on the sensor as the camera backs away from the source on a carriage. Turning the camera 90 degrees allows measurement of horizontal and vertical errors. This is the quantum version of John's taught wire and requires a rigid, adjustable mount for the laser on the bed of the machine under test.

All,
I advise against trying to remove the optics from your cylindrically shaped, metal bodied, Mircosoft, auto-focus webcam. They're actually very solidly put together and mine is now a small pile of mangled bin-fodder. I've ordered a much more flimsy looking manual focus version from eBay (and a laser pointer).

Kit

Hi Kit,

At the moment the app is only performing a gaussian fit in 2D, i.e. one spatial dimension say Z and intensity. I could probably add a 3D fit which would allow you to use a dot laser.

The method I'm going to use will not require this as I think it is considerably easier to straighten in one dimension at a time having done some shimming and scraping in the past. I will use the laser horizontally to flatten the rail in Z with shims then rotate the laser and camera and straighten it in X, trying to do both at once is a nightmare in my experience, not from a measurement perspective but from an adjustment perspective. Since i'm only getting the errors in a straight line rather than trying to get the rail parallel with the laser it doesn't matter if the laser and camera move relatively to each other all over the place when you rotate them, the two operations (flatten then straighten) are entirely independent.

This is the camera I'm currently using, very easy to take apart and remount and only £7, works superbly.
https://www.amazon.co.uk/gp/product/B01L1XAQAS

Cheers, Joe

John McNamara
30-08-2019, 09:59 AM
Hi All

A mate and I made this device a while back, The test device searches for and senses the position of a wire electrically to .0001" The stepper and 3:1 timing belt driven screw attached to a Flexure hinged 10:1 ratio lever provided repeatable accuracy. The only variable was the contact resistance of the wire. It sensed on the break of contact naturally. This occasionally led to false readings, I left the test running for hours.

This is where the non contact camera is very attractive.

Automating positioning using a webcam the laser or wire sensing requires accurate mechanicals. This test machine was bulky It was designed to move a cutting head with an attached sensor, it cost very little.

I guess a ball screw would be the obvious answer. surprisingly small ones are not inexpensive. That is why I used a flexure for the first stage of amplification, Flexures have effectively no backlash. Have to think on this.....

26346

It was driven by a baby Arduino with a small attached display for settings.

Regards
John

devmonkey
30-08-2019, 10:47 AM
John, it would be trivial to extend the software to write the resolved beam location down a com port to your arduino. On the arduino you would run a closed loop to move the sensor to get the beam central.

Let me know if you want this added, and also what format to send the data in.

John McNamara
30-08-2019, 11:19 AM
Gee Joe.

So many minds around the planet working on a problem generously sharing their ideas.

I Ordered a PI 4 today and will start thinking on the software.

Regards
John

devmonkey
30-08-2019, 12:05 PM
Gee Joe.

So many minds around the planet working on a problem generously sharing their ideas.

I Ordered a PI 4 today and will start thinking on the software.

Regards
John

See what I said above about it not working on a PI by default.

Kitwn
30-08-2019, 04:06 PM
Hi Kit,

At the moment the app is only performing a gaussian fit in 2D, i.e. one spatial dimension say Z and intensity. I could probably add a 3D fit which would allow you to use a dot laser.

I wasn't thinking of measuring in two dimensions at once, just wondering if the software would cope with just a spot, treating it rather like a short line segment covering only part of the sensor. I would always expect to rotate the sensor to select between horizontal and vertical error measurements. Please don't do even more work just to suit my whims! This was more to do with removing the problems associated with the line-laser lenses. As you would only ever be working with the same central area of the laser line anyway if used as I was thinking, it probably makes no difference.

The camera I've ordered is this one, it looks suitably flimsy at the front and is even cheaper than yours!

26348

John McNamara
01-09-2019, 09:43 AM
Hi All

Today I tested the software using a 640 x 480 VGA webcam without a lens and #2 Roslau Music wire (0.0010" thick).

Digging around the workshop I resurrected an accurate XYZ jig table I lashed up with some star linear bearings and preloaded 8mm screws some time ago, this enabled me to precisely position the webcam now stripped from it plastic housing and mounted on in an aluminium bracket securely clamped on the XY stage of the jig. Measurements were taken with a Mitutoyo 0.01mm per division dial indicator.

The wire was positioned about .0015" above the face of the Camera sensor.
Calculated resolution achieved was 130 lines used to measure 0.05m = .003846mm per pixel line 0.000151") see Excel Image below.

This was repeatable I performed the test several times. however there are some issues measuring small values. It was difficult to measure .01 increments repeatably due to the software constantly recalculating very slightly different values. the source of this error needs to be tracked down. It may not be a software issue, I suspect It may be a combination of hardware and software issues.

From various tests I have observed changing light conditions cause the measured value to change in a very substantial way. I also observed this using the laser in earlier tests although to a lesser extent.

In the image below notice the paper tent covering the sensor this is essential to reduce the effect of stray light while providing somewhat even illumination of the sensor. It is not Ideal. I need to enclose the sensor in total darkness apart from an even illumination source behind the wire. I think this light source needs to be variable intensity to provide the correct grey scale balance for the software.

Once the correct lighting conditions are achieved I will run the tests again.

The tests today have proved that the Webcam software is already capable of very good repeatable accuracy. and that there is still plenty of room for improvement. Very exciting!

Regards
John

4 images below:
26366

26363

26364

26365

devmonkey
01-09-2019, 11:17 AM
Hi John,

It looks like you are using a very old version of the software, I would just download the ready to go latest version, this has the smoothing you need for actual measurements, plus a load of other enhancements, see my previous posts.

When used as a light sensor with a laser and no optics I have testing in pitch darkness and bright light and there is no variation at all, this is because the laser saturates the sensor.

When used as a camera, i.e. focused on an object such as a screen ambient light has to be completely eliminated both front and back of the sensor, you get some shine through the pcb even. I put mine in a black box.

When used as a shadow camera without optics and the shadow generator (wire in your case) very close to the sensor you should be able to just put a very intense light source behind the wire, this will saturate the sensor which is what you want, you will need some diffusion material to even out the light source as I mentioned before.

The software automatically scales the intensity plot, assuming you can generate enough contrast between the thing you are measuring and the background.

You should be able to get very repeatable measurements down to 3um, when using as a shadow camera make sure you tick the invert box in the prefs.

Keep at it!

Joe

John McNamara
01-09-2019, 11:39 AM
Hi Joe

I am using the latest software

3um = 0.00011811" (Inches)

I am going to repeat the test tonight, better light control.

Regards
John

devmonkey
01-09-2019, 11:51 AM
The picture you attached to the previous post was not the latest version John, the latest version has a table of measurements taken and smoothing when taking a measurement, export to csv, etc. Maybe that photo you took was from some previous experiment?

3um = 0.00011811" (Inches) --> CORRECT

FYI, this is what the latest version looks like:
26367

John McNamara
01-09-2019, 01:42 PM
Hi Joe

I ran the tests again this time using a small LED torch as a bright light source.
This gives a very sharp high contrast graph.

Strangely the scaling changed to 119.9 pixel lines with the new light source. I repeated the test a couple of times. the results were the same.

I did not change the gap between the wire and the sensor. it must be caused by the change in light source.

I used the software measure table and recorded every step between zero using 0.05mm steps see image below.

The setup I am using moves the sensor not the wire, Important for a point light source to avoid the shadow elongating like the sun in late afternoon.

This is easy to prove moving the torch by the slightest amount changes the measurement.
I really want to find an evenly dispersed light source.

I have yet to try your smoothing settings, That will be interesting.

Edit just noticed the software has changed a bit more. I will update


Regards
John

26368

26369

John McNamara
01-09-2019, 02:42 PM
Hi Joe
Hi All

I downloaded the next version that displays a graph of the measured points. And look how nice and linear the graph is! .05mm measurement steps on the dial indicator.

26370

I ran it 3 times to check.

While testing I moved the light a tiny bit. I had to start again, The light source will have to be rigidly mounted on the platform or you will get errors.

Will the current software work with higher resolution cameras say 1080P? I realize there would be more number crunching for he processor.

Regards
John

driftspin
01-09-2019, 03:00 PM
Hey guys,

I have been following this thread with great interest. Really great work.

I really like they way the camera + software is used for this purpose. It smells like a commercial oppertunity in my opinion.

Anyway, Since i bought a new house i am about to move my cnc machine in about a month or two.

I think i could use a laser level device for some of the needed remodelling work so that one could pass investment committee.

I would like to use this technique for a check on my machine after transport.

Actually.. it would be the first time and method i could set up for a half decent check on my machine.



So i would like to buy a new laser device with this in mind.

I only have an 8 mm umbilical type usb HD cam atm. So a really small chip.. i guess not usable for this pupose.

Maybe it could be with the indirect method putting the camera behind the screen.
Is that idea abandoned?

Are you guys using 640x480 on purpose?
Do low res low cost chips have the wanted size / resolution / pixels per mm.
So no need/advantage for throwing a few extra pecunia?

So does a laser level loc in position after setup?

Or do you have to trust the deviation is constant / repeatable.

Greetings Bert


Verstuurd vanaf mijn SM-A320FL met Tapatalk

devmonkey
01-09-2019, 03:55 PM
Hi John, Yes with your shadow camera setup you will always have to move the light source with the sensor board, they really need to be bolted together with a gap for the wire. I have used translucent white perspex for led light diffusion before, works really well, you can buy it on amazon.

devmonkey
01-09-2019, 04:04 PM
Hey guys,

I have been following this thread with great interest. Really great work.

I really like they way the camera + software is used for this purpose. It smells like a commercial oppertunity in my opinion.

Anyway, Since i bought a new house i am about to move my cnc machine in about a month or two.

I think i could use a laser level device for some of the needed remodelling work so that one could pass investment committee.

I would like to use this technique for a check on my machine after transport.

Actually.. it would be the first time and method i could set up for a half decent check on my machine.



So i would like to buy a new laser device with this in mind.

I only have an 8 mm umbilical type usb HD cam atm. So a really small chip.. i guess not usable for this pupose.

Maybe it could be with the indirect method putting the camera behind the screen.
Is that idea abandoned?

Are you guys using 640x480 on purpose?
Do low res low cost chips have the wanted size / resolution / pixels per mm.
So no need/advantage for throwing a few extra pecunia?

So does a laser level loc in position after setup?

Or do you have to trust the deviation is constant / repeatable.

Greetings Bert


Verstuurd vanaf mijn SM-A320FL met Tapatalk

Hi Bert,

The sensor in your cam is probably fine, although if the overall dimension of the camera is only 8mm it maybe harder to work with. The VGA sensors we are using are 2mm across.

It seems most of the cheap cameras are vga even though they are sold as HD. It is difficult to determine what the actual resolution of the sensors are without a part number, some are probably higher resolution sensor that are binned to get VGA output. We want a reasonable frame rate for averaging so given the bandwidth constraints of USB2 which most of the cameras talk, VGA can be give us 30FPS.

If you take a 2mm sensor with 640 columns of pixels you get 3um per row which is plenty small enough for what we are doing.

My laser doesn't lock in position, but once allowed to stabalise it doesn't move unless knocked. I only need the laser to not move for one measurement run, as I'm not trying to align to the laser rather to get the errors between the laser and whatever i'm measuring to lie in a straight line. From my initial experiments the laser doesn't move at all over say a 10min session. The Dewalt laser I'm using is damped with a magnet, this probably helps. The laser doesn't even need to be self leveling, this just helps getting it setup.

So the process would be switch on the laser (this moves it a bit), wait for a few seconds for it to stabalise, take N measurements along a rail, switch the laser off, shim the rail, repeat. It doesn't matter if the laser moves between runs.

Cheers, Joe

driftspin
01-09-2019, 05:42 PM
Hi Joe,

Do you still use it like this?
Or do you also point the laser directly to the sensor now?

Oh btw this is my camera:

https://s.click.aliexpress.com/e/EWnU1gjA

1280x768 i guess.

Hope to put it in the dustshoe later.



Grtz Bert.

https://uploads.tapatalk-cdn.com/20190901/ec54d53f0f6b16d3cd5a6be77e002841.jpg

Verstuurd vanaf mijn SM-A320FL met Tapatalk

devmonkey
01-09-2019, 08:22 PM
Hi Joe
Hi All

I downloaded the next version that displays a graph of the measured points. And look how nice and linear the graph is! .05mm measurement steps on the dial indicator.

26370

I ran it 3 times to check.

While testing I moved the light a tiny bit. I had to start again, The light source will have to be rigidly mounted on the platform or you will get errors.

Will the current software work with higher resolution cameras say 1080P? I realize there would be more number crunching for he processor.

Regards
John

Great result, would be interested to see what it looks like in 0.01mm steps. What does the residual chart look like? I can see your residuals are all less than one pixel which means your step size was very consistent. Also if you put in a scaling factor in the umPerPixel preference you will get your results in um, or tenths or whatever. I need to make these preference persist between runs.

At the moment the software asks the cam for a vga image, so it doesn't matter what the cam resolution is, I can make this more configurable.

devmonkey
01-09-2019, 08:45 PM
Hi Joe,

Do you still use it like this?
Or do you also point the laser directly to the sensor now?


Hi Bert,

No I just use the bare sensor in a milled fixture, see:

26375

Nealieboyee
02-09-2019, 12:37 AM
Nice work guys. For us laymen, how would this work (once all the problems are worked out) for, say aligning the parallel rails on a Y axis to make them level with each other? Is it just a case of placing the sensor on one rail and the laser on the other and then shimming until the software shows the line dead center of the screen? Forgive my ignorance.

John McNamara
02-09-2019, 12:56 AM
Hi Joe

The M'soft webcam I am using appears to have a sensor active area about 2.5mm wide That would help explain why my resolution results are a little more than 3 microns.

Noise. There is a discussion on the MEW site about astronomical photography and the need to reduce noise. Camera sensors for this application are sometimes super cooled to reduce it. No I am not suggesting this level of sophistication for a webcam. However it may partly explain why the measured value particularly the right of the decimal point is ever changing? the first two digits to the right are very important. If they are stable we get a 100 fold increase in accuracy, maybe impossible but worth striving for.

Catenary sag.
For a DIY person setting up say a router with 3 Metre rails roughly what is needed for 2.4 Metre travel, a stretched wire will sag due to gravity. Using your measured value table as a reference and given an input length the calculation could be applied and the true calculated value displayed. The weight of the wire is almost negligible the applied tension can known, say a barbell weight and needs to be input as a constant also. I am not sure how much work this would be to implement in the software, It would be very useful if it can be done.

One of the advantages of stretched wire is that it is very easy to align to high accuracy, 0.0001" positioning is fairly easy to achieve by placing a precision block at each end of the object being measured. By stretching the wire over the blocks you have very stable line parallel to your work piece.

I will run a set of tests tonight at .01mm increments. and check the residual chart. and work on the light source.

Regards
John

John McNamara
02-09-2019, 08:47 AM
Hi Joe
Hi All

Below two images of a test of 0.25mm in 0.01mm steps.

The Dial indicator used was a Mitutoyo 0.01mm resolution unit. Ideally I should have used a higher resolution unit. I have one but I would need to make a mounting base for it. This would reduce the Measurement error slightly. Having said that the residuals look pretty reasonable. I guess I am splitting hairs here.


26385

26386

devmonkey
02-09-2019, 09:50 AM
Hi John,

Let me just sanity check your methodology. You have the sensor or wire on a precision positioning system. You move the system in steps based based on your dial indicator and click measure at each step? Is that correct? Just wanted to check you aren't moving the system until the measure value increases by one step then clicking measure as this would always produce a straight line, I don't think you are doing this but just want to be 100% sure.

You have the umPerPixel set to 1 therefore the numbers you are recording are in the units of pixels, this means anything to the right of the decimal point is to a sub-pixel accuracy. This ok to an extent (say 1 decimal place) but will soon deteriorate into noise. The gaussian fit will be afffected by a single intensity point change of a single pixel that is why you get jitter at extreme sub-pixel resolution. To remove all jitter you would probably have to perform the test under lab conditions in a vacuum to avoid dust particles and with a lab quality camera with high precision pixel exposure times. The exposure times (and therefore the intensity readouts) of these cheap sensors with rolling shutters are not perfect, when a pixel/row is exposed for slightly longer its intensity values will naturally be higher. Couple this with the onboard image processing pipeline that is probably trying to do all sorts or AGC and white balance adjustment and noise is inevitable.The image is then compressed onboard to a jpeg adding all sorts of artifacts before being shipped to the PC.

All that said your 0.01mm test run shows your residuals are within +/- 0.4 pixels or 0.0016mm (think you sensor is ~4um per pixel) of a straight line, this is pretty good isn't it? Shimming or scraping in the 1 micron range is most likely impossible for us and probably completely overwhelmed by the thermal movement of the frame.

The 0.0016mm could as you say be down to trying to position the sensor using a 0.01mm dial indicator, quite difficult to judge 1/10th of one division...and outside the tolerance of the indicator.

I can add warping for the catenary sag if you have the equations?

John McNamara
02-09-2019, 10:12 AM
Hi Joe

The measuring system is just a manually driven XYZ platform

Once set up I only move the webcam The light is at this time fixed and non moving. This is wrong! it should move with the webcam sensor although a 0.25mm movement is pretty small slightly less than 0.010 inches. I am going to work on the light next.

And yes I clicked measure after each movement to the next tick on the dial indicator. The straight line is proof that the system is linear. Subject to my possible manual positioning errors as detailed in my previous post.

And the results we are getting are better and better, once the lighting is sorted I am certain the repeatable accuracy can be improved. Once this is done I really want to try a higher resolution webcam.

Regards
John

devmonkey
02-09-2019, 10:15 AM
Nice work guys. For us laymen, how would this work (once all the problems are worked out) for, say aligning the parallel rails on a Y axis to make them level with each other? Is it just a case of placing the sensor on one rail and the laser on the other and then shimming until the software shows the line dead center of the screen? Forgive my ignorance.

That would get the curve of the rails identical but it wont make them straight nor planar.

I was planning on positioning the laser across the room, levelling one rail, the levelling the other rail to the first rail bringing them into plane. For the Y gantry there are some options, you can do it the same as the X and then adjust for perpendicularity when you assemble the machine either by using a square or by using this laser system in tramming mode. Or you can assemble the machine, straighten one Y rail, then use tramming mode to bring the other into plane.

John McNamara
02-09-2019, 10:35 AM
Hi Joe

Just noticed your comment re the catenary sag. Adding this feature to your software will make it exceptional.

The formula is widely cited the Wiki in this case is a good place to start.
https://en.wikipedia.org/wiki/Catenary#Equation

Once your measurement table is filled with points and the user has input a length The catenary sag allowance at each point can be added to the table. The weight of the wire and the tension applied to it need to be added, they do not change so can be stored constants.

Regards
John

John McNamara
03-09-2019, 01:05 AM
Hi Joe

Correction this line my post above
"
The weight of the wire and the tension applied to it need to be added, they do not change so can be stored constants.
"

Should read
The weight of the wire does change according to its length.

Roslau are are a world leader in music wire manufacture.

This is where I sourced my wire. https://parkepianostrings.com.au/piano-wire-materials-and-tools/
It costs about $40 AUD per coil plus post. they will ship internationally.

Half KG coils of #2 .010" Roslau Blue music wire contain 1250 metres of wire.

Regards
John

John McNamara
16-09-2019, 10:13 AM
Hi All

Today I received a nice webcam in the mail, a gift from a forum member,Thank you.

It uses a smaller sensor than mine so it will be interesting to see how it performs. I will have to make a new mount for it.
For the tests I will use a one micron Maher milemess indicator. that should assist in getting an even better idea of achievable accuracy.

For any members who live in Australia I will be at the MSME exhibition.
https://www.msmee.org.au/

Our club has been meeting since 1926 in Melbourne new members are always welcome.
Or just pop in at out next meeting as a visitor and have a chat.

Regards
John

Kitwn
17-09-2019, 09:47 AM
John,
I have found a dirt cheap webcam online which is very easy to dismantle which I plan to play with once my more urgent project of working out how to successfully cut wooden gears proves fruitful.

Much as I'd love to come and see you at the MSME I'm afraid it's a bit of a long way from here, even though I don't need to show my passport enroute.

Kit

cropwell
17-09-2019, 10:34 AM
Hi Kit,

Inkscape has an add-on that will draw involute toothed gears and gear racks. I have used this to input a dxf into Fusion360 to extrude it to an stl for 3D printing. I haven't yet had the need to cnc cut one though. If you want helical cut teeth you are on your own.

Cheers,

Rob

Kitwn
17-09-2019, 11:47 AM
Rob,
Thanks for the information but I use a rather splendid bit of software called 'gearotic' written by Art Fenerty, the creator of MACH3. For anybody interested in creating gears of any kind you can think of, and several kinds you previously couldn't, and especially anyone who wants to design wooden clocks I can heartily recommend it. The program, not unlike Art himself, is a little eccentric and is therefore, in my humble opinion, well suited to many of the regular contributors to MYCNCUK:joyous: The one-off, minimal license fee entitles you to a lifetime of free upgrades.

Gearotic is brilliant for creating the basic gear design. I then export a DXF file to CamBam for design editing and G-code output.

My problem in cutting wooden gears is that those teeth that have the grain running tangential to the gear wheel tend to chip and break off when cutting. Teeth with the grain running radially are fine. I have managed to successfully cut gears from Jarrah blanks created from six segments with the grain running radially all round but the wastage of timber is criminal. I'm currently experimenting with plain pine blanks stabilised with Cactus Juice resin.

Most wooden clock makers use plywood for the gears but, being me, I want to use various types of better-looking plain timber to produce a more impressive result.

I had thought about starting a new thread asking for help on how to cut these gears if the current experiments don't work. I'd prefer not to hijack this existing discussion.

Kit

John McNamara
22-09-2019, 08:17 AM
Hi All

Today I ran a test on a webcam generously sent to me as a gift from a forum member. A wonderful gesture.

I do not know much about the sensor apart from the fact that it appears to be dated 2012.

The test was made using the sensor and .008" piano wire as done before.

When I tested it with Joe's software it counted 93.7 pixel lines to measure 0.2mm
My previous tests with a Microsoft webcam over the same distance of 0.2mm counted 47.56 lines.

The new tests prove the camera given to me has almost twice the resolution of the Microsoft unit.

0.0021mm or 0.00008 inches. per pixel line.

The new camera also displayed less noise and was less sensitive to stray light. All in all a better unit. I will try to find out more about it.

The latest results have really inspired me to to press on with improving the mounting of the camera and better light control. I will report back here with my results. Maybe the Webcam driver software can be used to adjust the sensitivity. That would be useful.

There may even be higher resolution webcam sensors available.... technology marches on.

The accuracy now already achieved will enable the unit to be used to easily test large precision machine tables for flatness if the catenary equation sag corrections can be applied to the measurements.

All this started with Joe's software, Thanks Joe.

Regards
John

Three images below

26468

26466

26467

devmonkey
29-09-2019, 07:40 PM
Hi All


All this started with Joe's software, Thanks Joe.



Hi John,

You are very welcome, I've been a bit busy with work, great to see you are making progress.

Yes it should be possible to grab higher resolution images from the camera giving you the choice of more dynamic range or adjustable sensitivity.

Cheers, Joe

Sasquatch
16-10-2019, 10:34 PM
Did anybody test flatness of the laser beam yet? I'm impressed with results you're getting and just that one question remains unanswered.
I have garde 00 600x400 mm granite plate, one diagonal(720mm) is within 1 micron.
SJ4000 with large sensor and high resolution and can act as webcam.
just no laser...checking ebay...

John McNamara
17-10-2019, 12:52 AM
Hi Sasquatch

If you study the two test series I did with two different sensors you will see that the resolved measurements taken with the second sensor were better with the higher density (The pixel lines were closer together), sensor used for the second set of tests.

No lens was used just the wire shadow.

Devmonkey mentioned that the results were better without a lens when he did tests with a laser. Using a lens with the laser generated distortion? I can also confirm this when I tried using a laser with a lens.

Maybe the standard lens supplied with a webcam or action cam is not the ideal for working with a laser. I know industrial laser cutters use lenses made from Germanium and other exotic materials.

A friend who spent his working life as a physics lab tech also mentioned that webcams will probably have a red filter behind the lens and in front of the sensor. He suggested that this should be removed if working with laser light.

These are only study notes on my part, I wish I knew more about optics. Maybe one of the MYCNCUK members here can give a more qualified view?

Regards
John

Sasquatch
17-10-2019, 06:43 AM
Hi John.
My action cam lost lenses in shooting accident (air rifle ricochet).
Flare with lenses is an result of partial reflection on each layer of glass/ plastic beam is passing trough.
My action cam had a infrared filter behind the lenses.
Sensor is about 3x4 mm 1080p gives higher pixel density than 2 mm wide VGA sensor. Should be good.

Can't find any lasers with single cylinder lense. No Dewalt dw088 on ebay UK in acceptable price. Any cheap laser recommendations ?
Edit 1:

Figured out easy and cheap way of testing projected line straightness.
Method requires roughly straight surface, aluminium extrusion should do. Surface must only be flat within sensor measurement area.
line laser
pointer laser
2x camera sensors set 90 degrees to each other.
first camera is following pointer aiming along the beam
second camera is following projected line
With some excel magic we can deduct straightness of projected laser line independently of any beam errors.
Given we can get 3-4 microns resolution on both sensors accumulated measurements arrors should be below 0.01mm in worst case ->just a gut feeling, no real maths behind it so feel free to correct me. That should be more accurate than any straight edge one could buy, as 0.01mm over, say 3 meters, is waay beyond din 874/0. and sag on wire could be greater than 0.01mm too?

Edit 2:
Software feature request:
Can we have adjustable capture resolution,since higher res cameras have bigger sensors allowing wider beams and/or wider measurements range?
Or at least run in maximum supported resolution, whichever is easiest.
Also when requesting VGA stream from 1080p sensor camera firmware is scaling each frame introducing errors.

Edit 3:
Created pull request on GitHub with more resolutions possible.
Unfortunately i can't figure out how to add menus to change resolution nor how to pass resolution via command line parameters.
Just edit settigs.java and rebuild to required resolution, supported are 320x240,640x480,800x600, 1280x720 and 1920x1080.
Hope that @devmonkey don't mind and will add settings menu in free time.

devmonkey
17-10-2019, 02:41 PM
Sasquatch,

I haven't got one myself but this laser looks very promising with a glass cylindrical lens.
https://banggood.app.link/PPKk7DZpR0

Will integrate your resolution changes when I get time.

Cheers, Joe

devmonkey
17-10-2019, 03:12 PM
I've committed a change so that it determines the maximum native resolution of the camera and uses that, please test.

Cheers, Joe

Sasquatch
17-10-2019, 04:59 PM
I've committed a change so that it determines the maximum native resolution of the camera and uses that, please test.

Cheers, Joe

You're a star Joe.
But it defaults to 640x480 on SJ4000. "proper" webcam could be working ok, although windows10 camera app detects it as 1280x720(max video output for sj4000)
Saying that, SxrosCamera by default don't support anything above 640x480, hence you have to define custom dimensions for higher resolutions.
It defaulted to maximum resolution supported by SxrosCamera without custom dimensions defined.
Cheers Les.

devmonkey
17-10-2019, 06:25 PM
You're a star Joe.
But it defaults to 640x480 on SJ4000. "proper" webcam could be working ok, although windows10 camera app detects it as 1280x720(max video output for sj4000)
Saying that, SxrosCamera by default don't support anything above 640x480, hence you have to define custom dimensions for higher resolutions.
It defaulted to maximum resolution supported by SxrosCamera without custom dimensions defined.
Cheers Les.

So we can't make it automatically pick the max resolution? If we pick the wrong one presumably it crashes the driver? I don't have a higher res camera to test with.

Edit
Ok so it looks like Sarxos is using a driver on Windows that doesn't do resolution detection, are you using windows? We could change it so that we force a specific driver per platform but then it becomes a bit of a nightmare to package. Will have to have a think.

Sasquatch
17-10-2019, 07:04 PM
Yes I'm running it under windows.
If I only change resolution to anything above 640x480 in settings.java it crashes saying that correct resolutions are 174xsomething 320x240 and 640x480
Defining custom dimension as per sarxos manual and FAQ(look at my pull request) allows to select any resolution. I tried 4000x3000(max res of my sensor) but image quality suggested it was still 1280x720, makes sense.
Maybe defining custom resolutions and then autos election would work?

devmonkey
17-10-2019, 07:55 PM
The trouble with asking for a custom large resolution is the camera encoder chip can choose to scale it for you if it is larger than the sensor. It seems there is no reasonable solution without forcing a windows specific driver which will actually query the camera for the supported resolutions. Will look into this when I have more time. Almost all cheap cameras makers lie about the resolution of their sensors as well so we can't rely on the user inputing whatever resolution is 'written on the box'.

I did look at your pull request, but I don't think it works generally for everyone as if you request a non-native resolution the camera chip can choose to scale it for you.

Sasquatch
17-10-2019, 08:39 PM
Totally agree on my pull request, not suited for all(most?) cameras.
My understanding is that sarxos don't support higher resolution at all, unless you define them. At least that's what i understood from quick look at sarxos examples ad faq. I may be completely wrong.
My idea is to try defining "custom" resolutions and then running auto detect. I'll try it tomorrow afternoon, as now i left camera at workshop.
But before that I'll try your auto detection solution under Linux, Ubuntu and PureOs(both debian based).
As for now i can't even check benefits of higher resolution as my laser pointer is extremely noisy and line laser will twke 7-15 days to arrive, absolutely no pressure.

Sasquatch
18-10-2019, 09:13 PM
Jar from GitHub loads on Ubuntu, detects max resolution as 640x480 then fails. i'm getting blank window and null pointer exception in NextFrame method.

Built from GitHub source on Ubuntu runs ok, detects max resolution as 640x480.

It is indeed driver issue, apparently there is no single driver working on all platforms, those working in Windows/Linux won't work on Mac. And those working on MAC/Linux won't work on Windows.

Just make an option in preferences to select resolution. People using that kind of software should be techie enough no know how to check max supported resolution of their camera?

Did some testing today. SJ4000 gives resolution of 3.75um per pixel in 1280x720 video mode. 4.8mm active sensor width.
If LaserLevel could work with stills, I could get 1.2um per pixel from that camera. Waaay too sensitive, or is it?

Sasquatch
05-11-2019, 06:48 PM
My laser finally arrived, and...judge yourself.
camera fitted in precision vice riding on grade 00 18"x 24" granite.
Running across the beam i'm getting 0.04mm deviation from straight line on ~500mm distance
Running away from laser I'm getting 0.02mm deviation on ~500mm distance.
Beam is changing width and apparently this change is not symmetrical.
I was getting same results with pointer laser(runnig away from it), but assumed that irregular dot with surrounding artefacts was to blame.
It's still viable way of checking linearity, but as shadow camera and wire. Cheap(£25, glass lens, 80 MW) lasers are not precise enough. maybe £500 line laser could be used, but for such money there's plenty other options.

Sasquatch
05-11-2019, 06:48 PM
My laser finally arrived, and...judge yourself.
camera fitted in precision vice riding on grade 00 18"x 24" granite.
Running across the beam i'm getting 0.04mm deviation from straight line on ~500mm distance
Running away from laser I'm getting 0.02mm deviation on ~500mm distance.
Beam is changing width and apparently this change is not symmetrical.
I was getting same results with pointer laser(runnig away from it), but assumed that irregular dot with surrounding artefacts was to blame.
It's still viable way of checking linearity, but as shadow camera and wire. Cheap(£25, glass lens, 80 MW) lasers are not precise enough. maybe £500 line laser could be used, but for such money there's plenty other options.

devmonkey
05-11-2019, 11:17 PM
Do you have any pics of your laser and sensor? I think there is something strange going on with your setup if you see errors moving the sensor along the laser axis. Is the laser spreading? Have you removed all optics and filters from the sensor and bolted the pcb to something solid? We do know that the laser beam is not bending in the air so something else is wrong.

Sasquatch
06-11-2019, 09:36 AM
Bare sensor, unless there is anti aliasing filter glued to silicon, but AFAIK it's DSLR's area.
Stripping further is not really an option, not usable as shadow camera as there are modular PCB's perpendicular to the sensor sticking above it's surface. Webcam incoming.
http://sasquatchv.eu/images/2019/11/06/DSC_0048.md.jpg (http://sasquatchv.eu/image/UVem)
http://sasquatchv.eu/images/2019/11/06/DSC_0049.md.jpg (http://sasquatchv.eu/image/UK8G)

Cable is clamped, moving laptop around has no impact on measurements when camera is stationary.

Thinking about it makes no sense.
Both lasers are focusable, both are set to project same width/size line/dot at 8 meters and 20 cm.
They might be represented as
http://sasquatchv.eu/images/2019/11/06/15730287733068888530237120005756.md.jpg (http://sasquatchv.eu/image/UWh9)
Laser diodes are not perfect, if one edge is brighter (double line above) average brightness will still be straight line
Pointer produces coupe stray beams right next to the main point, that could be source of the problem.
with line laser i have no idea.

devmonkey
06-11-2019, 01:55 PM
It could be aliasing from reflections on the lens holder thread, I got much better results with the sensor mounted with nothing close to it in the near field. See picture below, that window started off as a 6mm round hole, it caused aliasing hence I opened it up so no reflected laser light could hit the sensor.
26688
I don't know much about dslrs but maybe it could have lens distortion correction built in which would be warping the image non-linearly across the sensor. Have you got a cheap web cam to try with? It is also unlikely that sensor pcb is hard fixed to the body, the ones i've take apart are usually on soft mounts that let the board move around to absorb shocks.

Sasquatch
06-11-2019, 02:04 PM
It's cheap Sj4000 clone distortion is massive, if there is correction it does very bad job. I have cheap webcam and 0.08mm steel wire on order. Will try both laser and wire to rule out sensor nonlinearity errors.

devmonkey
08-11-2019, 10:52 AM
It's cheap Sj4000 clone distortion is massive, if there is correction it does very bad job. I have cheap webcam and 0.08mm steel wire on order. Will try both laser and wire to rule out sensor nonlinearity errors.

One other thing that occurred to me, how did you ensure you moved the sensor/vice assembly absolutely in a straight line? Any deviation in this procedure would show up as non-linear errors in your linearity measure since it would have been impossible to get the laser perfectly planar with the granite. This applies to both types of laser dot and line. I think you need a precision straight edge as well as the reference surface to check the accuracy of the system.

Sasquatch
08-11-2019, 01:30 PM
One other thing that occurred to me, how did you ensure you moved the sensor/vice assembly absolutely in a straight line? Any deviation in this procedure would show up as non-linear errors in your linearity measure since it would have been impossible to get the laser perfectly planar with the granite. This applies to both types of laser dot and line. I think you need a precision straight edge as well as the reference surface to check the accuracy of the system.

I used straight edge clamped to the granite, just as you said.

Cheap webcam arrived, useless with lasers, sensor is smaller than the beam, will test it with wire when it gets here.

devmonkey
08-11-2019, 03:59 PM
I used straight edge clamped to the granite, just as you said.

Cheap webcam arrived, useless with lasers, sensor is smaller than the beam, will test it with wire when it gets here.

Sounds like your laser is no good, can you post a picture of it? Even my dewalt laser level produces a line narrower than the VGA sensor.

Michael Gilligan
26-11-2019, 10:24 AM
Greetings from NorthWest England

I was alerted to this very interesting project by John McNamara [many thanks, John] and have joined the forum to participate in this discussion. ... Hopefully I can be of some help on the optical side of things, but this first post concerns the software:

I have tried running the current version on my 2009 MacBook Pro, under el Capitan, and everything seemed fine except that I could not close the application ... it did not even respond to ‘Force Quit’ and I was obliged to re-boot the machine.

Windows users have a .bat file; so I am wondering if some ‘initialisation’ might be required before Java is happy running the application under OS X

I would be most grateful if anyone can advise.

MichaelG.

devmonkey
26-11-2019, 11:29 AM
Hi Michael,

Welcome! I haven't tried it under OSX, but I'm pretty sure someone in this thread did.

It might well be a driver issue with it not unloading properly, unfortunately I don't have a mac book pro old enough to replicate your system.

Joe

Michael Gilligan
26-11-2019, 11:39 AM
Thanks for the prompt reply, Joe

Hopefully there is someone else out there, limping along with a much-loved but obsolete Mac !

MichaelG.

.

Edit: I’ve just tried a little ‘self-help’ and found this: [/URL]
[url]https://apple.stackexchange.com/questions/250030/java-application-wont-force-quit-prevents-shutdown (https://apple.stackexchange.com/questions/250030/java-application-wont-force-quit-prevents-shutdown)

Unfortunately it is beyond my comprehension.

AndyUK
26-11-2019, 01:56 PM
Edit: I’ve just tried a little ‘self-help’ and found this: [/URL]
[url]https://apple.stackexchange.com/questions/250030/java-application-wont-force-quit-prevents-shutdown (https://apple.stackexchange.com/questions/250030/java-application-wont-force-quit-prevents-shutdown)
Unfortunately it is beyond my comprehension.

As far as I can see, that's just talking about the issue and other ways to force quit the application.

I'd try uninstalling and reinstalling java on your Mac.

Failing that, you could try running Linux in a virtual machine, and download Java onto that. I'm a fan of Oracle's Virtualbox.

Michael Gilligan
26-11-2019, 03:42 PM
Thanks, Andy

I will try a clean install of Java this evening
... There have been several versions on my Mac over the years, so perhaps there is something unnecessary lurking.

MichaelG.

.

Edit:
I removed all trace of Java from the machine [following Oracle's instructions], and installed afresh:
____ You have the recommended Java installed (Version 8 Update 231) ____

For whatever reason: The application now closes as it should. ... Thanks again, Andy

John McNamara
27-11-2019, 11:47 AM
Hi Michael :)

I am glad you have popped in here to shed a little light on the optical side of these experiments.

Regards
John

Michael Gilligan
28-11-2019, 10:16 AM
I think it worth sharing this FAQ answer from Edmund Optics:


Frequently Asked Question
Question

What is the difference between refractive and diffractive line generators?

Answer

A refractive line generator uses a cylinder or rod lens to focus a laser in only one axis only (drop-moved placement) in order to create a line of light. A diffractive line generator uses a flat optic with an etched microstructure that breaks apart a laser beam and forms an interference pattern in the shape of a laser line. Refractive optics do not correct for the inherent Gaussian profile of a laser beam and form a line with a "hot spot" in the center and fading edges. Diffractive optics will create a line that is uniform in thickness over its length, but is segmented. Diffractive line generators also cause a small portion of the light to be redirected into different diffractive orders, which causes additional faint lines to appear. Some laser line generators use a unique patented Powell glass lens design in order to achieve a continuous (not segmented) line with an even distribution along the length of the line.

Here is Powell’s patent:
https://worldwide.espacenet.com/publicationDetails/originalDocument?CC=US&NR=4826299A&KC=A&FT=D&ND=3&date=19890502&DB=EPODOC&locale=en_EP

and a more comprehensible description:
https://www.laserlineoptics.com/powell_primer.html

MichaelG.

John McNamara
28-11-2019, 09:44 PM
Hi Michael

Buying A Powell lens from Laserline, Edmund or other big optical equipment suppliers is pretty expensive starting at around $250 USD. I did a little google search and found a few from Ebay etc. at a more reasonable cost for an amateur experimenter. The question is which one?

I have not yet got my head around what would be the ideal angle for the Powell lens assuming that the l operating range is from 100 to say 3000mm.

The laser driving the unit also is also a consideration I nice clean spot is required.

Regards
John

https://www.google.com/search?q=powell%20lens&rlz=1C1ASUT_enAU791AU791&source=lnms&tbm=shop&sa=X&ved=2ahUKEwj0gr-c343mAhXETX0KHVM4BAwQ_AUoAXoECA8QAw&biw=1536&bih=792&oq=powell%20lens#spd=0

Michael Gilligan
28-11-2019, 11:44 PM
You’re quite right, John ... they are pricey, ‘though It’s encouraging to see better prices on ebay

My post was really just for technical information.

For what you are are doing [with the wire shadow and very small displacements], I don’t think you need worry about laser lines anyway: Unless I am very much mistaken, you could use any collimated light-source that filled the area of the sensor.

As for laser spot quality ... the classic solution is to use ‘Spatial Filtering’ ... but that’s another potentially costly and bulky solution to a problem that might not exist.

My impression is that this project is all about leveraging the precision of mass-market sensors with ingenious software.

MichaelG.

devmonkey
05-12-2019, 12:10 AM
Hi Michael,

Do you have a view on how flat the projected plane of a cylindrical lens laser line is likely to be? This is something I still haven't measured as I have no large enough reference plane.
Along a given ray it should be absolutely straight but will it undulate across 'rays'? By ray I mean a line from laser source to sensor.

My latest thoughts on how to measure this was to place four pillars in a square on a reasonably flat stable surface (concrete floor). Place the laser so that it projects across the tops of the four pillars and use height readings from 3 of them (as any 3 points will be planar) to bring the fourth into plane with some shimming. Now move the laser around the room and have it cast a different area of the beam over the pillars and measure again, check if all 4 pillars are still planar, repeat this a few times.

Thanks, Joe

Michael Gilligan
05-12-2019, 11:22 AM
That’s a tricky question, Joe ... but here’s the best I can do for the moment:

In an ideal world, a perfect laser beam would would be refracted by a perfectly cylindrical lens to produce a perfect line on a cylindrical surface.

In the real world, however: Our ‘laser diode’ is an imperfect source and will be refracted by imperfect optics ... with the inevitable consequence that the line will be imperfect.

That said: Your proposed test seems very appropriate.

MichaelG.
.

Edit: This is a little laboured, and is intended for an audience of ophthalmic opticians, but it may be helpful to anyone struggling with the general concept of cylindrical lenses: https://youtu.be/vHugCo2md_o
.
Edit: Note, however, that for the laser line generator we are using a [B]negative cylindrical lens
... See Application 8, here: https://www.newport.com/n/beam-shaping-with-cylindrical-lenses
... and for convenience, here’s a direct link to Application 1: https://www.newport.com/n/focusing-and-collimating

devmonkey
05-12-2019, 11:41 AM
Ok, but would the line just be noisy or would/could it be bent? I'm not sure I fully grasp how the source is refracted by the cylinder, specifically is it true that a given arc segment of the cylinder is generating a corresponding section of the line or does the entire arc of the cylinder contribute to every part of the line? If the latter then cylinder imperfections would produce nose whereas if former then the line could be bent.

Michael Gilligan
05-12-2019, 12:30 PM
I'm not sure I fully grasp how the source is refracted by the cylinder, […].

Ray-tracing would help you understand ... but be warned ... it’s tedious !!

If I can find an easy and convincing answer to your question, I will post it [but don’t hold your breath]

MichaelG.

devmonkey
05-12-2019, 12:54 PM
Don't get me wrong I understand how refraction works, what we need to understand is given the light source is not perfect nor perfectly collimated and cylinder is not perfect can these imperfections add up to a line that is bent, or just a line that is noisy (which is fine for our purposes). Presuming that the ideal model of refraction we get taught is not what actually occurs in the real world.

Michael Gilligan
05-12-2019, 02:31 PM
For the present purposes, I’m pretty sure that we can take the line as being straight but fuzzy [i.e. noisy]
... Like so many things though: The closer you look, the more difficult it gets to describe.

This is what I find so impressive about this project ... the software is effectively using a ‘best fit’ definition of the line.

MichaelG.

.

P.S. for what it’s worth ... here are some numbers from the specification of a ‘metrology-grade’ unit:

Beam Profile Line
Power Distribution over 16 mm ±10 %
Fan Angle 18 °
Focal Distance (factory preset) 180 (±2) mm
Line Length (@ focal distance) ~ 45 mm
Line Width (@ focal distance) 50 (±10) µm
Alignment of Optical to Mechanical Axis ≤ 0.6 mrad
Line Straightness (max. deviation from ideal line) ±2 µm (over 16 mm)
Depth of field (laser line < 60 µm) min. ± 5 mm

Michael Gilligan
08-12-2019, 10:35 AM
... can these imperfections add up to a line that is bent, or just a line that is noisy

Hopefully this was evident from my last response, but:
For clarity, the short answer to that question would be Yes, all results are possible.
... You will see that the quoted specification addresses that ‘uncertainty’ by stating tolerance bands.

MichaelG.

driftspin
23-12-2019, 08:13 PM
Hi guys..

Can you point me to a cheap (well eh not too expensive) webcam model that might work well, maybe an hd model that has bigger cmos area?



I have moved my machine and want to setup using this method.

I have bought the bosch Quigo self leveling laser for some jobs around the house.
It is a crosshair type laserpointer.

Grtz Bert.





Verstuurd vanaf mijn SM-A320FL met Tapatalk

devmonkey
23-12-2019, 09:08 PM
Hi Bert, I use these, only vga but work really well and super easy to take apart and remount on and solid block.

KKmoon USB 2.0 50.0 M Webcam, HD Camera, Web Cam with Microphone for Computer, PC, Laptop, Black https://www.amazon.co.uk/dp/B01L1XAQAS/ref=cm_sw_r_cp_apa_i_Y2raEbA1MMSQJ

devmonkey
04-01-2020, 05:44 PM
I took a punt and picked up a cheap (£25) Bosch laser today. Main reason was I don't want to tear apart my Dewalt and remove the lasers from the pendulum which I think would be required for our purposes. The Bosch unit has the laser firmly mounted into an aluminium chassis, it is actually quite a decent unit. The laser has a cylindrical lens albeit made of plastic. The lens produces an asymetric line, much more line to one side than the other, but I think this is by design as without the pendulum you couldn't use it to level across a transverse wall as well as the wall you have fixed it to, I think it is inconsequential for our purposes.

Anyway I ripped it apart for your pleasure see photos below. I have also tested it with my levelling software and it works very nicely, I think the laser line is slightly thicker than the dewalt but the app can still consistently locate the centre. It is sufficiently solid, from the exposed casting right to the laser which is both clamped and glued as is the lens, to clamp it directly to something in the garage, the laser will not move at all relative to the chassis which is ideal.

Over the next few days I'm going to attempt to map the surface of my new machine frame I'm building on my other thread using this system, will report back with the findings.

26995 26996 26997 26998

As a bonus it has a dot laser in the other end which I can maybe use for straightening the master rail.

devmonkey
05-01-2020, 02:46 PM
This morning I had an empty house so I grabbed the opportunity to do some testing. I used the dewalt laser and my mostly completed gantry, the sensor was clamped to the rear of the lower Y bearing plate and both laser and gantry placed on a 1inch granite slab (kitchen island). Initially I raised the gantry to clear the Z axis on parts of the spindle mount but it turned out these are not machined with parallel faces on each end and I could rock the gantry a few thou, so swapped them out for two hardwood beams.

27001 27002 27003 27004

The test involved two passes in opposite directions moving the Z axis one hiwin bolt hole (approximately by eye), these are on 60mm centres, and sampling the sensor at each hole, I took 9 samples per pass, so around 500mm of travel for each pass. The residuals from a straight line were calculated by the app for each pass.

The two passes (with second reversed so they can be overlayed) are charted below, together with the difference between the passes.

27005

The two passes were fairly consistent given the eye balled positioning I used, and that I hadn't clamped the laser nor the gantry to the granite. Worst case absolute error between the passes was 8 microns (0.31 thou). The sensitivity is ridiculous as I could flex the granite plate more than this by pressing on it.

However it can be seen that the either the gantry or the laser or both are not perfectly straight with a max variance of +/- 40 um (1.57 thou). The results are satisfactory however we return to the problem of not knowing if the laser line is straight, question is do we care about a couple of thou?

Unfortunately I ran out of time to repeat the test with the Bosch laser, I will need to setup this experiment on the concrete garage floor. It is a waste of time trying to do any measuring if people are moving about in the house as you can see every footstep within 5m move the sensor reading.

I also noticed that the laser form wasn't a very good gaussian and near the edges of the dynamic range, i.e. where the laser was starting to drift off the top or bottom of the sensor, the beam centre looked quite arbitrary to me, I think I may add a new detection mode that finds the centre based on the maximum local average reading.

A couple of other points of note,
1. ~2mm dynamic range of the vga sensor is not very much, it would be easier with a sensor with large area.
2. dust on the sensor has an impact on the readings if the particle is large enough.

Neale
05-01-2020, 03:31 PM
Forgive me jumping in (and apologies if I've missed something) but is the geometry of the measuring setup ideal? As mentioned, the measurements are dependent both on the straightness of the rail and of the beam itself and it's not really possible to separate out the two. If you turned the sensor through 90deg so that it looked along a line parallel to the gantry, and placed the line source just off the end of the gantry but with the laser line intersecting the sensor, you would then be moving the target down the length of the beam (straight apart from gravitational bending!) rather than relying on the optical quality of the cylindrical lens generating an accurately straight line. However, you would need to get the laser line horizontal to reasonably close limits both on the roll and pitch axes (if that makes sense).

When I first started following this thread I had a picture in my mind of a point laser shooting a beam parallel to the rail being measured and striking the sensor in the middle. What I have described above is really only the same thing but using a line source to make lateral alignment less critical.

Or I might have missed the point but I do find this whole exercise very interesting to follow.

devmonkey
05-01-2020, 04:41 PM
Forgive me jumping in (and apologies if I've missed something) but is the geometry of the measuring setup ideal? As mentioned, the measurements are dependent both on the straightness of the rail and of the beam itself and it's not really possible to separate out the two. If you turned the sensor through 90deg so that it looked along a line parallel to the gantry, and placed the line source just off the end of the gantry but with the laser line intersecting the sensor, you would then be moving the target down the length of the beam (straight apart from gravitational bending!) rather than relying on the optical quality of the cylindrical lens generating an accurately straight line. However, you would need to get the laser line horizontal to reasonably close limits both on the roll and pitch axes (if that makes sense).

When I first started following this thread I had a picture in my mind of a point laser shooting a beam parallel to the rail being measured and striking the sensor in the middle. What I have described above is really only the same thing but using a line source to make lateral alignment less critical.

Or I might have missed the point but I do find this whole exercise very interesting to follow.

Hi Neale,

That works fine for checking something is straight, what I'm trying to do here is build a system that can check things are planar, e.g. for bringing the two X rails into plane, hence the line laser.

One idea to separate the gantry error in this test from the laser error is to run the test twice with different sections of the laser line.

I've just tried a much better detection algo, what it does is find the simple maxima of a moving average window of image rows, it then fits a gaussian to this window only, ideally it would just fit a parabola but I haven't coded that. Readings are now much more stable across the entire dynamic range and it works better with wobbly beam cross sections. Just need to migrate to the cold garage to test it.

I think a reasonable measure for success would be for the system to meet din 876 grade 1, which for a surface plate 600mm long means 16um variation in height. The cost of such a plate for my machine is £5500 !
https://shop.mitutoyo.eu/web/mitutoyo/en/mitutoyo/1300091726531/Cast%20Iron%20Surface%20Plate%2C%20DIN%20876/$catalogue/mitutoyoData/PR/902-308/index.xhtml

John McNamara
07-01-2020, 11:10 AM
Hi Joe (Devmonkey)

Firstly... Happy New Year! I hope 2020 is a good year for all.

That new algo sounds interesting.

I wonder if it will also improve the resolution for stretched wire as well?

While you are at it it would help if there was some sort of adjustment to compensate for the image brightness and or contrast. I found this was quite sensitive when backlighting the stretched wire. some sort of adjustment would be helpful.

Anyway looking forward to testing the new algo and comparing the results to my old tests as disclosed here in this thread using the previous algo when you have the time to upload the new one.

Regards
John

devmonkey
07-01-2020, 11:28 AM
Hi John,

The algo changes are committed so you can re-download and test. In settings the there is a new 'model' field, this takes a number 0->4 inclusive.

0: Old global gaussian fit,
1: Simple global energy maxima
2. New global parabolic fit
3: Local energy maxima then gaussian fit around this maxima
4: Local energy maxima then parabolic fit around this maxima

For laser the best is 4, please let me know for the wire, you may find that since the wire shadow is much less noisy and narrower than the laser that the original model works best still. Also note I have increased the default smoothing (settings->smoothingFactor from 3 to 20), you may want to reduce this for the wire shadow as it is narrower.

devmonkey
07-01-2020, 12:52 PM
So I ran another set of tests directly on my granite island without the gantry, all tests were with the cheap Bosch laser. I ran 3 tests, each measuring 10 stations over 500mm with the laser position moved between each test. Each test consisted of 4 runs, 2 forwards, 2 reverse.

The laser was positioned as follows for the 3 tests

1. Planar test with laser orthogonal to ruler taped to island from a distance of 1.5m so the laser line spanned the ruler.
2. Planar test with laser in same position as (1) but rotated 45 degrees to test a different section of the laser line.
3. Straightness test with laser inline with the rule, i.e. shining along the rulers length.

The idea was that 1 and 2 would test different parts of the laser line arc (say 45 degrees of arc per test), whilst test 3 would use only a tiny part of laser arc, less than 1 degree. The test surface is a granite island that most likely isn't flat but is stable, flatness doesn't matter here as we are testing the laser not the island.

Consistency between the runs of each test was very good, with an peak-peak repeatability error of a few microns, likely due to me eyeballing the station locations against the ruler markings.

The chart below shows the results, overlayed on each other. You can see at a glance the 4 runs for each test are highly internally consistent but that the results vary considerably between tests 1-3. All are parabolic suggesting the granite island has a parabolic surface error of around 100 microns. The jagged line group is test 1, the slightly lower group is test 2 and the lowest group is the straightness test 3.

27009

So this is telling me that the laser line generator is not very straight and has a parabolic nature to it with more noise in the test 1 arc than the test 2 arc.

Since test 3 used a tiny part of the laser arc and light travels in a straight line I think we can assume the test 3 line accurately reflects the true surface straightness of the granite island.

Separated out this is the chart for test 3.

27010

So (although I cannot be 100% sure without a calibrated reference surface) I think this system is suitable for verifying something is straight. This means it can substitute for the usual straightness test of using a precision level to straighten a rail in the horizontal plane or a tight wire to straighten a rail in the vertical plane. However it needs a better laser or a different approach for checking two things are planar.

I have done a bit of research on how this is done in the optical metrology industry and although they use exactly the same approach of measuring height deviations from the test piece to a planar sheet of laser light they also without exception use a rotating laser rather than a line generating lens. Infact they use something called a penta-prism which bends a laser beam 90 degrees irrespective of the the angle of incidence of the beam to the prism. This means so long as the laser is fixed solidly and somewhat vertical as the prism is rotated above the beam in a solid bearing you will cast a perfect plane irrespective of bearing runout or laser prism miss-alignment.

Unfortunately penta-prisms with a few arc-seconds of accuracy are rather expensive. If you use a cheap less accurate one then you could well be casting a cone rather than a plane as you rotate the prism.

devmonkey
07-01-2020, 03:21 PM
One final test, I repeated the straightness test on my milling machine table, again 10 stations over 500mm, 3 runs again eyeballed off a ruler bolted to the table. The table is pretty straight within +/- 0.01mm over 500mm.

27011

It is certainly much straighter than my kitchen island !

I did this test very quickly and it wasn't performed perfectly, for example the laser was really too close sensor meaning that the sensor was saturated or nearly saturated around the beam, this would lead to a little inaccuracy as the maxima is effectively on a flat peak, it would be better if the laser was further away reducing its brightness.

devmonkey
07-01-2020, 03:41 PM
Forgot to add you can now press 'z' to zero and 'm' to take measurements during a run, this is much easier at least for me rather than fiddling with the mouse.

devmonkey
09-01-2020, 02:49 PM
So I have 'borrowed' a much higher quality line laser with decent optics, and believe I have verified that line lasers are not straight. Setup was with the sensor on my milling table moving along 10 stations over 500mm against a ruler that was clamped to the table. Note the sensor was moved, the table was stationary to avoid any rocking on the saddle block.

The laser was setup in a fixture about 2m away so that it projected its line across the top of the table hitting the sensor. The fixture allowed the laser to be rotated so I did 4 runs then flipped the laser 180 degrees axially (so the projected line was now inverted wrt the first runs) and did 4 more runs.

I think this suggests that this laser has a parabolic error in its cylindrical lens or the lens alignment, what do you think? Chart shows all 8 runs, you can clearly see two groups of 4 parabolas, one group the inverse of the other, this parabolic error is greater than any error in table straightness.

27035

Kitwn
10-01-2020, 03:39 AM
Joe,
I doubt I will ever be measuring to a few microns in my own workshop but I love the way you are making such precision achievable in a DIY environment. The revelation about the non-straight laser is important but presumably the ability to invert it means the error can be quantified and allowed for. Does this mean a cheap line laser mounted in a suitable rotating/inverting housing could be virtually as accurate as the high quality one?

Kit

Kitwn
10-01-2020, 04:26 AM
Joe,
Whilst replying on your build thread an idea came to me. I'd be interested in comments on it's practicality:

Could your laser leveling camera and software, possibly using a taught wire as John is doing, be used to measure the height errors as a gantry machine moves along it's imperfect rails and edit the Z axis G-code to correct for them in much the same way as a probe is used to measure and correct flatness errors in PCB cutting?

In this way a machine of modest accuracy could be used to build parts for a better one. I'm thinking specifically of jobs like grinding the top of gantry profile as you have done for your build.

Initially I'm thinking of only flattening a linear cut as above but since your stated aim is making planar measurements is it reasonable to think of correcting over an area in order to turn plain old ally plate into something approaching tooling plate or even turn a piece of granite worktop into a reasonably accurate surface plate?

Kit

John McNamara
10-01-2020, 04:47 AM
Hi All

My Recovering from the holliday's brain has been thinking on line generation.

Having disassembled many laser printers over the years I found in many of them the single point laser was scanned across the page by a (single point) laser beam reflected by a rotating polygon prism and a very nicely ground asymmetric lens.

My first thoughts were that the integral laser fitted to these units may be invisible and possibly dangerous.
So the manufacturers laser diode would have to go and be replaced by a known and safe (BUT YOU SHOULD NEVER LOOK INTO THE BEAM) of any visible laser.

The ground asymmetric lens is an unknown? It may not be of the correct focal length for our application?

This leaves the rotating prism with surface coated mirror facets.
It is driven by a nice control circuit that will be easy to interface.

I have a few modules recovered from scrapped laserjet 3 Any machine with a Canon SX series engine is likely to be similar. I have a couple of laserjet 3 modules kept for an idea like this.

Scanner modules are fairly cheap $20 to $50
Or you may already have one similar? All we are after it the rotating prism.

If this concept proves doable we can generate a nice scanned plane.

Remember in this case the laser itself is not rotated the prism simply reflects the beam as it is rotated through an arc that changes as the reflecting mirror angle changes.
The laser and scanning mirror unit will need to be located far enough away for the beam to cover all the needed measurement points.

It should have three leveling feet.


https://www.google.com/search?q=laserjet+3+laser+scanner+module&source=lnms&tbm=isch&sa=X&ved=2ahUKEwjcwZLHjPjmAhV74HMBHQatDQcQ_AUoAXoECAwQA w&biw=1045&bih=547

Regards
John

John McNamara
10-01-2020, 07:24 AM
Hi All
some homework for the weekend.

A general search using... diy scanner module from laser printer

https://www.google.com/search?ei=pBQYXsPxHI3ez7sPqeCm4AY&q=diy+scanner+module+from+laser+printer&oq=diy+scanner+module+from+laser+printer&gs_l=psy-ab.3...8588.9973..10138...0.3..0.175.646.0j4...... 0....1..gws-wiz.......0i71.kTtlA7Lb0eo&ved=0ahUKEwjD0-qHr_jmAhUN73MBHSmwCWwQ4dUDCAs&uact=5

Also found this

https://www.ebay.com.au/i/263894368122?chn=ps&norover=1&mkevt=1&mkrid=705-139619-5960-0&mkcid=2&itemid=263894368122&targetid=832780663387&device=c&mktype=pla&googleloc=9071333&poi=&campaignid=7787616402&mkgroupid=82303623032&rlsatarget=pla-832780663387&abcId=578876&merchantid=7364522&gclid=EAIaIQobChMI2reWmrH45gIVQY6PCh06GAREEAkYCSAB EgJdBPD_BwE

Among these

https://www.google.com/search?q=sweep+lidar&source=lnms&tbm=shop&sa=X&ved=2ahUKEwil67GYsfjmAhXT73MBHd-VDm8Q_AUoAXoECAwQAw&biw=1045&bih=547#spd=8087799023353302373

And this from Bangood
Looks similar to the first one but costs more.

https://www.banggood.com/SLAMTEC-RPLIDAR-A1-2D-360-Degree-12-Meters-Scanning-Radius-2D-Laser-Range-Distance-Lidar-Sensor-Scanner-for-Obstacle-Avoidance-and-Navigation-of-Robots-p-1596463.html?rmmds=buy&cur_warehouse=CN

Regards
John

devmonkey
10-01-2020, 10:03 AM
Hi John,

Do you have a picture of the 'polygon' prism from the laser printer? Is it a penta-prism? If so then this would be suitable, if it is just a 90 degree mirror then we wouldn't be able to align it accurately enough. I have been looking for a penta prism, we would need an accurate one, most are specified in arcminute accuracy but the super precision ones are around a few arcseconds. I'm guessing this means is that over 1 meter the error in height measurement due to the prism would be:

1 arcminute: 290um (a massive 0.29mm)
1 arcsecond: 5um

So this begs the question, how accurate are these super expensive industrial machine levelling metrology systems that use lasers? What I have now with the cheap laser and camera sensor is within say 50um per meter, given there is a limit on the precision of the prism are the industrial products really much better than this?

Cheers, Joe

devmonkey
10-01-2020, 10:10 AM
Joe,
Whilst replying on your build thread an idea came to me. I'd be interested in comments on it's practicality:

Could your laser leveling camera and software, possibly using a taught wire as John is doing, be used to measure the height errors as a gantry machine moves along it's imperfect rails and edit the Z axis G-code to correct for them in much the same way as a probe is used to measure and correct flatness errors in PCB cutting?

In this way a machine of modest accuracy could be used to build parts for a better one. I'm thinking specifically of jobs like grinding the top of gantry profile as you have done for your build.

Initially I'm thinking of only flattening a linear cut as above but since your stated aim is making planar measurements is it reasonable to think of correcting over an area in order to turn plain old ally plate into something approaching tooling plate or even turn a piece of granite worktop into a reasonably accurate surface plate?

Kit

Yes you could try to calibrate the machine rather than align it, same as you do for pcb milling which I've used very successfully on very inaccurate machines in the past. It would be more complex if you are hoping to improve 3D (PCB being 2D) but still possible to gain some improvement.

devmonkey
10-01-2020, 10:23 AM
Hi John,

Do you have a picture of the 'polygon' prism from the laser printer? Is it a penta-prism? If so then this would be suitable, if it is just a 90 degree mirror then we wouldn't be able to align it accurately enough. I have been looking for a penta prism, we would need an accurate one, most are specified in arcminute accuracy but the super precision ones are around a few arcseconds. I'm guessing this means is that over 1 meter the error in height measurement due to the prism would be:

1 arcminute: 290um (a massive 0.29mm)
1 arcsecond: 5um

So this begs the question, how accurate are these super expensive industrial machine levelling metrology systems that use lasers? What I have now with the cheap laser and camera sensor is within say 50um per meter, given there is a limit on the precision of the prism are the industrial products really much better than this?

Cheers, Joe

To answer my own question, this system:
https://www.hamarlaser.com/systems/l-741-ultra-precision-leveling-laser-with-plumb-beam/

Has a stated accuracy of 0.5 arc seconds (2.5um per meter):
Laser plane flat to 0.5 arc second (.00003 in/ft or 0.0025 mm/m).

No idea about price but can't imagine it is cheap!

devmonkey
10-01-2020, 02:29 PM
I have had an idea, or maybe remembered something previously discussed here. To get around the error in the laser line which is proportional to arc length how about first flattening the master rail in isolation with the laser projecting along the rail, this uses less that 1 degree of laser arc. The master rail is now flat. Now move the laser so it is orthogonal to the master rail and projecting across the frame as to encompass the slave rail we want to bring into plane with the master.

The height deviation from flat caused by the error in the laser line now we are using say 30 degrees of arc can be measured and the true deviation calculated for stations along the known flat master rail and then projected using simple geometry to stations on the slave rail so that it can be also be flattened bringing it into plane.

Sketch:
27042

This should work shouldn't it, if we consider that a ray of light travels straight and that a very small arc of laser line is 'ray like', and if we consider the laser as a point source (which it isn't). Thoughts?

John McNamara
10-01-2020, 02:51 PM
Hi Joe

The mirrored face prism has 6 sides

It is driven by small three phase board mounted disk motor and a Toshiba TC9242P Motor driver chip.

For a quick test I tried using a small laser pointer and spinning it by hand got a nice bright red line. Very sharp if the target was a short distance away however as suspected on first observation the beam focusing lenses as used by the HP printer were set for a short distance. The dot increased in size quickly as you moved the target away.

However the rotating mirror prism without the lenses worked well, I just spun it by hand for a quick test of the concept.

I will have to do a proper test once I sort out the interface. The laser diode I used was a cheap giveaway pointer!
I removed the invisible light diode as fitted by HP for safety, just two screws and it leaves a nice mounting face for the replacement visible red diode. For this test I just held it by hand....

Just read your post 161

The line is generated by the changing face angle, with 6 faces I am guessing the line generated will be about 60 degrees assuming 360/60 is the correct formula? The HP laser unit itself has a coverage of about 60 degrees.

Mechanical errors?

As I see it the rotating prism mirror presents every side to the laser in turn. The line generated should be straight if the laser is located perpendicular to the axis of rotation. if not on axis a slightly curved line would be generated.

The bearings of the rotating spindle may not be perfect, this may cause the edge of the optical plane generated to wobble up and down for each rotation turn? However your software makes multiple measurements and averages them, This should help cancel out this error.

Regards
John

John McNamara
10-01-2020, 03:16 PM
Hi Joe
Edited above post

devmonkey
10-01-2020, 04:36 PM
Hi Joe

The line generated should be straight if the laser is located perpendicular to the axis of rotation. if not on axis a slightly curved line would be generated.

The bearings of the rotating spindle may not be perfect, this may cause the edge of the optical plane generated to wobble up and down for each rotation turn? However your software makes multiple measurements and averages them, This should help cancel out this error.

Regards
John

Hi John,

A penta-prism doesn't suffer this problem, it has two faces at 90 degrees, then two other faces at 90+22.5 to the first two, the fifth face is not relevant, some might not even have it or maybe have multiple. Good picture on wikipedia.

devmonkey
10-01-2020, 04:43 PM
In the pursuit of madness I have just done another test on the milling table with the better quality laser, I did 6 runs each with different parts of the laser line some with the laser inverted, with the angle of incidence to the table random, etc. Again 10 stations over 500mm. Results are very consistent which makes me think there was something wrong with my last test.

27043

I don't think the laser mount is anywhere near stiff enough, it takes a few minutes for it to stop moving around on the screen to start a run and by the end of the run it has drifted by at least half the error of the run. Note that I haven't been testing with the laser on that desk rather out in the garage on a heavy bench over the bench leg.

27044
27045

I think this laser needs to be clamped to a vblock attached to a lump of iron. It also has a focusing ring attached which works well other than it wobbles the laser all over the place. This might need to be locked in place as well.I have now gone from 'borrowing' the laser to owning it so it might well get some locktite on the focus slider.

If anyone else wants one to play with they are sold here, £40.
https://odicforce.com/epages/05c54fb6-7778-4d36-adc0-0098b2af7c4e.sf/en_GB/?ObjectPath=/Shops/05c54fb6-7778-4d36-adc0-0098b2af7c4e/Products/OFL72

driftspin
10-01-2020, 07:32 PM
Hi guys,


I recieved my cheap webcam today.

It is a ASHU H800 1080p cam, about 18 euro incl shipping.

https://a.aliexpress.com/Zos0Tdull


If internals are really 1920x1080 (windows says it is) this might be an ok device.

The chip size is ~6.5mm x ~3.2mm


So this sensor could be 0.003mm ish per pixel.

I wanted a bigger size sensor than the 640 pixel 2.5 mm one. Because of the width of the laser line on my bosch laser


Does the software account for not having the sensor 100% level?
I hope it does.

Or does not having it level actually help achieve sub pixel accuracy .

The lens can be screwed out and put back on so it is only exposed to dust while in use.

I wil drill 2 mounting holes in the housing and bolt it to a piece of 4080 profile.


I will try to install the software and try icw the bosch laser i have.

Will report back on progress.





Verstuurd vanaf mijn SM-A320FL met Tapatalk
https://uploads.tapatalk-cdn.com/20200110/b7d94d35ded3a55cb3f73c962c39dc6a.jpghttps://uploads.tapatalk-cdn.com/20200110/7a97479e2261fa49a7bfb063d0601d31.jpg

driftspin
10-01-2020, 08:14 PM
Hi guys,


I recieved my cheap webcam today.

It is a ASHU H800 1080p cam, about 18 euro incl shipping.

https://a.aliexpress.com/Zos0Tdull


If internals are really 1920x1080 (windows says it is) this might be an ok device.

The chip size is ~6.5mm x ~3.2mm


So this sensor could be 0.003mm ish per pixel.

I wanted a bigger size sensor than the 640 pixel 2.5 mm one. Because of the width of the laser line on my bosch laser


Does the software account for not having the sensor 100% level?
I hope it does.

Or does not having it level actually help achieve sub pixel accuracy .

The lens can be screwed out and put back on so it is only exposed to dust while in use.

I wil drill 2 mounting holes in the housing and bolt it to a piece of 4080 profile.


I will try to install the software and try icw the bosch laser i have.

Will report back on progress.





Verstuurd vanaf mijn SM-A320FL met Tapatalk
https://uploads.tapatalk-cdn.com/20200110/b7d94d35ded3a55cb3f73c962c39dc6a.jpghttps://uploads.tapatalk-cdn.com/20200110/7a97479e2261fa49a7bfb063d0601d31.jpgOk so i set 3um per pixel and got this result for a stationary setup.

it looks like there is an upward trend... not sure what causes that yet.

maybe the laser is heating up in the bosch auto levelling system moving it over time.


This will be the best setup i can do so far to measure the flatness of the machine so far.

Happy so far.


Grtz. Berthttps://uploads.tapatalk-cdn.com/20200110/0139bd3acf30e740e99c778d62679860.jpg

Verstuurd vanaf mijn SM-A320FL met Tapatalk

devmonkey
11-01-2020, 10:39 AM
Hi guys,


I recieved my cheap webcam today.

It is a ASHU H800 1080p cam, about 18 euro incl shipping.

https://a.aliexpress.com/Zos0Tdull


If internals are really 1920x1080 (windows says it is) this might be an ok device.

The chip size is ~6.5mm x ~3.2mm


So this sensor could be 0.003mm ish per pixel.

I wanted a bigger size sensor than the 640 pixel 2.5 mm one. Because of the width of the laser line on my bosch laser


Does the software account for not having the sensor 100% level?
I hope it does.

Or does not having it level actually help achieve sub pixel accuracy .

The lens can be screwed out and put back on so it is only exposed to dust while in use.

I wil drill 2 mounting holes in the housing and bolt it to a piece of 4080 profile.


I will try to install the software and try icw the bosch laser i have.

Will report back on progress.





Verstuurd vanaf mijn SM-A320FL met Tapatalk
https://uploads.tapatalk-cdn.com/20200110/b7d94d35ded3a55cb3f73c962c39dc6a.jpghttps://uploads.tapatalk-cdn.com/20200110/7a97479e2261fa49a7bfb063d0601d31.jpg

The app expects the sensor is in portrait orientation wrt the laser line, it then sums the intensity over each pixel row (sensor column) to produce an intensity curve which it post processes to determine the centre. This means if the laser line is at an angle to the sensor it doesn't matter, it should always find the height of maximum intensity at the centre of the sensor width. You don't want a crazy angle as it will reduce accuracy, a few degrees is fine though.

I'm also going to move to a larger sensor, it takes too long to align the laser to the 2mm sensor over any reasonable distance.

devmonkey
11-01-2020, 07:00 PM
So I just tried it with a very nice cheap 1920x1080 camera from Amazon, sensor is perfect for our use, easy to rip apart and about 6mm of vertical resolution. However there is a problem, the library I'm using to connect to the camera only supports YUV format, which is a raw uncompressed image format. This means that over the USB connection higher def cameras cannot deliver the full frame rate of the camera because there is too much data to ship, I can only get 5 fps.

I will have a look about for a different library, this would use MJPEG to compress the frames on the camera so they fit down the USB connection, that may in turn lead to other problems due to compression artifacts reducing the image accuracy, will have to see.

davebaldwin
12-01-2020, 04:55 PM
Are you aware of this: https://openmv.io ?

It is a single board computer with camera. You can develop machine vision algorithms in python or in C. They have different sensors but I am not sure they have one with a large enough area for what you desire.

I can see how you would setup a single rail in a straight line with a laser/camera combination but don't understand how you would use a generated laser reference plane to setup a second rail.

Dave.

devmonkey
12-01-2020, 06:37 PM
Hi Dave,

The laser line is a plane so you can either zero both rails to this plane or create a virtual plane from any 3 height measurements and zero to that.

Kitwn
13-01-2020, 01:03 AM
I can see how you would setup a single rail in a straight line with a laser/camera combination but don't understand how you would use a generated laser reference plane to setup a second rail.
Dave. Dave,
Welcome to the forum (I see this is your first post). Make a nice hot cup of tea and read this thread from the start.

Kit

davebaldwin
13-01-2020, 10:10 AM
Let me elaborate.

To make a rail straight you are changing one degree of freedom so by mounting your camera on a rail truck with the laser pointing parallel to the desired path (and obviously intersecting the camera). A simple measure of how far off the centre of the laser beam gives you the amount of displacement of the rail you need to make before the rail is in line with the laser.

Traditionally, to make a surface planar (or two surfaces separated by a gap) you would use a known good plane - i.e. surface plate and a marking out fluid. Blue up the surfaces and use the surface place to rub the marking fluid off the high spots. This then identifies where you need to scrape to bring both surfaces into the same plane. The marking process is essentially in 3D as it extends along the width, length and heigh of the target surface.

Now for the laser plane method. Mount the laser plane generator on the master rail. Set the plane generator up so it is casting a reference plane parallel to the master rail and not at some pitch or roll error. On the slave rail mount the camera on a truck facing the master rail. Now the offset given by the camera from the laser's centre is how much in heigh the slave rail need to be moved. This is one dimension that has been taken care off. Sliding the slave truck (and maybe the laser plane generator as well) along the rail allows you to sample the height difference along the rail. Second dimension taken care off.

The thing I am missing is how the 3rd dimension is taken care off? What we have done is to set the hight of a line on the slave rail to be the same height as the reference plane where it intersects the focal plane of the camera but not that the whole slave rail is in the same plane as the master rail. Looking at it another way we haven't set the roll (looking down the rail) of the master and slave rails to be the same. Is this a second order effect and it unlikely to be outside the planar tolerance of the trucks across the rails?

Maybe this is covered elsewhere in the thread - I have read the whole thread over the months it has been running, but not in one sitting - and I apologise for the repetition in that case.

On a separate note instead of having a fixed laser and rotating (expensive and hard to get) prism why not just rotate the laser? For this application I would have though the advantages of rotating a small piece of glass over a bulkier laser are necessary.

Dave.

devmonkey
13-01-2020, 11:11 AM
Let me elaborate.

To make a rail straight you are changing one degree of freedom so by mounting your camera on a rail truck with the laser pointing parallel to the desired path (and obviously intersecting the camera). A simple measure of how far off the centre of the laser beam gives you the amount of displacement of the rail you need to make before the rail is in line with the laser.

Traditionally, to make a surface planar (or two surfaces separated by a gap) you would use a known good plane - i.e. surface plate and a marking out fluid. Blue up the surfaces and use the surface place to rub the marking fluid off the high spots. This then identifies where you need to scrape to bring both surfaces into the same plane. The marking process is essentially in 3D as it extends along the width, length and heigh of the target surface.

Now for the laser plane method. Mount the laser plane generator on the master rail. Set the plane generator up so it is casting a reference plane parallel to the master rail and not at some pitch or roll error. On the slave rail mount the camera on a truck facing the master rail. Now the offset given by the camera from the laser's centre is how much in heigh the slave rail need to be moved. This is one dimension that has been taken care off. Sliding the slave truck (and maybe the laser plane generator as well) along the rail allows you to sample the height difference along the rail. Second dimension taken care off.

The thing I am missing is how the 3rd dimension is taken care off? What we have done is to set the hight of a line on the slave rail to be the same height as the reference plane where it intersects the focal plane of the camera but not that the whole slave rail is in the same plane as the master rail. Looking at it another way we haven't set the roll (looking down the rail) of the master and slave rails to be the same. Is this a second order effect and it unlikely to be outside the planar tolerance of the trucks across the rails?

Maybe this is covered elsewhere in the thread - I have read the whole thread over the months it has been running, but not in one sitting - and I apologise for the repetition in that case.

On a separate note instead of having a fixed laser and rotating (expensive and hard to get) prism why not just rotate the laser? For this application I would have though the advantages of rotating a small piece of glass over a bulkier laser are necessary.

Dave.

Hi Dave,

I think you are conflating the rail itself with creating a planar surface to mount the rail. Imagine we are trying to create a surface plate from a an uneven slab of concrete say. You would mark out a grid of X-Y points on the slab, setup your laser plane and measure height error to the laser at each point. Take any 3 non-co-linear points (there is a method to pick the optimal 3 but it doesn't matter here), compute the equation of the virtual plane that intersects these 3 points, then correct all the other point error heights to this plane. Now shim or scrape as appropriate every point other than the 3 chosen, rinse and repeat until you are happy with the planar error.

If this process was done using just two lines of points one under each rail centre then yes each rail would have a roll error (like setting up a perfectly planar razor blade under each rail and to them) but if you instead level a surface that the rail will sit on using this method (say level the entire 80mm steel beam in my case) then the roll error will be eliminated (sufficiently eliminated).

Rotating a laser without a penta prism wont work as you cannot build a sufficiently well aligned laser mount, it will always cause the rotated laser to project a cone rather than a plane, this is the entire point of a penta prism, it is agnostic to variance in angle of incidence. Remember 1 arcsecond (1/3600 of a degree) will equate to ~5um of error at 1m. If your mount is say 100mm across this needs to be both machined and the laser somehow aligned to it all to within a tolerance of 0.5um, I reckon this is impossible.

Cheers, Joe

devmonkey
13-01-2020, 11:27 AM
Some notes on HD cameras for people wanting to move beyond VGA.

Why bother? In order to get more vertical range, VGA gets you ~2mm which is not very much when starting with a very unlevel surface, and it is quite hard to align the laser to within 2mm of the thing you are trying to level, but not impossible by any means.

Webcams usually produce two types of video stream, a compressed stream (usually MJPEG unless you have a 2-4k camera in which case it will be h264) and an uncompressed YUV stream. This app can only use the uncompressed stream, both because of how it interfaces to the camera, but also because compression introduces a load of artifacts into the image which will lead to alignment errors.

The problem, most webcams use the USB2.0 standard to connect to your PC. USB2.0 can ship VGA(640x480) uncompressed at 30 fps, moving to FHD(1920x1080) this drops to 5 fps. This means it takes 6 times longer to take a reading, I don't know if this matters much other than slowing the whole process down.

To get 1920x1080 at 30 fps you need a USB3.0 camera (and a PC with USB3.0 ports), these cameras are harder to come by and are more expensive. If you are looking for one then try and check what formats and rates it actually produces before you buy it.

Hope this helps.

davebaldwin
13-01-2020, 12:46 PM
Thank Joe. I understand now. I think my confusion came from your first reply to me where you said "... so you can either zero both rails to this plane..."


Have you seen this project. Looks like it shares some similarities but for a very different result.

https://hackaday.io/project/21933-open-hardware-fast-high-resolution-laser

Dave.

devmonkey
13-01-2020, 01:02 PM
Thank Joe. I understand now. I think my confusion came from your first reply to me where you said "... so you can either zero both rails to this plane..."


Have you seen this project. Looks like it shares some similarities but for a very different result.

https://hackaday.io/project/21933-open-hardware-fast-high-resolution-laser

Dave.

I hadn't seen that particular project, but yes they are using a prism to project a line, However note the accuracy of the prism, it is ~1 arcminute (290um over 1m), this is fairly standard and although readily available unfortunately useless for our purposes, we need <1 arcsecond which are a rather more expensive and difficult to get.

devmonkey
13-01-2020, 07:00 PM
I've been thinking about actually using this system to level the X beams (80mm steel box section) on my new machine, I will outline my current thoughts on the process and welcome your criticism.

I'm thinking the basic process would be:
1. Deposit a 30-40mm wide strip of machinable rail bed material on top of the beams where the rails will go.
2. Use the laser system to level a piece of milled aluminium plate with a window cut in it over where the rail will go. The plate could be clamped and brought into plane with the laser using 3 jack screws bearing on the steel beam.
3. Take a trim router and using the plate as a router guide mill the rail bed down to height. Move the plate along the beam, rinse and repeat, then repeat for the second X beam.

The trim router would be height locked throughout the whole procedure, potentially tape could be used on top of the router guide for a roughing cut, then removed for a finish cut. The laser would also have to remain in location.

For the rail bed I'm thinking of polyurethane metal filler laid to a depth of 1-2mm, hardens quickly and is fairly easy to machine.

I don't have a trim router, although I don't mind picking one up. Does anyone know what sort of Z-play units like the small Bosch or Makita have?

Thoughts on success of this process?

Kitwn
14-01-2020, 02:49 AM
Joe,
That's beginning to sound as fiddly as using the traditional West Systems 105/209 epoxy leveling method with more potential for errors. Gravity never makes mistakes. What do you see as the advantages to your proposed method?

devmonkey
14-01-2020, 09:12 AM
Joe,
That's beginning to sound as fiddly as using the traditional West Systems 105/209 epoxy leveling method with more potential for errors. Gravity never makes mistakes. What do you see as the advantages to your proposed method?

Hi Kit,

I do have a pack of 105/209 here for this machine, trouble is the temperature in the UK in my unheated uninsulated garage is about 6 degrees, so would have to wait until summer.

I was also hoping we could improve upon the accuracy of epoxy, from the measurements taken in this thread:
http://www.mycncuk.com/threads/8197-Use-of-epoxy-for-levelling?p=65194#post65194
and Jonathon's build here:
http://www.mycncuk.com/threads/6484-A-sufficiently-strong-machine?p=48616#post48616
It appears with epoxy 60um (0.06mm) peak-peak error is possible, I think we can do better than this with the laser and also not have to wait 2 weeks for the epoxy to cure. It might be possible to perform the process I described above in a couple of hours. 0.06mm is 20 pixels on the image sensor to give an idea of comparable resolution.

Cheers, Joe

Kitwn
14-01-2020, 10:02 AM
Hi Kit,

I do have a pack of 105/209 here for this machine, trouble is the temperature in the UK in my unheated uninsulated garage is about 6 degrees, so would have to wait until summer.

I was also hoping we could improve upon the accuracy of epoxy, from the measurements taken in this thread:
http://www.mycncuk.com/threads/8197-Use-of-epoxy-for-levelling?p=65194#post65194

It appears with epoxy 100um (0.1mm) peak-peak error is possible, I think we can do better than this with the laser and also not have to wait 2 weeks for the epoxy to cure. It might be possible to perform the process I described above in a couple of hours.

Cheers, Joe
We're having the opposite problem here. Last night's overnight low was 29C and the days have been up to 46C recently. I'm keeping our epoxy resin (wife and I are making some fancy stuff to sell in the local gift shop) in what used to be a wine fridge.
Maybe you could pour the resin and then come over to us for a fortnight's tropical snorkeling with whale sharks and manta rays while it cures? Then take your enviable winter tan home and use the laser to guide you hand-scraping the last 100 microns of errors out? Hand scraping resin shouldn't be to hard.

devmonkey
14-01-2020, 01:12 PM
Hmm, so I now have another problem.

I set laser on the milling machine head, just needs to be attached to something solid, then levelled the laser to the machine frame which is sat on a sturdy bench. The problem is that walking near the laser causes microscopic deflections in the concrete floor, sufficiently large to show up as 10-20um of error 3m away on the machine frame. These are probably amplified by the height of the laser from the floor, about 1.5m as the same doesn't occur walking near the bench.

I think I will need to move everything directly onto the concrete to stand any hope of getting things stable enough to do any frame levelling. Problem will then be not kicking it during the process.

John McNamara
14-01-2020, 02:49 PM
Hi All

Gee who would have thought this thread would have generated so much interest.

I am tempted to bring up the possibility of automating bed machining using software!

The following is just first draft of a possible solution. My plan is to level the surface by milling small sections of the bearing surface in an overlapping grid pattern. When finished the surface would look a little like hand scraping. As each "Peck" was made after aligning the cutting head to the laser or stretched wire. Once the cutting cycle is complete the surface flatness would be equal to any errors in the measurement system that we already know is pretty good from the experiments done so far my a number of testers. A final stoning of the machined surface would remove any high spots. Note the cutting head is aligned to the measurement system not the rail it slides on.

A quite small milling head with a small cutter (5 - 8mm) traversed along the bed using the rails to be later used on the machine itself temporarily fixed to the sides of the in your case 80x80 rail support frame.

I don't plan on using a high speed spindle just a simple Import
https://www.ebay.com/sch/i.html?_from=R40&_trksid=p2510209.m570.l1313.TR1.TRC0.A0.H0.Xspindl e+dc+motor.TRS0&_nkw=spindle+dc+motor&_sacat=0

It would need 4 axis.
One controlled by the leveling software

One that rotates the cutter head to vertical (Leveling IC's are cheap) a small stepper. The leveling could be done with 3 steppers for complete control or just one if only levelling transversely across the rail in the x direction. Therefore only one small stepper required.

One to drive the cutter head down and make a peck. Another small stepper and a simple screw drive ball screw not needed just low backlash.

One to move the small cutter across the work. the X axis has very limited travel maybe 50mm maximum.

There would also need to be a longitudinal drive.
Ideally using the timing belts to keep the cost down.
This drive could use the drive motor later to be used in the machine.

So the sequence would be:
Starting with the cutter head in the up position.

Move along the rail to the next cutting "peck"
Level the head

Find the center point with the alignment software to align the attached cutting head.
Move the cutter head down #N steps to engage the work.

Retract the cutter head.

Repeat cycle.

The temporarily fitted rails would only need to be roughly aligned. Within say 2mm Ideally 1mm. Not that hard, it can be done with simple measuring tools.

The accuracy of the system is derived from the measuring system not the supports for the temporary fitted rails.

I imagine that the mounting face of the Box tubes would be coated with a strip of say 5mm thick and wide enough to fit the rails, to be be machined flat with A mixture of epoxy and metal powder.
Easier to machine than steel. Thin box sections are often bowed. You don't want to weaken them.

I posted this a while back. I still run the lathe on the material. Inexpensive to prepare. For non sliding Iron or Aluminium powder alone and epoxy would be fine.
https://www.cnczone.com/forums/epoxy-granite/126563-epoxy-bearing-material-method.html

If a few people are interested I would have a crack at drawing up a design that mainly uses laser cut sheet steel parts ground rod and Asian bearings for the Simple jig needed. Anyone could download the files and send them off for cutting to their local cutting shop. It will be quite small so low cost.

I am not planning a servo driven XY axis just point to point positioning via steppers,
An Arduino or similar processor could easily drive all the above.

Regards
John

pippin88
14-01-2020, 10:58 PM
Interesting idea John.

3 axes may be enough:
Rotation (few degrees may be enough). Likely the rotation should be clamped after achieving the correct level plane. Rotation adjustment could even be manual.
Cutter up/down (few mm, accurate depth very important).
Transverse (~50mm)

Longitudinal along the rail could be done manually with clamping at each position. This avoids the need for a temporary low backlash longitudinal drive.

Actually, all the movements could be done manually based on software feedback. Light cuts are expected only.

An important point is a fixed mounting place for the laser that allows both rails to be machined / aligned. This may be a bracket fixed to the middle of the machine bed, equidistant to the rails.

(By the way I am keen to see some updates to your epoxy granite mill!)

John McNamara
15-01-2020, 12:43 AM
Hi Pippin

X and y positioning does not need to be done to CNC milling machine accuracy standards. the pecks cut a small circle and can overlap each other enough to allow for any positioning errors.

Using a rail that will later be used on the machine (it needs to be a profile rail if only one is used round rails will work but two will be needed) the cutting head will be mounted on one of the rail runner bearings that will later be used on the machine. The cutter head will be small, not a gantry across the machine. At a guess maybe a 250mm cube should be enough to contain the components. made from laser cut and 3d printed parts.

If the rail used is not ordered a little extra long the cut length will be equal to the length of the rail minus the width of the runner block, not a huge problem the small section at each end could be hand finished. Or the rail could be ordered a little extra long to allow for this.

How to mount them?

My plan is to clamp a piece of say 90 x 45mm (4x2" imperial) dressed timber on the side of the frame member to be leveled this would need to be manually straightened to within a mm or so, not hard with simple tools Or better still buy a good straight piece from the local building materials supplier

I plan to mount the rail on this timber with stout wood screws!

This is where the laser or wire alignment system comes into play. The rail and cutter head assembly
only needs to provide solid support for the cutter head. Positioning the cut is done by the measurement system not the frame.

The X axis is possibly the weakest link in this design, as is as long as a simply flat area is all that is needed it should work fine. If however you wanted to pilot drill the mounting holes it would not be sufficiently accurate without setting up the laser reference or wire reference at 90 degrees.
Doable at the expense of complexity, probably unnecessary.

Regards
John

PS: Yes Pippin the epoxy mill begs me to finish it. 2019 was a big year for me work wise with a heavy smattering of other issues. I hope to get back on it soon.

devmonkey
15-01-2020, 11:17 PM
So I have made a small amount of progress this evening. With the laser mounted solidly to the mill head I was able to map the my machine frame. I clamped the laser solidly then left it well alone. This meant the machine frame had to be adjusted to the laser plane, which is much easier than vice versa. I lifted the frame at 3 points and shimmed each to get the best coincidence of the two planes, this was just done with a steel rule with the end on the frame and reading off where the laser hit it.

This is the frame and I'm trying to create a planar surface across the top two beams:

27084

I then mapped the surface, I have about 1mm total peak-peak error, basically each top beam slopes down 1mm from end-end but in opposite directions. This isn't too bad.

I also took delivery of a little Makita trim router, I think it is the same sort as used on some peoples cnc routers. Anyway for £100 it is a very nice piece of kit, no measurable up-down play in the spindle, I also got a 6mm collet for it.

The levelling process I'm going to attempt I outlined earlier in the thread, but basically it involves using a trim router and a laser aligned router jig to mill down material fixed to the top the frame to bring it into plane.

So what material to use? I mixed up some metal polyester filler of the type used to fix leaks on engine castings. This stuff has some nice properties but it is too brittle and I think too soft (definitely softer then unfilled epoxy).

So what about epoxying an aluminium strip to the top of the steel frame and machining that? Would probably work but more effort, I checked the little Makita is happy milling aluminium and it is fine.

Whilst I had the router in hand with a 6mm carbide endmill in it, I thought I may as well see what it can do against mild steel, not expecting anything other than chatter and heat. Anyway it cuts it like butter, very cleanly. I only tried 0.5mm and 1mm DOC and it was fine and this is within the range I need for levelling this frame.

So I will pick up some 30mmx4mm flat bar stock tomorrow and weld it to the top of the frame where the rails will be mounted, then build the laser/router jig and hopefully have a planar frame very soon.

JAZZCNC
15-01-2020, 11:44 PM
It appears with epoxy 60um (0.06mm) peak-peak error is possible, I think we can do better than this with the laser and also not have to wait 2 weeks for the epoxy to cure.

Question.!... Why do you need better than 0.06 for a router..? . . . . Answer.! . . . You don't.

With all the watts of brainpower you've invested in this, you could have heated the garage and built the bloody thing.! . . . Just get on with it and stop overthinking is my suggestion.

devmonkey
16-01-2020, 08:27 AM
Question.!... Why do you need better than 0.06 for a router..? . . . . Answer.! . . . You don't.

With all the watts of brainpower you've invested in this, you could have heated the garage and built the bloody thing.! . . . Just get on with it and stop overthinking is my suggestion.

Yes I could have done, using maths I even worked out it would cost £84 in electricity ;-)

I may still use the epoxy if this doesn't work out but this thread is about developing a open source optical metrology system using very cheap components for the benefit of anyone who wants to measure anything accurately to few microns. I thought you'd be well up for that given your pet hate of people quoting accuracy figures they cannot measure.

Some projects do require better than 60um accuracy, or at least calibration of that level of error. For example I want to use the machine currently under construction or one of its offspring to position high power magnets into a halbach array for a coreless axial flux PMDC EV motor I'm developing, this needs 10um accuracy under quite significant magnetic load.

John McNamara
16-01-2020, 12:26 PM
HI All

Well Put Joe. "Devmonkey"

This thread "is about developing a open source optical metrology system using very cheap components for the benefit of anyone who wants to measure anything accurately to few microns" The software you have written that forms the cornerstone of the project continues to evolve and mature.

When I first came across this thread in August 2019 It captured my imagination straight away, It continues to do this now 4 months later. It represents the work of many individuals now, all striving to improve it, by freely sharing their ideas on a world stage. The results will enable many builders and experimenters to achieve measurement accuracy previously only available at great expense.

Thanks Joe, the best is yet to come!

Regards
John

Kitwn
16-01-2020, 02:06 PM
Joe,
Though the chances of me ever requiring the level of accuracy you are striving for here are minimal I agree with John completely. This remains a valuable and fascinating thread. Have you ever thought of sending your CV to NASA?

Dean,
For novice readers who are trying to work out what they should be doing to make a CNC router with performance that is both adequate and practically achieveable your comments are equally valuable.

Kit

JAZZCNC
16-01-2020, 03:19 PM
I may still use the epoxy if this doesn't work out but this thread is about developing a open source optical metrology system using very cheap components for the benefit of anyone who wants to measure anything accurately to few microns.

Don't get me wrong I'm not putting down or knocking this thread or what you are doing, so what ever floats your boat, I'm sure it will help someone with time to waste or true need for it.!
However, my comments are aimed to help those reading threads like this and think this sort of setup is what's needed to build a good router, you included. My point being it's NOT.!



I thought you'd be well up for that given your pet hate of people quoting accuracy figures they cannot measure.

Yes, it is and I may just read this thread completely to see how you have validated that your setup is actually accurate because from the little I've read I'm seeing references to measuring against steel rules, etc and I've yet to see or own steel rule that is straight to micron levels.!

Unless you validate using calibrated measuring devices then you cannot possibly claim your accurate to micron levels. Because no matter how good the idea or wish it to be or fool self into thinking it is accurate, only a calibrated validation speaks the truth.

I know this only too well because as I've got deeper into building machines I've invested in better measuring devices and calibrated granite surfaces plates etc and for several years I believed my really expensive engineer's squares were square, right up till the day I bought my calibrated granite triangle.!!


Some projects do require better than 60um accuracy, or at least calibration of that level of error. For example I want to use the machine currently under construction or one of its offspring to position high power magnets into a halbach array for a coreless axial flux PMDC EV motor I'm developing, this needs 10um accuracy under quite significant magnetic load.

Ye good luck with that using a router made from thin-walled steel tube which is less than well braced, that will between heat variations and resonance make low micron level machining a pipe dream.


Dean,
For novice readers who are trying to work out what they should be doing to make a CNC router with performance that is both adequate and practically achieveable your comments are equally valuable.

Exactley why I make these kind of post's Kit.
I know lots of people think I'm just being a Dick head or awkward for the sake of it and don't like me saying what I do or how I say it. The truth isn't often welcome or popular.!
But they're not the ones who get hundreds of messages and emails from first time builders or people lurking in the background watching, reading these threads asking for help or clarity.

You wouldn't believe the amount of messages I get from people who have never posted or built a machine but have been on the forum for several years watching, trying to make sense of it all, only to get completely Kaffuddled by all the crap that gets spouted, often by those with little to no experience of building a machine but head a full of brains overthinking what's required. (This is not a go at anyone here either like I say whatever floats your boat),

However, I will never NOT say something when I see overly complicated ideas being applied to building a router type machine. Because it's not needed so needs to be said for the sake of others.
If you or anyone feels the need to go to these levels then fine crack on, I wish you well, but don't get upset when it's pointed out it's not needed for a router.

devmonkey
16-01-2020, 04:41 PM
Yes, it is and I may just read this thread completely to see how you have validated that your setup is actually accurate because from the little I've read I'm seeing references to measuring against steel rules, etc and I've yet to see or own steel rule that is straight to micron levels.!

Unless you validate using calibrated measuring devices then you cannot possibly claim your accurate to micron levels. Because no matter how good the idea or wish it to be or fool self into thinking it is accurate, only a calibrated validation speaks the truth.

I know this only too well because as I've got deeper into building machines I've invested in better measuring devices and calibrated granite surfaces plates etc and for several years I believed my really expensive engineer's squares were square, right up till the day I bought my calibrated granite triangle.!!



Hi Dean,

Maybe read the whole thread mate, it shows various calibrations of the line optics used against beams of light which travel in straight lines and also some other tests by other forum members, it does rely on the 3um pixel pitch of the cmos image sensor not being too variant across the sensor, not able to calibrate that I'm afraid.

Anyway suffice to say I agree you don't have do use or understand optical metrology, diy or otherwise, to build a working router, I haven't used it with any of the other machines I have built and all worked fine, although my mate does use a commercial optical kit to align his machining centres, but he builds stuff for F1.

Conversely if you want to measure your machines that you have built then download the software and have a play.

What is the DIN 876 grade standard of the surface plate you use?

Cheers, Joe

Kitwn
16-01-2020, 05:25 PM
For me one of the great attractions of this forum is the mixture of common sense, common sense being not at all common in general usage, and cutting edge science that is available on an almost daily basis. I want to read Dean's and Boyan's blunt comments on what is sensible for someone wishing to build a first machine for cutting out wooden parts for their hobby projects, and I want to see what Joe and John can offer in the way of extreme accuracy for a home hobbyist on a DIY budget for those that are interested in achieving it. Our main problem is ensuring the novice reader is not confused regarding what is practical and achievable within their target spend of both money and time.

devmonkey
16-01-2020, 05:53 PM
For me one of the great attractions of this forum is the mixture of common sense, common sense being not at all common in general usage, and cutting edge science that is available on an almost daily basis. I want to read Dean's and Boyan's blunt comments on what is sensible for someone wishing to build a first machine for cutting out wooden parts for their hobby projects, and I want to see what Joe and John can offer in the way of extreme accuracy for a home hobbyist on a DIY budget for those that are interested in achieving it. Our main problem is ensuring the novice reader is not confused regarding what is practical and achievable within their target spend of both money and time.

I agree which is why I have confined the discussion of the optical stuff to this thread, and my current machine build to the build log thread. I will however have to use some parts of building that machine to demonstrate how one might use the optical system, no one need copy it, but there does seem to be interest which is why I keep posting.

The two tasks which I'm attempting with this system are
1. Making the X beams planar to carry the rails,
2. Straightening the master X rail (this is trivial, just attach sensor to a carriage and align to laser).

(1) as an alternative to epoxy, or scraping against a 876 grade 1 surface plate which I don't have and would be very expensive even for a moderate machine, or using a precision level.
(2) as an alternative to using a precision straight edge.

If a cheap penta prism can be scrounged from somewhere then this can be used for tramming the Z and squaring the gantry, but I'm not so bothered about that as there are other methods.

JAZZCNC
16-01-2020, 09:01 PM
Maybe read the whole thread mate,

I don't really have a need for it, so my time is better spent doing other stuff, like trying to understand the brain-numbing C++ macro's for an ATC.!!

However, again I'll repeat I wasn't knocking what you are doing or saying anything negative about what you are doing, merely questioning how it's validated, because without validation equipment it's all guesswork, highly educated guesswork probably but still guesswork none the less.
That said I'm sure some will have use for it, hell I may even have use for it someday, so please carry on. My post honestly wasn't to discourage or rubbish what your doing and It's good for everyone who needs it so I applaud you for it.


What is the DIN 876 grade standard of the surface plate you use?

I've got 2 surface plates one BS817 6` x 4` x 10" Grade 0 forgot the name of maker but it's a old one on a metal stand, weighs about as much as a small car. The other is Din 876 made by Insize 9600 series 1000 x 630 x 140 grade 00. The granite triangle is a Mitutoyo Din876 500 x 300 x 60 Grade 00.

devmonkey
17-01-2020, 12:49 PM
Ok Dean, cool. Let me know if you want a hand with the c++.

That Insize surface plate is a really good deal, I just looked up the price.

devmonkey
17-01-2020, 01:13 PM
Continuing the mission of bringing my frame into plane I have welded on some flat stock to mill down to plane. Rather surprisingly I picked this up at the local Wickes, about twice what it costs when you buy it by the full length but available within 10mins, they had quite a selection of small flats and angles. Welds were ground down so as not to foul the jig.

27085 27086 27087

I have also made the jig. It is very crude but I think will work well and is very solid once clamped to the frame. It consists to a piece of milled aluminium plate with a window cut in it for the router, and two pieces of angle iron that are clamped to the 80mm box section of the frame. Three M5 levelling bolts thread up through the angle iron and the plate sits on these, these form 3 adjustment points to bring the top of the plate into plane with the laser. Then 3 M6 locking bolts pass down through the plate into threaded holes in the angle iron clamp down the plate hard onto the tops of levelling bolts. The levelling works perfectly and is very quick.

The plate has a recess milled into it to clear the flat stock, the idea is to set the router height to the thickness of the plate, level the jig, mill off the flat stock, unclamp the jig and move along, repeat.

27088 27090 27089

So that was all very cool and it looks like it will work, however now for the irritating part which will require some thinking. The frame is sat on my supposedly sturdy bench. Unfortunately a wooden bench will not cut it for this operation. With the sensor on top of the frame and the frame clamped hard directly over the 4x4" leg I can compress the leg about 0.1mm by pushing own as hard as I can on top. This is too much and means I need something much firmer to put the frame on before continuing.

You see you can find out all sorts of pointless things with this laser system, I now know that about 50kg on the end of 2 bits of 2x4 about 1m long will compress them 0.1mm, how useful ;-)

It maybe that now is the time to build the solid table that machine will sit on then use that to do the levelling on, or bolt the frame directly to the concrete floor even.

JAZZCNC
17-01-2020, 05:26 PM
Quick question have you checked the end float of this trim router.? I've had quite a few of these trim routers and they are not the best-built things so I wouldn't be surprised if it didn't float more than the Um values your chasing.? . .Esp trying to mill steel with it.!

The frame doesn't look that large do you know anyone with a large surface plate could fit it on. If so then I'd suggest you use Metal Repair paste, like Belzona 1111. This is the method I use for machines that will fit on my surface plate. Better than Epoxy and about the same in costs. It can be Drilled and tapped easily and as strong if not stronger than the metal it's bonded onto. Isn't too fussy about temperatures and they even have types that can be used underwater or subzero temperatures. Dry's in hours not weeks.!

https://www.belzona.com/en/products/1000/1111.aspx

devmonkey
17-01-2020, 05:45 PM
Quick question have you checked the end float of this trim router.? I've had quite a few of these trim routers and they are not the best-built things so I wouldn't be surprised if it didn't float more than the Um values your chasing.? . .Esp trying to mill steel with it.!

The frame doesn't look that large do you know anyone with a large surface plate could fit it on. If so then I'd suggest you use Metal Repair paste, like Belzona 1111. This is the method I use for machines that will fit on my surface plate. Better than Epoxy and about the same in costs. It can be Drilled and tapped easily and as strong if not stronger than the metal it's bonded onto. Isn't too fussy about temperatures and they even have types that can be used underwater or subzero temperatures. Dry's in hours not weeks.!

https://www.belzona.com/en/products/1000/1111.aspx

Yeh I checked it with a DTI, if there is end play it is less than 10um so hopefully it will be ok. The little router seems quite happy with steel, I only need to take off about 1/4mm. The best approach is to use masking tape to shim the router off the plate by the the thickness of the tape, cut the surface, then remove the tape and re cut, cutting loads on the 'finish' pass are almost nothing as only taking off a tiny amount of material. I've tested this on a bit of scrap flat bar and it leaves a flycut quality finish, shiny.

I did ask my mate who has a precision machining shop if he would be happy to surface mill the whole thing, he said he would but there is a long queue and since it is run like a clean room for doing some specialised parts I don't think he was overly keen me on me dragging in a great lump of dirty steel ! Good idea with taking an impression of a surface plate, I don't know anyone locally with one though other than him.

If I screw up this optical levelling I might go back to him, there will be enough material left for surfacing.

I've fixed the problem of my compressible work bench by removing one frame of reference, laser is now fixed to a lump of box tacked to the frame:
27091

EDIT
That metal repair paste looks fantastic, it is epoxy based as well unlike the polyester rubbish I have here.

JAZZCNC
18-01-2020, 10:40 PM
That metal repair paste looks fantastic, it is epoxy based as well unlike the polyester rubbish I have here.

Anyone who used to work down a mine will probably remember Belzona, it was a common and came in a sausage shape plastic packet about 12" long with hardener down the side. You cut it down the middle and mixed it straight away, you had about 10mins before it set like concrete. When I was a young mechanic just about every miner's car in yorkshire had some in the sills or chassis used as filler..Lol

It's come along way since then and the current Belzona is amazing stuff, esp the ceramics. I accidentally used some by mistake and while it was only 3mm thick it hate quality jobber drills for breakfast.

Got a question about this Laser setup.? How wide a beam can it throw and still be accurate.? Could it, for instance, cover a 6mtr x 4mtr area.?

devmonkey
18-01-2020, 11:41 PM
Anyone who used to work down a mine will probably remember Belzona, it was a common and came in a sausage shape plastic packet about 12" long with hardener down the side. You cut it down the middle and mixed it straight away, you had about 10mins before it set like concrete. When I was a young mechanic just about every miner's car in yorkshire had some in the sills or chassis used as filler..Lol

It's come along way since then and the current Belzona is amazing stuff, esp the ceramics. I accidentally used some by mistake and while it was only 3mm thick it hate quality jobber drills for breakfast.

Got a question about this Laser setup.? How wide a beam can it throw and still be accurate.? Could it, for instance, cover a 6mtr x 4mtr area.?

So the way to think about it is as a bunch of rays leaving the laser, each will travel in a straight line. If the optics are good then all these rays will also lie in a plane forming a line on whatever vertical surfaces they hit. I haven't tested the straightness at that distance only that it can be focused to a tight beam at around 10m.

One thing you could try with your large surface plate is setup the laser on the plate, take a bunch of readings in a 1m radius with the sensor sat on the plate, this will tell you whether the laser is planar and if not what the error is for each arc segment, i.e. you can calibrate the optics. Then you can project this error as far as you like to whatever you are actually measuring.

The biggest issue will be whatever you mount the laser on will have to be really solid as just 1 arc second of wobble on the mount will be 0.05mm at 10m. One solution to this is using differential measurement like they do with electronic precision levels, setup one or more fixed sensors and use these to offset any error caused by you breathing near the laser ;-)

This is the part of the system I'm really struggling with. With my laser mounted on that piece of box section with sticks out 400mm from the machine, reasonable finger pressure
is sufficient to bend the box section enough to cause a ~10um deflection in the height of the beam at the other end of the machine say 1.5m away.

When looking at this stuff where the sensor is measuring 3um pixels everything looks like it is made of jelly, at least everything in my garage including the 6 inch concrete slab.

What are you planning that is so large?

driftspin
19-01-2020, 12:02 AM
Anyone who used to work down a mine will probably remember Belzona, it was a common and came in a sausage shape plastic packet about 12" long with hardener down the side. You cut it down the middle and mixed it straight away, you had about 10mins before it set like concrete. When I was a young mechanic just about every miner's car in yorkshire had some in the sills or chassis used as filler..Lol

It's come along way since then and the current Belzona is amazing stuff, esp the ceramics. I accidentally used some by mistake and while it was only 3mm thick it hate quality jobber drills for breakfast.

Got a question about this Laser setup.? How wide a beam can it throw and still be accurate.? Could it, for instance, cover a 6mtr x 4mtr area.?Hi Jazz

Well, i think we arrived at the point were the cheap cam +software used as a levelling sensor proved it is very good.

The new problem is the lens you use to spread the laser into a beam....

The projected line can be a non straight because of the deviations caused by the optics used to spread the beam.


Does that summarize it?

I plan to use it to level check Y and X 1 axis at a time in the axial direction where the line is straight. First for vertical then horizontal deviation. maybe the diagonal

After that i will see...

Not sure how to do Z yet.

My laser crosshair only aligns in 1 orientation. +/- 0.8 mm /mtr out of plum
according to factory spec.

So Z could stil be non straight


Grtz Bert.



Verstuurd vanaf mijn SM-A320FL met Tapatalk

devmonkey
19-01-2020, 12:12 AM
There is an optical lab a few miles from my house and it has been built into a cave at the base of a rock cliff at the back of a disused quarry, presumably to reduce these problems with flexing buildings and temperature. It is literally behind a steel doorway set into the cliff.

devmonkey
19-01-2020, 12:17 AM
Hi Jazz

Well, i think we arrived at the point were the cheap cam +software used as a levelling sensor proved it is very good.

The new problem is the lens you use to spread the laser into a beam....

The projected line can be a non straight because of the deviations caused by the optics used to spread the beam.


Does that summarize it?

I plan to use it to level check Y and X 1 axis at a time in the axial direction where the line is straight. First for vertical then horizontal deviation. maybe the diagonal

After that i will see...

Not sure how to do Z yet.

My laser crosshair only aligns in 1 orientation. +/- 0.8 mm /mtr out of plum
according to factory spec.

So Z could stil be non straight


Grtz Bert.



Verstuurd vanaf mijn SM-A320FL met Tapatalk

Hi Bert,

The optics should be better than that even for a crap laser, usually the quoted accuracy is out of plum as you say, this is error relative to whatever reference the laser is bolted to, i.e. a pendulum usually, this is not usually a measure of how 'straight' the projected line is.

Cheers, Joe

JAZZCNC
19-01-2020, 12:19 AM
What are you planning that is so large?

Large double gantry machine for cutting and polishing granite and marble slabs. The two Gantry's will be mounted on linear rails which are basically fixed on top of a high wall on adjustable stainless steel plates. Accuracy to the Micron level isn't required but still needs to be reasonably good for the polishing.

devmonkey
19-01-2020, 12:35 AM
Large double gantry machine for cutting and polishing granite and marble slabs. The two Gantry's will be mounted on linear rails which are basically fixed on top of a high wall on adjustable stainless steel plates. Accuracy to the Micron level isn't required but still needs to be reasonably good for the polishing.

Sounds like a proper installation!

I can only suggest you pick up a laser and try it, or even just borrow a rotary laser from a local builder or window fitter.

JAZZCNC
19-01-2020, 12:38 AM
Sounds like a proper installation!

I can only suggest you pick up a laser and try it, or even just borrow a rotary laser from a local builder or window fitter.

I know a few machine installers who use lasers for large machines and lathes so I'll probably speak with them when the time comes. It's a long way off yet and could change in design before then so will see.

m_c
19-01-2020, 01:34 AM
Sounds like a proper installation!

I can only suggest you pick up a laser and try it, or even just borrow a rotary laser from a local builder or window fitter.

Jazz will need something far more accurate than the cheap rubbish your typical builder will likely have.

My parents neighbour is a highly regarded surveyor, and has many tales to tell about builders and cheap kit. One was a job to do an independent inspection of a private swimming pool, which after being filled with water, had a 4" height difference between ends.
After a bit questioning, it came to light the builder had used a 'precision' laser to do the setting out, as lasers are "accurate" and less hassle than using a basic water level (aka a bit clear hose). Turned out his 'precision' laser was a special from Screwfix that had never been calibrated, but the builder was really pleased with it as it only cost him a couple hundred pound.
As the neighbour highlighted to him, it had just cost him far more than a couple hundred pound, as the whole swimming pool was going to have to be stripped out and redone.

devmonkey
19-01-2020, 10:25 AM
Jazz will need something far more accurate than the cheap rubbish your typical builder will likely have.

My parents neighbour is a highly regarded surveyor, and has many tales to tell about builders and cheap kit. One was a job to do an independent inspection of a private swimming pool, which after being filled with water, had a 4" height difference between ends.
After a bit questioning, it came to light the builder had used a 'precision' laser to do the setting out, as lasers are "accurate" and less hassle than using a basic water level (aka a bit clear hose). Turned out his 'precision' laser was a special from Screwfix that had never been calibrated, but the builder was really pleased with it as it only cost him a couple hundred pound.
As the neighbour highlighted to him, it had just cost him far more than a couple hundred pound, as the whole swimming pool was going to have to be stripped out and redone.

LOL, my swimming pool is within 2-3mm when full and I used a cheap dewalt laser when I pumped the concrete for that, your eyeball can tell 4" at the length of the pool. Anyway you are confusing the pendulum laser alignment error with the optical error, quite different things, surveyors only care about the former. Similarly a window fitter, specifically someone who fits bespoke bi-folds will have a laser scanner for scanning the openings as the units are manufactured to fit.

27095 27096

Still would have required some shimming to attach linear rails rather than sandstone ;-)

JAZZCNC
19-01-2020, 12:07 PM
Jazz will need something far more accurate than the cheap rubbish your typical builder will likely have.

I agree Moray, my experience of builders laser level hasn't left me blown away either.
If this build happens then I'll look deeper into laser leveling and probably go hire the equipment I need or get one of the guys I now in when setting up the rails.
To be honest the precision doesn't need to be super high because one gantry will be used with Circular saw attached so no great accuracy required at all. The other will be mostly 2D profiling and edge molding using special profile edge tooling and polishing heads. Only making Kitchen countertops so flatness isn't to precision levels and most of the finishing is done by hand. At the moment all of the cutting, shaping, and polishing are done by hand so will be a massive improvement. They just need to save up some penny's or speak nicely to bank manager...Lol

Kitwn
19-01-2020, 02:55 PM
I recon you're missing an opportunity here Dean. Get Joe in as optical consultant and then get John to pop over from Melbourne and build you an add-on Z-axis assembly that can grind kitchen bench offcuts into surface plates for cash at the weekend when nobody's looking.:welcoming:

Kit

PS Joe is that really a swimming pool in Pommieland?! I hope it's got solar heating. Even in Perth we only used ours for a few months around Christmas.

devmonkey
19-01-2020, 03:16 PM
PS Joe is that really a swimming pool in Pommieland?! I hope it's got solar heating. Even in Perth we only used ours for a few months around Christmas.

Yeh I was sceptical too but the kids and missus were rather insistent ! I used ICF for the walls helps a lot with heat loss, and it uses a 39KW air sourced heat pump which has a COB of about 10-15, you put in 3kw of electricity get out 30kw of heat, that together with global warming lets us keep it at 28 degrees from May-Sept, it has ice on it today though. Biggest electrical expense is the water pump, going to convert this to DC and run it directly off a couple of solar panels next season. Hardest part of making it was wiring together 3km (I kid you not) of rebar before pumping the concrete, I had bloody hands doing that for a fortnight.

Getting a bit off topic but anyone interested in getting a swimming pool, build it your self as I did. It cost less than a decent CNC router, £1k for rebar, £5k concrete, £1k ICF and then £3k for some locally licensed rip off merchant to fit the liner. Local pool company came round to have a look when it was finished and told me they would have charged me £80k for building it.

JAZZCNC
19-01-2020, 03:44 PM
Local pool company came round to have a look when it was finished and told me they would have charged me £80k for building it.

80K for a hole in the ground, they must be on drugs. To be honest, I wouldn't pay 11K either, living in Yorkshire we are surrounded by dozens of old Pit sites and brickworks which all had great big clear blue ponds(well not all clear blue.!), which as kids we lived in. most are still there and know nature reserves or fishing ponds so who needs a heated swimming pool... Lol

devmonkey
19-01-2020, 03:52 PM
80K for a hole in the ground, they must be on drugs. To be honest, I wouldn't pay 11K either, living in Yorkshire we are surrounded by dozens of old Pit sites and brickworks which all had great big clear blue ponds(well not all clear blue.!), which as kids we lived in. most are still there and know nature reserves or fishing ponds so who needs a heated swimming pool... Lol

Everything with swimming pool in its name has a 10x price multiplier. The guy to fitted the liner has a 'swimming pool liner vacuum pump' to suck the plastic liner onto the pool shell, this machine cost him £2k. It was a £60 machine mart dust extractor fan like we use in our workshops with a nice stainless steel pool company badge plate riveted over the 'Clarke' label, unbelievable.

Clive S
19-01-2020, 03:55 PM
a 39KW air sourced heat pump which has a COB of about 10-15, you put in 3kw of electricity get out 30kw of heat

I would be interested in the make and model of the air sourced heat pump as I thought that they were only about 3-4 times the input.

devmonkey
19-01-2020, 04:05 PM
I would be interested in the make and model of the air sourced heat pump as I thought that they were only about 3-4 times the input.

Here you go,
https://www.heatpumps4pools.com/product/bwt-fairland-inverter-plus-swimming-pool-heat-pumps/

"Excellent COPs – from 5.8 to 15.8 due to Inverter technology"

Depends how hot the air is relative to the water temp, I don't think you can expect the same when you use them to heat your house in the winter as some people are starting to do. Mine is the 27kw single phase one, not 39kw as I originally posted, brain glitch. Once up to temp it just runs at tick over for most of the summer and stops all together on hot days.

devmonkey
20-01-2020, 12:10 AM
Back to the job in hand.

I found a rather obvious flaw in my sensor setup for setting my routing jig into plane today. I have the sensor mounted in a nice true cube and this sits on the jig plate. I then alternate its position above the 3 levelling points bringing each up to the correct height with the jack screws. The problem is unless the sensor is positioned in exactly the same location at each point for subsequent rounds of this procedure you will get different readings. This is because the sensor is effectively rotated around the axis of the jack screw and since the plate is not yet planar to the laser the height of the sensor relative to the laser plane changes based on this rotation. This makes it bloody difficult to do, and it is not until the plate is planar with the laser that sensor reads the same height right across the plate.

To put it another way with the sensor sitting on a plate that is not planar with the laser if you rotate the sensor about any point that is not the vertical axis of the sensor chip itself then the reading will change since the height has changed, similarly if you slide the sensor up and down this plate the height reading will change. This means you can trick yourself into thinking the heights are zero'd by moving the sensor, which I noticed I was doing.

There are two options:

1. Machine up a new sensor mount with some mechanism (likely a dowel pin) inline with the vertical axis of the sensor to that can be used to relocate the sensor consistently at 3 points across the plate.
2. Use 3 sensors simultaneously (would need software change) each fixed to the plate for the levelling operation.

Kitwn
20-01-2020, 05:15 AM
Here you go,
https://www.heatpumps4pools.com/product/bwt-fairland-inverter-plus-swimming-pool-heat-pumps/

"Excellent COPs – from 5.8 to 15.8 due to Inverter technology"

Depends how hot the air is relative to the water temp, I don't think you can expect the same when you use them to heat your house in the winter as some people are starting to do. Mine is the 27kw single phase one, not 39kw as I originally posted, brain glitch. Once up to temp it just runs at tick over for most of the summer and stops all together on hot days.

Over here it's called 'reverse cycle air conditioning' you can either heat or cool your house depending on the season. Heating is no good when it's so cold the outside unit freezes up but in more temperate climates like most of Australia it works well. If you need air-con for the summer anyway it's a cost effective heating system to install and to run.
OK, back on track:welcoming:

Kitwn
20-01-2020, 05:27 AM
Thinking out loud, but is there a three-sensor option that works the the other way round? Set up three sensors around the router frame and firmly fix the laser in one position on top of the moving plate. only the plate needs to be moved and adjusted for constant numbers out of the sensors. No trailing wires from the plate to tread on either. This does require the design to allow the laser to stay in place during routing or to be accurately replaced between cuts.

Clive S
20-01-2020, 09:36 AM
Here you go,
https://www.heatpumps4pools.com/product/bwt-fairland-inverter-plus-swimming-pool-heat-pumps/

"Excellent COPs – from 5.8 to 15.8 due to Inverter technology"



Thanks for the feedback. But it also states this

"Bear in mind though that there is no international standard for stating COPs and therefore each manufacturer will state the maximum COP obtainable for their units under optimum temperature and humidity conditions. In reality you may not therefore always acheive the COP rating stated."

I have been involved in installing a few heat pumps air source and ground source and I believe that they were in the region of about 3-4 to 1. My next door neighbour has had his gas taken out and put in an air source pump. I am very interested to see the results over time.

devmonkey
20-01-2020, 10:03 AM
Thanks for the feedback. But it also states this

"Bear in mind though that there is no international standard for stating COPs and therefore each manufacturer will state the maximum COP obtainable for their units under optimum temperature and humidity conditions. In reality you may not therefore always acheive the COP rating stated."

I have been involved in installing a few heat pumps air source and ground source and I believe that they were in the region of about 3-4 to 1. My next door neighbour has had his gas taken out and put in an air source pump. I am very interested to see the results over time.

Hi Clive,

All I can tell you is throughout a season the total kwh used by the heat pump is is about the same or less than the 1hp water pump that is switched on for exactly the same time, I have clamp on current monitors on both going to the main energy logger in the house. The heat pump pulls about 2.9kw max and will bring 60m^3 of water from 18 to 28 degrees in a couple of days. Costs about £1k in electricity to run both per season. I have no experience of them in houses although a friend who has also just rebuilt his house is now relying solely on an air sourced heat pump for house heating with hot water boosted with immersion and tells me he is saving a fortune, but he wasn't on mains gas rather oil delivered by tanker which is expensive.

What maybe of interest is I had a 10kw pump heating a much smaller 10m^3 above ground pool, this was the older generation pump without the inverter and therefore constant compressor speed / current draw. The electricity cost of running this unit was the same per season as the new pool system, therefore it must have been much less efficient.

mekanik
20-01-2020, 11:01 AM
Clive
I looked into heat pumps several year ago, obviously ground source is the most efficient but due to my building plot this is not an option, max for air source is in the region of COP 5
https://www.viessmann.co.uk/products/heat-pumps/air-source-heat-pumps/vitocal-300a
Regards
Mike

Clive S
20-01-2020, 11:23 AM
OK.I think I have hijacked this thread and taken it off topic sorry. But thanks for the feed back.

Kitwn
20-01-2020, 12:50 PM
As I said, the limiting factor on air-sourced reverse-cycle air con for heating is when the outside temperature is so low that the external heat exchanger freezes. In the UK I would expect you'd need some additional heating system for the coldest parts of the year (September to May in Cumbria if I remember correctly). In Perth (The Australian one rather than the original) we had a few occasions when the heat exchanger froze but but not many. A well insulated house obviously makes a big difference. It's been a while, but I think that unit used 4kW of electricity for the equivalent of 14kW of heating.

devmonkey
20-01-2020, 05:14 PM
I have realised something about these sensors. They are colour sensors, and the colour detection is done by layering a grid of colour alternating RGB filters over the individual pixels which are all identical photodiodes (i.e. the pixel is monochrome) in what is called a Bayer pattern. These are laid out to match the human eye's response to colour, with 50% of the pixels green and 25% red and 25% blue. See https://en.wikipedia.org/wiki/Bayer_filter

27114

This isn't ideal as I'm using a red laser. This means only 25% of the pixels are useful and the sensor will be interpolating the values between 'red' pixels.

Anyway someone pointed me towards some super crazy people in astrophotography who 'de-bayer' their very expensive DSLR sensors with a toothpick so the sensor becomes monochrome at its native resolution, effectively scratching off this colour filer layer to expose the raw sensor.
https://stargazerslounge.com/topic/166334-debayering-a-dslrs-bayer-matrix/

I have just tried this procedure and ruined a webcam sensor (ripped it off the pcb) so I don't recommend it.

EDIT
The first casualty of this miss-adventure, don't think it is still worth £7 !
27117

Kitwn
21-01-2020, 01:13 AM
I suspect this is not the greatest limitation on the acuracy of your system. Making the concrete floor of your shed more rigid should be a higher priority.:whistle:

devmonkey
21-01-2020, 10:38 AM
I suspect this is not the greatest limitation on the acuracy of your system. Making the concrete floor of your shed more rigid should be a higher priority.:whistle:

You may think that Kit, however I believe the (presumably linear) interpolation on the sensor is messing with my non-linear intensity fitting algorithms. It makes no sense to resolve down to sub-pixel resolution when 75% of the sensor information is estimated (Nyquist would have a fit).

For example imagine the raw intensity at the peak of our gaussian laser line looks like this:
100, 100, 101, 101, 100, 100
Now if this falls under the bayer filter on a green+red filter line arranged as:
G, R, G, R, G, R, G

With only red laser light, nearest neighbour linear interpolation would look like this:
100, 100, 100, 101, 100, 100

If the bayer filter is offset 1 pixel the other way you would get
100, 100, 101, 100, 100, 100

Therefore you have 1 pixel (3um) uncertainty and this is for a green+red filter line. I think is worse for a green+blue filter line where all the information is interpolated, i.e the information rate is zero.

I have some ideas to detect and strip this out but it is guess work without a datasheet for the camera chip, or maybe just reduce the resolution of the system from 1 pixel to say 4 pixels (6um).

I have a few RPIs here with cameras which I can get the raw bayer data from and just use the red pixels (can't get the raw data from a webcam), might we worth an experiment but would need entirely new code.

An alternative would be to use an IR laser as the bayer filter is transparent to IR therefore the sensor will behave as monochrome at full resolution, but then you couldn't see the laser for rough alignment.

Monochrome usb cameras (that are made without the bayer filter) are expensive as there is no mass demand.

Michael Gilligan
30-01-2020, 06:45 PM
Wow ... I stopped visiting this thread on page_15 when it went quiet after my post.

I have a lot of reading to do !!

MichaelG.

Michael Gilligan
30-01-2020, 07:07 PM
An alternative would be to use an IR laser as the bayer filter is transparent to IR therefore the sensor will behave as monochrome at full resolution, but then you couldn't see the laser for rough alignment...


May I also mention that, for the same reason, they are very dangerous things to have around.

MichaelG.

devmonkey
30-01-2020, 08:50 PM
Been a bit busy with other jobs, however I have been playing around with a raspberry pi version of this system. I took a PI zero W (with builtin wifi), a small TFT screen and an OV5647 (pi camera v1) and wrote some more software. This will form a simple standalone unit and addresses a number of the problems I was having with a simple webcam, specifically:

1. I access the raw camera sensor directly, read the bayer data and only use the red pixels. This removes a load of noise that was being introduced by the blue an green channels and interpolation. There is no interpolation done at all on the sensor using it this way which means I get the true intensity per (red) pixel. Pixel pitch is 1.4um and 1/4 are red so system resolution is 2.8um.
2. Vertical range is much improved around 4mm.
3. With lens removed there is no glass (or a very very thin glass maybe) over the pixel array unlike the VGA webcam which had about 0.5mm of glass which gave some diffraction patterns.
4. I put in an algo to dynamically adjust the exposure, this means I increase exposure until the detected gaussian starts to clip (sensor saturates) then back it down a bit. This makes things much more accurate and repeatable at varying distances from the laser source.
5. No more cables!

I printed a case for it today and mounted the camera to a piece of Aluminium, still need to fix it all together. It has a lipo cell on board that I salvaged from a dead rc pack, a usb charger / ups and lasts for about 3 hrs before needing recharging.


27233 27234 27235 27236


https://youtu.be/m-zK3vz7bbQ

Cheers, Joe

Michael Gilligan
30-01-2020, 11:46 PM
That’s a great development, Joe

Will we be able to select our colour ?
... methinks green would be worth a try.

MichaelG.

Michael Gilligan
31-01-2020, 12:20 AM
Hi All

My Recovering from the holliday's brain has been thinking on line generation.

Having disassembled many laser printers over the years I found in many of them the single point laser was scanned across the page by a (single point) laser beam reflected by a rotating polygon prism […]

If this concept proves doable we can generate a nice scanned plane.


An excellent idea, John

Incidentally: More years ago than I care to remember, I did some environmental tests on a scanner for reading bar-codes at the supermarket check-out [the type that generates a criss-cross of lines] : The interesting thing about this one was that they had dispensed with most of the real hardware and optics ... They were spinning a hologram !!

I don’t know if it ever went into full production.

MichaelG.
.

Edit: ... Just found supporting evidence: https://books.google.co.uk/books?id=x3FQDwAAQBAJ&pg=PT31&lpg=PT31&dq=supermarket+checkout+hologram+based+scanner&source=bl&ots=iYsKLIN4Mk&sig=ACfU3U14YGRO3mMUUTiQqKAAQbtb8Xx4iQ&hl=en&sa=X&ved=2ahUKEwiY2tqXvKznAhVBZcAKHaIPBykQ6AEwDHoECAYQA Q#v=onepage&q=supermarket%20checkout%20hologram%20based%20scan ner&f=false

Michael Gilligan
06-02-2020, 08:40 AM
This monochrome camera [with 2.2 micron pixels] may be of interest:

https://www.e-consystems.com/ar0521-monochrome-usb-nir-camera.asp

MichaelG.

devmonkey
20-02-2020, 07:31 PM
Work has been getting in the way of progressing my machine, but where I left off the laser system is working well enough to perform the operation (particularly with the raspberry pi version) however the process of position a jig and routing the steel frame into plane with a trim router was highly error prone.

1. It was difficult to level the jig since I didn't use concentric adjustment and clamping bolts,
2. The process requires that the laser doesn't move, the trim router height gauge doesn't move and the cutting tool doesn't break or chip throughout otherwise it has to be started over. Also the jig has to remain a planar plate and not wear, since I used tooling plate the surface got quite a lot of wear from the trim router.

This is what stopped me attempting it across the whole machine frame.

So I've had a bit of a rethink and come up with a different process that is hopefully a bit more forgiving and controlled. Rather than attempt to level the frame by grinding it the new processes will attempt to attach rail bearing sub plates to the frame such that these sub-plates are planar.

I'm thinking of using 10mm aluminium for the sub-plates. The plates would run the full length of the X axis on top of each steel beam and eventually the rails will be bolted to these plates. The plates will themselves be bolted to the steel frame in an adjustable manor such that they can be brought into plane using the laser, then they will be permanently fixed in place with a potting compound taking up the gap between plate and frame.

A few people have tried this using set screws to level the plates which seems quite fiddly unless you go the trouble of making concentric adjustment/locking bolts.

What I'm proposing is to take each plate and drill two sets of holes along the centre line. The first set will be counterbored and used to bolt the plate down to the steel frame, the second set will be used to inject the potting compound. To allow the plates to float above the frame but also be held accurately in height by the bolts I'm thinking a compressible gasket could be run down each side of the plate. As the bolts are tightened the gasket would compress pushing the plate up hard against the bolt, this is simpler than grub screws and locking bolts.

To prevent the two plates (one for each X rail) tilting they would be coupled together with lengths of angle during the process.

The laser would be setup and both plates adjusted into plane using the bolts, once everything is level potting compound would be injected through the remaining holes. The compressed gasket will now act to contain the potting compound.

I think this has a number of advantages,
1. The entire leveling process can be completed before making a permanent adjustment to the machine,
2. I would be directly leveling the final machine surface (the sub-plate) rather than some tool that is then used to machine the frame.

I have sketched this up, would welcome thoughts on it.

27431

driftspin
21-02-2020, 12:30 AM
Work has been getting in the way of progressing my machine, but where I left off the laser system is working well enough to perform the operation (particularly with the raspberry pi version) however the process of position a jig and routing the steel frame into plane with a trim router was highly error prone.

1. It was difficult to level the jig since I didn't use concentric adjustment and clamping bolts,
2. The process requires that the laser doesn't move, the trim router height gauge doesn't move and the cutting tool doesn't break or chip throughout otherwise it has to be started over. Also the jig has to remain a planar plate and not wear, since I used tooling plate the surface got quite a lot of wear from the trim router.

This is what stopped me attempting it across the whole machine frame.

So I've had a bit of a rethink and come up with a different process that is hopefully a bit more forgiving and controlled. Rather than attempt to level the frame by grinding it the new processes will attempt to attach rail bearing sub plates to the frame such that these sub-plates are planar.

I'm thinking of using 10mm aluminium for the sub-plates. The plates would run the full length of the X axis on top of each steel beam and eventually the rails will be bolted to these plates. The plates will themselves be bolted to the steel frame in an adjustable manor such that they can be brought into plane using the laser, then they will be permanently fixed in place with a potting compound taking up the gap between plate and frame.

A few people have tried this using set screws to level the plates which seems quite fiddly unless you go the trouble of making concentric adjustment/locking bolts.

What I'm proposing is to take each plate and drill two sets of holes along the centre line. The first set will be counterbored and used to bolt the plate down to the steel frame, the second set will be used to inject the potting compound. To allow the plates to float above the frame but also be held accurately in height by the bolts I'm thinking a compressible gasket could be run down each side of the plate. As the bolts are tightened the gasket would compress pushing the plate up hard against the bolt, this is simpler than grub screws and locking bolts.

To prevent the two plates (one for each X rail) tilting they would be coupled together with lengths of angle during the process.

The laser would be setup and both plates adjusted into plane using the bolts, once everything is level potting compound would be injected through the remaining holes. The compressed gasket will now act to contain the potting compound.

I think this has a number of advantages,
1. The entire leveling process can be completed before making a permanent adjustment to the machine,
2. I would be directly leveling the final machine surface (the sub-plate) rather than some tool that is then used to machine the frame.

I have sketched this up, would welcome thoughts on it.

27431

Hi devmonkey,

I think you might need 2 rows of bolts rather then the 1 row in the middle.

This will allow for correction of axial deviations.

Did you calculate the expected flex of the plate in relation to the gasket compression forces? This would dictate the number of bolts in relation to the maximum expected compression.

As said before all thing look like made out of gummy now we can measure things in microns.

I might be able to start measuring my machine tomorrow unless shmbo thinks of something more important.

Grtz Bert.



Verstuurd vanaf mijn SM-A320FL met Tapatalk

devmonkey
21-02-2020, 12:42 AM
Hi devmonkey,

I think you might need 2 rows of bolts rather then the 1 row in the middle.

This will allow for correction of axial deviations.

Did you calculate the expected flex of the plate in relation to the gasket compression forces? This would dictate the number of bolts in relation to the maximum expected compression.

As said before all thing look like made out of gummy now we can measure things in microns.

I might be able to start measuring my machine tomorrow unless shmbo thinks of something more important.

Grtz Bert.



Verstuurd vanaf mijn SM-A320FL met Tapatalk


Hi Bert,

I was hoping that bolting the two sub-plates together with angle would go a large way to reducing the axial deviation (twist), but we'll have to see.

I will calculate the compression forces required after measuring various gasket materials by squashing them with a known mass. If I start with plate that is relatively flat then most of the adjustment will be bringing these two flats into plane, not so much will be bending the plates into plane which requires significantly more force from the gasket. It maybe that a combination of gasket and hard shims under plate bends is required.

Will go hunting for some 10mm aluminium tomorrow and some gasket materials.

Cheers, Joe

John McNamara
21-02-2020, 03:59 AM
Hi Joe (Devmonkey)
Hi All

Firstly I am assuming profiled rails are being used not round rail for high accuracy, repeatability and negligible backlash.

Lateral adjustment of rails is difficult, particularly when you take into account the small amount of adjustment allowed by the clearance around the mounting screw in the bored hole in the linear rails. for type 25 rails typically a 6mm hole and a 5mm machine screw. This only allows +- 0.5 mm of lateral adjustment, and this is if all the mounting holes are perfectly placed. Note in the description the order of processing to minimise chips creeping into the joining surface and lifting the rail.

To solve this problem I devised method where the rails were positioned laterally first using cams. Once this was done I drilled and tapped the mounting holes using an inexpensively built jig. You can make the cams yourself or get them laser cut. You still have to countersink them as detailed in the link.

It is documented here:
https://www.model-engineer.co.uk/forums/postings.asp?th=139042

The method worked very well. Alas I have not completed the machine.
I can't wait to get back to it! Alas work has been getting in my way too.

Regards
John

Desertboy
21-02-2020, 09:30 AM
I have realised something about these sensors. They are colour sensors, and the colour detection is done by layering a grid of colour alternating RGB filters over the individual pixels which are all identical photodiodes (i.e. the pixel is monochrome) in what is called a Bayer pattern. These are laid out to match the human eye's response to colour, with 50% of the pixels green and 25% red and 25% blue. See https://en.wikipedia.org/wiki/Bayer_filter

27114

This isn't ideal as I'm using a red laser. This means only 25% of the pixels are useful and the sensor will be interpolating the values between 'red' pixels.

Anyway someone pointed me towards some super crazy people in astrophotography who 'de-bayer' their very expensive DSLR sensors with a toothpick so the sensor becomes monochrome at its native resolution, effectively scratching off this colour filer layer to expose the raw sensor.
https://stargazerslounge.com/topic/166334-debayering-a-dslrs-bayer-matrix/

I have just tried this procedure and ruined a webcam sensor (ripped it off the pcb) so I don't recommend it.

EDIT
The first casualty of this miss-adventure, don't think it is still worth £7 !
27117

I managed to buy a monochrome webcam years ago, it was expensive over £200 and I had to buy it from China has highly specialised.

It only saw Far Red (Near Infrared) specifically to see phytochrome reactions in plants.

devmonkey
21-02-2020, 05:57 PM
I found a few different self adhesive glazing gaskets to experiment with. The one that works best is a 5x10mm rectangular profile neoprene strip, no idea where it came from. It isn't the very soft foam draft stop stuff, nor is it full rubber, it is designed to be compressed between the rebate and the glass on a fixed window. It is a closed cell structure not the sponge.

I also picked up the aluminium from SPA, huge stocks and fantastic price with cash at the door, perfectly happy with me picking up a couple of lengths.

So the experiment was to check the compression rate of the gasket and also whether I could inject some potting compound. I used around 400mm of 50x6 flat bar and clamped it into two lengths of the gasket stuck to a bit of 4x2. With the clamps at maximum pressure the gasket was compressed to about 2mm, the clamping force from the bolts I'm planning to use will be at least as much as from these hand clamps. Also the gasket is strong enough to just distort the aluminium which is perfect.

A 6mm hole was drilled in the middle for injection and countersunk. I used a normal decorators caulk gun to inject glazing sealant which has about the same consistency as West's 105/205 colloidal silica thickened epoxy which is what I will use on the actual job. The gun was pressed hard against the countersunk hole and sealant injected. I had to use quite a lot of force but it pushed the sealant through easily,.

So not very scientific but all very promising. Next step is to drill up the sub-plates and get them mounted on the machine frame.

27436 27437 27438

driftspin
22-02-2020, 06:37 PM
Ok so i found a little time to do a leveling test at the new home of the machine.

I have setup the laser pointing along the long axis crosshair at about the middle of the gantry.

My flexing concrete floor is making things much harder then i expected while measuring adjusting and measuring again.
Walking around influences measurements.

My concrete floor is cast on sand, dont have any more information about it now.


In general all 4 x,y corners are in the same plane now .. within about 5 um.
Trying to get it any better seems silly compared to what walking around does to the measurements.

In the end my goal is checking the machine for general flatness and setting it up level

Both the long axis now look like they are within 10um deviation over 1800 mm of travel, this is far better than i expected.
Thank you epoxy.

Having the laser setup on a solid object other than the cnc table frame is a must.
When connected to the frame things get complicated quickly when 1 corner is adjusted everything changes.

Like mentioned here before, now we can visualize micrometers everything looks like made of jelly.


The gantry though looks like it has a deviation of about 50 um upward in the middle. This is a bit weird to me, the epoxy proces was done the same way and the axis is much shorter. There was no welding after epoxy.


I am going to re test this axis by moving the laser 90deg and in line with the gantry.
This should cancel out some optics quality issues. I guess the projected line could be non straight.

Thank you guys, for this cool solution.


Grtz Bert.



Verstuurd vanaf mijn SM-A320FL met Tapatalk

devmonkey
22-02-2020, 10:53 PM
Hi Bert,

Sounds like it is working for you, fantastic. What laser and camera are you using? Are you sure of the units, i.e. did you set the um per pixel?

I'm assuming you moved the machine frame to meet the laser plane to get the corners so close, adjustable feet?

My 6 inch concrete slab also looks like jelly with this system.

Joe

driftspin
23-02-2020, 06:24 PM
Hi Bert,

Sounds like it is working for you, fantastic. What laser and camera are you using? Are you sure of the units, i.e. did you set the um per pixel?

I'm assuming you moved the machine frame to meet the laser plane to get the corners so close, adjustable feet?

My 6 inch concrete slab also looks like jelly with this system.

Joe

Today i got to some measuring again.

About my setup.

I have a cheap bosch crosshair laser which I now know is not up to this task.

The webcam is a 1920x1080 6.2 ish by 3mm sensor... so +/- 3um.

Yes i have m12 adjustable bolts in the feet.
10 deg of turning on the feet is clearly visible in the software.

About the units i am sure it is still on defaults so 1um, need to check.
Yes my measurements in the earlier post are off by factor 3.
Not yet that important since i was testing the setup and finding out the sop.

### about The laser.
The selflevelling seems to be spot on.
The optics are not.
I found out today.
Moving towards and from the laser the light is straight (light travels in a straight line) moving along the projected line gives false readings. +/- 60 um / 80 cm at about 3meters distance so only a few degrees

Now i know this, it is okay the way it is.
Just make sure you move in a straight line from and to the lightsource.

I have to put the laser a bit further away to get into the better sensitivity range of the camera. It all helps.

Actionplan:
* Input the correct units in the software
* Use a tripod laserplatform
* Put the tabel diagonals in plum.
* Check the 2 long axis.
* Check the short axis for horizontal variations.
* Check the short axis at lowest point and highest point to check top and bottom rail for allignment.

I have not thought of a way to check the spindle for misalignment by webcam/laser without trusting the optics.

But maybe a conventional plumbline and a light source (is that the right English word?) can do the job.


Grtz Bert.

Verstuurd vanaf mijn SM-A320FL met Tapatalk

devmonkey
24-02-2020, 12:37 AM
Really useful details, thanks Bert.

When you see the error from moving along the projected line, is it random noise or is it like the line is bent up or down in the middle, like your gantry measurement ?

I think I have seen the line bent like this. I did a little experiment with a dot laser and a glass cylinder (wine glass stem). When the laser passes through the cylinder at 90 degrees you get a straight line projected, when you angle the glass a lot you get a visibly bent line either up or down depending which way to hold the angle.

Maybe this is a common problem with the line optics, and maybe we could calibrate it out by taking two sets of measurements along a straight edge with the laser flipped 180 axially for each set. Will have to think on this, any thoughts welcome...

Although it would not be easy to flip your laser as it is on a pendulum.

driftspin
24-02-2020, 11:56 PM
Really useful details, thanks Bert.

When you see the error from moving along the projected line, is it random noise or is it like the line is bent up or down in the middle, like your gantry measurement ?

Hi devmonkey,

Yes it was like you described with the laser vs wineglass stem.



The noise was within 5 orso units.
when measure is pushed several times in 60 sec... maybe +/- 1 or 2 units.




Grtz Bert.






Verstuurd vanaf mijn SM-A320FL met Tapatalk

devmonkey
25-02-2020, 10:44 AM
Hi Bert,

I have had an idea of how to create a tool to check whether the rails are planar that doesn't matter if the laser line is bent.

It is effectively a large scale repeat-o-meter using the laser rather than DTI and thereby avoiding a very long infinitely stiff top bar:
27444

The setup would consist of 4 spherical feet arranged in a square. 3 of these feet would be rigidly mounted on a triangular frame, the fourth foot would float on an arm that can pivot up and down on a hinge at the centre of the square. The camera would be fixed above this forth foot and the laser fixed to the triangular frame diagonally opposite. None of this would need to be high precision, the only requirement is that the triangle be stiff.

To calibrate the tool you could use any reasonably flat surface, it doesn't have to be a perfect plane but shouldn't be pitted.

Lay the tool on the surface and mark where the 4 feet touch as accurately as you can. Take a height reading of the laser on the sensor. Now lift the tool and rotate it 90 degrees such that the feet sit back on the 4 marks made and take another height reading. I think that the middle of the two height readings will be the point where all 4 feet are in plane, so we zero the tool to this mid point.

If this is a new machine then you would level the master rail bed in isolation using the laser projecting along it.

Now place the new calibrated tool on the machine frame such that two feet of the triangle rest on the master rail bed and the other two on the slave rail bed. Now adjust the slave rail bed under the floating foot until you read zero. These four points on the machine are now in plane. You can check the tool is still calibrated by rotating it 90 degrees on the machine frame and checking for zero.

We now have two points on the slave rail bed that are planar with the master so the slave rail bed can now be levelled in isolation to a line passing through these two points.

27445

I think this a similar approach to using two crossed wires between 4 points to check for plane when the wires just touch, but this should be much more accurate.

If you had a machine where the two rail beams are adjustable at the ends then this would be an extremely simple way to bring them into plane.

Cheers, Joe

driftspin
26-02-2020, 08:51 PM
Hi Bert,

I have had an idea of how to create a tool to check whether the rails are planar that doesn't matter if the laser line is bent.

It is effectively a large scale repeat-o-meter using the laser rather than DTI and thereby avoiding a very long infinitely stiff top bar:
27444

The setup would consist of 4 spherical feet arranged in a square. 3 of these feet would be rigidly mounted on a triangular frame, the fourth foot would float on an arm that can pivot up and down on a hinge at the centre of the square. The camera would be fixed above this forth foot and the laser fixed to the triangular frame diagonally opposite. None of this would need to be high precision, the only requirement is that the triangle be stiff.

To calibrate the tool you could use any reasonably flat surface, it doesn't have to be a perfect plane but shouldn't be pitted.

Lay the tool on the surface and mark where the 4 feet touch as accurately as you can. Take a height reading of the laser on the sensor. Now lift the tool and rotate it 90 degrees such that the feet sit back on the 4 marks made and take another height reading. I think that the middle of the two height readings will be the point where all 4 feet are in plane, so we zero the tool to this mid point.

If this is a new machine then you would level the master rail bed in isolation using the laser projecting along it.

Now place the new calibrated tool on the machine frame such that two feet of the triangle rest on the master rail bed and the other two on the slave rail bed. Now adjust the slave rail bed under the floating foot until you read zero. These four points on the machine are now in plane. You can check the tool is still calibrated by rotating it 90 degrees on the machine frame and checking for zero.

We now have two points on the slave rail bed that are planar with the master so the slave rail bed can now be levelled in isolation to a line passing through these two points.

27445

I think this a similar approach to using two crossed wires between 4 points to check for plane when the wires just touch, but this should be much more accurate.

If you had a machine where the two rail beams are adjustable at the ends then this would be an extremely simple way to bring them into plane.

Cheers, Joe

Hi Joe,

I am not sure i understand correctly.
Does this device need to be at the exact centre of diagonals?

Doesnt the mentioned reference flat surface have to be in the same paralel plane as the rails then?



Grtz Bert.

Verstuurd vanaf mijn SM-A320FL met Tapatalk

devmonkey
27-02-2020, 01:01 AM
Hi Bert,

No nothing needs to be centred on the diagonals, the only restriction is that the device can only check a square not a rectangle, but this doesn't matter as we can always define a square ontop of the rectangle formed by our pair of rail beds.

The reference surface doesn't really exist. What we are doing is defining a square as four points on the device, call them A, B, C, and X:

AB
XC

With [A,B,C] fixed in relation to each other and X able to move up and down. Since [A,B,C] are fixed relatively to each other (in a triangle) they form a plane. The laser is fixed to this plane on the device near B pointing towards X. The camera is fixed to X.

Now define a square the same size on a table top or the machine frame or whatever, label the corners of this square 1, 2, 3, 4:

12
43

Place the device over this square such that A==1, B==2, C==3, X==4. Measure the laser height on the sensor at X. Now rotate the device 90 degrees so that say A==2, B==3, C==4 and X==1 and measure the new laser height at X which will have changed because your surface defined by [1,2,3,4] you drew on your table is not a perfect plane.

Now if you were to move X up or down so that the laser measured height is half way between the two heights measured then I think that X will be planar with A,B,C. So zero the software at the mid height between the two X heights measured and you now have a calibrated device which will read zero when placed on a true plane and a signed error when placed on an untrue plane. In other words [A,B,C,X] will be planar when the newly zero'd X is at zero. You can use this to check a machine is in plane and adjust the machine as required until it reads zero.

I haven't tested this only thought about it, I might be missing something, will draw it in CAD and check the theory is correct.

Cheers, Joe

devmonkey
02-03-2020, 03:42 PM
Hi Bert and everyone,

Here are some renderings of the laser-plano-meter I've been trying to describe.
27468 27469

It consists of a square device sat on 4 spherical feet at the corners. 3 corners of the square are rigidly connected to form a triangle (orange part) with laser attached. The forth corner is attached by the green arms to the triangle with flexures that allow it to pivot up and down with respect to the triangular plane, effectively the square is allowed to fold along its diagonal. The camera sensor is attached to the forth corner.
27470

The laser will project a line on the sensor, the height of this line is related to the angle of the fold. The goal is to find the sensor reading where ALL 4 feet are in the same plane thereby providing a method of measuring the error of any surface from a plane. We will call this sensor reading ZERO.

To find ZERO we place the device on any surface, doesn't need to be a plane. We then take the laser height measurement H1 in this position. Now rotate the device 90 degrees about the Z axis and replace it on to the same surface so that each foot is in the same place as its predecessor was in the first position. Now measure laser height H2.

With both H1 and H2 we can calibrate the device. ZERO is the mid point between H1 and H2.

Now place the device on the surface to be measured, e.g. the pair of X rail beds of the CNC frame. The deviation from ZERO will tell you how much to adjust the frame under the 4th foot in order to bring the surface into plane.

An alternative way to think of it is if you just placed the non-zero'd device on the machine frame and take the laser height measurement, then rotate 90 degrees and repeat, if the heights are different you need to adjust the frame. Make the adjustment, rotate the device back to its original position and repeat until the height readings match.

EDIT
Should be noted that this device could be constructed with a DTI instead of a laser as per a normal repeat-o-meter. In this case you would have just the orange triangle and replace the laser with a long arm with the DTI on the end. The problem of course would be that the error due to the long arm flexing due to its own weight and the pressure from the DTI spring would far exceed the resolution of the DTI. This is not a problem with the laser beam as it wont bend no matter how long it is.

Cheers, Joe

driftspin
02-03-2020, 11:29 PM
Hi Bert and everyone,

Here are some renderings of the laser-plano-meter I've been trying to describe.
27468 27469

It consists of a square device sat on 4 spherical feet at the corners. 3 corners of the square are rigidly connected to form a triangle (orange part) with laser attached. The forth corner is attached by the green arms to the triangle with flexures that allow it to pivot up and down with respect to the triangular plane, effectively the square is allowed to fold along its diagonal. The camera sensor is attached to the forth corner.
27470

The laser will project a line on the sensor, the height of this line is related to the angle of the fold. The goal is to find the sensor reading where ALL 4 feet are in the same plane thereby providing a method of measuring the error of any surface from a plane. We will call this sensor reading ZERO.

To find ZERO we place the device on any surface, doesn't need to be a plane. We then take the laser height measurement H1 in this position. Now rotate the device 90 degrees about the Z axis and replace it on to the same surface so that each foot is in the same place as its predecessor was in the first position. Now measure laser height H2.

With both H1 and H2 we can calibrate the device. ZERO is the mid point between H1 and H2.

Now place the device on the surface to be measured, e.g. the pair of X rail beds of the CNC frame. The deviation from ZERO will tell you how much to adjust the frame under the 4th foot in order to bring the surface into plane.

An alternative way to think of it is if you just placed the non-zero'd device on the machine frame and take the laser height measurement, then rotate 90 degrees and repeat, if the heights are different you need to adjust the frame. Make the adjustment, rotate the device back to its original position and repeat until the height readings match.

EDIT
Should be noted that this device could be constructed with a DTI instead of a laser as per a normal repeat-o-meter. In this case you would have just the orange triangle and replace the laser with a long arm with the DTI on the end. The problem of course would be that the error due to the long arm flexing due to its own weight and the pressure from the DTI spring would far exceed the resolution of the DTI. This is not a problem with the laser beam as it wont bend no matter how long it is.

Cheers, JoeYes, that really helped.

This is a clever design.

I will try this later. I think a simple laserpointer will do i guess in this scenario.


Thnx Grtz Bert.



Verstuurd vanaf mijn SM-A320FL met Tapatalk

devmonkey
23-05-2020, 06:18 PM
Afternoon all.

I've finally got back to my machine project. I gave up with trying to create a planar surface in one shot and as the weather had warmed up I poured epoxy, this looks like it has worked well and made a very close surface for final levelling using the laser and shimming if required.

Anyway the purpose of this post is to describe a new app I put together today for laying the master rail straight. I decided it would be easier to use a taut wire rather than the laser for this and a cheap USB microscope.

So armed with some 0.28mm black fishing line I found in the garage and a club hammer I tensioned a wire parallel to where the master rail will sit. I used some white insulation tape on the machine frame below the wire to provide good contrast for the software and the wire runs over a couple of bolts that run through angle iron supports clamped to the ends of the machine frame. The wire is anchored at one end and the club hammer suspended from the other, the fishing line stretches out quite a bit and you can see the nylon flowing under the microscope, I waited for it to stop flowing before doing anything else.

The microscope is attached to a hiwin carriage and the new app accurately locates the wire allowing you to zero the tool then reports the error as you slide the carriage back and forth. A 3D printed clamp allows the microscope to the rigidly attached to the magnetic base.

Nothing new in the process that other people have performed other than the app that lets you achieve excellent accuracy with little effort. The resolution is roughly 3um per pixel repeatable down to less than 1um (relative to the straightness of the taut wire obviously).

The wire locating algo is quite different from the laser gausian model and seems extremely robust. For those interested it locates the two edges of the wire using a median gradient threshold down each column of pixels, regresses lines down these edges and auto tunes the threshold until it has exactly two lines that completely cross the image from left->right. It then bisects the two edge lines to locate the wire centre. This removes any error from tapering of the wire due to stretching under tension. You hit zero then the app will will show you the relative error to this point as you move the rail and/or carriage about.

Anyway I captured this video showing the app working on the machine frame:

https://www.youtube.com/watch?v=us2mTcvHHOw

I will use this tool to set the master rail over the next day or so.

Cheers, Joe