Welcome! Log In Create A New Profile

Advanced

Camrap software - a 2D position encoding scheme

Posted by darkpaw 
Camrap software - a 2D position encoding scheme
May 20, 2012 09:50PM
Hi Reprappers,

After a long time trying to get this software to a usable state, it is now up on Github. When I say usable, I really mean usable for experimentation, but that's what we're here for right? winking smiley

The basic idea is that a webcam captures images of a printed grid, which are then processed to determine a position. It does not handle rotation, so the camera or "target" needs to be constrained. e.g. camera is attached to a Mendel X-carriage.

It might be useful for:

- closed loop positioning (could be a bit slow)
- XY steps calibration on vanilla Repraps
- additional accuracy for e.g. PCB milling/etching

Position seems to be repeatable, if not entirely accurate, to ~10um, with a cheap webcam and 4mm grid.

The code is in Python, and probably only works on Linux at the moment.

More info at:

[reprap.org]

Source at:

[github.com]


My intention was to use this for closed-loop positioning in a very cheap servo-driven "Reprap" (RC continuous rotation servos, ~$15 ea.). I have made a few prototypes so far, but they were intended mainly for testing this software during development. I think I will try to get a "real" Reprap up and running so I can make more complex parts for the next one. I'm also considering ways of "printing" some electro-mechanical parts to replace the servos.

I'd like to hear from anyone who tries it so I can fix bugs and add features.
VDX
Re: Camrap software - a 2D position encoding scheme
May 21, 2012 03:23AM
... I have a similar system of XY+angle position encoding in my 3D-scanner.

It's not based on rectangular, but hexagonal 'code-bits' - so maybe easier to detect angular dimensions.

See the atached images for an idea, how it's working - the overview shows the bottom of the 'code-plate', the detail-image shows the image, the cam is scanning for getting the actual coordinates ...


Viktor
--------
Aufruf zum Projekt "Müll-freie Meere" - [reprap.org] -- Deutsche Facebook-Gruppe - [www.facebook.com]

Call for the project "garbage-free seas" - [reprap.org]
Attachments:
open | download - Code-Platte.jpg (121.2 KB)
open | download - Code-Platte-Detail.jpg (55.5 KB)
Re: Camrap software - a 2D position encoding scheme
May 21, 2012 05:14AM
Thanks Viktor, that's interesting. I tried a hexagonal grid with black edges and coloured centre spots first, but squares turned out to be much more efficient for line detection. I imagine dots would be good too, but there are lot more data points available from solid lines.

I see that you have tried "microstepping" stepper motors for fine positioning, would you recommend that method?

I was considering using muscle wire for fine movement.

[en.wikipedia.org]

Or else a system of levers and cheap mini-servos.

I have a $50 USB microscope which should provide better than 1um accuracy if I can print the grid small enough. Perhaps a 35mm film negative from a photograph of an A4 print.
VDX
Re: Camrap software - a 2D position encoding scheme
May 21, 2012 07:05AM
... 'muscle wire' has some drawbacks, as the movement isn't linear, depends highly on the ambient temperature and you need a driver with high current resolution (I've mostly used DAC's with 16bits) to provide smooth positioning.

Better use high resolution motors or gear-boxes.

I have different prezision drives - stepper motors with 51200 steps per rev., geared backlashfree micro-motors and PZT-drives with some ten Millimeters (to 'endless') moving distances and sub-micron (down to sub-nanometer) resoluition.

One of the next projects could be the 'automotivation' of this code-plates with two wheels atached to the sides, so the base can move and rotate freely above a camera to adjust the position and orientation of the mounted parts.

See the "c't-bot" ( [www.heise.de] ) for a running sample.
This bot has a mouse-sensor (19x19 pixel camera) directed to the floor and can so measure the displacement dynamically. With a geometric code on the floor (or the codeplate and a fixed cam in the floor) this can be optimized to absolute accuracy ...


Viktor
--------
Aufruf zum Projekt "Müll-freie Meere" - [reprap.org] -- Deutsche Facebook-Gruppe - [www.facebook.com]

Call for the project "garbage-free seas" - [reprap.org]
Re: Camrap software - a 2D position encoding scheme
May 21, 2012 09:10PM
Thanks, I will try one of the planetary gear sets that are on thingiverse.

I had planned to build a reprap variant with plastic parts glued to plain glass sheets. The parts could be placed with the positioning system to avoid the need to drill or lasercut sheets. Two $7 cameras + one piece of wood = nice accuracy over the area of an A3 sheet...

A Wallace might be easier though, it has some spare build area for the "code plate".
Attachments:
open | download - camrap-revQ.019_sml.png (361.4 KB)
Re: Camrap software - a 2D position encoding scheme
May 22, 2012 10:42AM
This is an interesting development as there has been many a discussion of how to remove the stepper motors from a reprap to make it easier to reproduce. It would also be very good for large bed repraps where belt drive starts to become less accurate.

The only downside of course is that you could potenially remove stepper motors for something more simple, but you do add a camera. Is there any way you could do something similar with a row of simple detectors in each axes rather than a matrix CCD device. I'm thinking of a Moire Fringe type setup as used in digital calipers and other devices. It is then more likely that these sort of sensors might be printable.
Re: Camrap software - a 2D position encoding scheme
May 22, 2012 09:59PM
You just reminded me about what I was trying to do originally with the grid. The idea was to use a printed sheet as the source for both position and build instructions, and a non-computerised machine could then place small precut shapes as it travelled along its "instruction tape".

I won't be happy until you can take a fresh Reprap off a build platform and plug it in, but I've been converted to the "top-down" approach. Bottom-up would be great if we had the tools to build the first simple full replicator. Maybe a few years work on high resolution and multi-material will get us to the point where it will be possible to switch back to a bottom-up approach.

Once I have a Wallace up and running, I'm going to play with some printable electro-mechanical things.

Eddy current drives could be a way to replace steppers. If they had encoder wheels, they could even behave like steppers.

Printable steppers may not be impossible, even if they are a bit big and slow to start with.

A solenoid/ratchet wheel might even work as a stepper.


The materials I have in mind are:

ABS printed parts
NdFeB magnets
Copper wire
FIMO polymer clay with iron or ferrite powder embedded


I had thought about ways to avoid using a camera, but if we're using microprocessor ICs, stepper drivers, not to mention whole computers to slice models, whats one more chip? $7 got me a camera with nearly 1 million "sensors". The cheapest way to do optical detection might be to use LEDs in reverse. Maybe I could get 100 LEDs for the same price? If you have any ideas though, I'm happy to have a think about what some software might be able to do with the inputs.

One thing that might be worth doing with e.g. a 32bit SOC would be to wire up a video sensor directly, for fast frame rates and possibly even hardware/FPGA DSP image processing.
VDX
Re: Camrap software - a 2D position encoding scheme
May 23, 2012 04:03AM
... think about using a DLP-chip with its micro-mirrors - in combination with a camera as sensor and the mirror-array as controllable structured light source you can make much more with Moirée-fringes and such winking smiley


Viktor
--------
Aufruf zum Projekt "Müll-freie Meere" - [reprap.org] -- Deutsche Facebook-Gruppe - [www.facebook.com]

Call for the project "garbage-free seas" - [reprap.org]
Re: Camrap software - a 2D position encoding scheme
May 23, 2012 05:54AM
I did a google for printable LED and it does appear that LED matrices can be printed with conventional processes such as screen printing, so this idea does appear to have some merit. Whatever inks they are using could be used on a reprap. The resolution might not be as high, but it could be sufficient.

What do you mean by using LED's in reverse?
VDX
Re: Camrap software - a 2D position encoding scheme
May 23, 2012 06:20AM
... you can use a LED as lightsensor too, as it's changing the back-resistance with the amount of light on the chip ... but it's poor compared to a cheap CMOS-sensor ...


Viktor
--------
Aufruf zum Projekt "Müll-freie Meere" - [reprap.org] -- Deutsche Facebook-Gruppe - [www.facebook.com]

Call for the project "garbage-free seas" - [reprap.org]
Re: Camrap software - a 2D position encoding scheme
May 23, 2012 06:27AM
@Viktor: I think I saw a 2D system in the science literature using something like that, but I can't find it now.

I did see this one though:

Development of a low-cost micro-CMM for 3D micro/nano measurements
Abstract: [iopscience.iop.org]
PDF: [ntur.lib.ntu.edu.tw]

@Martin:
I was thinking of discrete LEDs, which work as photodiodes, but printable OLEDs might well be a great idea.
If you had one printed sheet emitting light, and another right on top of it sensing light you wouldn't need a lens.

I don't know how commonly available those compounds might be, even if they were cheap.

[en.wikipedia.org]
Sorry, only registered users may post in this forum.

Click here to login