Friday, February 20, 2015

Camera holder for the Piclop

My early experiments with the Piclop were done with scotch tape holding the camera module onto the front of the tower; that worked, but obviously wasn't going to be a satisfactory solution. I planned for a simple mount that would hold the camera right against the front of the tower, but after a few scans discovered the need to adjust it at least a little. The camera module needs to be perfectly vertical when viewed from the side; in other words, parallel to the Y axis, which is perpendicular to the turntable surface. It also needs to be aimed directly at the center of the turntable, using the "Camera" screen in FreeLSS and lining up the red cross-hair to hit the center. And that cross-hair also needs to be vertical, which I measured by putting a square on the turntable.

The camera mount I've come up with is easy to print and install, solid, and allows fine motion for two of those adjustments. However, it can't adjust the third, and in that respect it is somewhat lacking; I have a workaround, but ultimately it may need to be replaced with a better design. The files are on Thingiverse: http://www.thingiverse.com/thing:691191 It's still a work in progress because of the limited adjustments; in the meantime though, here's what it looks like.

My apologies for the overexposed pictures; it's really hard to take good photos of shiny black PLA. As you can see, the case is very simple, printed in two halves that snap together to hold the board. The four mounting holes on the board line up with holes in both halves, and M2-20 screws pass through all three and thread into the camera tower.

The case is held away from the tower by a ~1 cm square of closed-cell foam about 4 mm thick, cut from a piece that some electronic components were shipped in. The idea is to provide a little spring effect between the tower and the case, so it will be held against the screw heads and they can be tightened or loosened to adjust its position. Four small springs under the screws would do the same thing, but the foam seems simpler.

The first adjustment I made was to line up the case vertically, by setting a square on the table and making sure that the front of the case was parallel to its edge.

Second, I set the square on the turntable with its corner at the center and went to the Camera page in the FreeLSS web interface, and made sure that the red crosshair was in line with the edge of the blade. The camera mount doesn't have the ability to make that adjustment; that's the limitation I mentioned above. Theoretically the squareness of the printed parts and the flat table should have ensured that the alignment was good, but it wasn't quite close enough. The simplest way to achieve that was to shim the right edge of the turntable with some folded paper. For a permanent solution I'll glue some paper to the bottom of the turntable, but I also need to make sure that my table is entirely flat, which it might not be.

The final adjustment was to make the camera point directly at the center of the turntable, which is easily done by loosening or tightening both screws on one side. Here's what the picture should look like once everything is lined up.


That completes the camera alignment, at least as far as I understand it to this point - if there's a step I missed, I'll be sure to edit this post to correct things. While I have the square on the turntable, though, I also line up the lasers. In the same FreeLSS page there are buttons to toggle each laser on and off, so I turn them on one at a time and make sure that they are focused, vertical and lined up with the very edge of the square. This is the result after both have been aligned.


That's the whole alignment process, and once it is done the scanner should be ready to be measured for calibration.

14 comments:

  1. Hi Bill.

    I have been inspired by your efforts to try to re-design and build one of my own. I would like to ask a question about the camera:

    Does it matter if the camera is mounted right side up or upside down? (I want the cable to go over the top and was wondering if that would cause a problem with the software or hardware).

    Thanks in advance,
    Travis Caywood

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
    2. As it stands, the cable goes out of the top of the camera, it isn't bent or anything to make it go over the top side of the camera holder. Some pictures of the bare camera module show it upside-down; in the correct orientation the flat cable connector is at the top of the board.

      I'm not sure what it would take to turn the camera over. The FreeLSS software uses the raspicam library, and it's possible that all you need is a parameter to say "flip the image", but I know so little about C++ that I couldn't even begin to figure out where that would have to be...

      Delete
  2. OK. Some of the models I see have that cable hanging down so I thought it's orientation was that way. Thank you for the reply. I'll continue down this road until I hit a real snag then.

    Thanks again,
    Travis

    ReplyDelete
  3. Hi Bill, I've printed the turntable assembly and I'm about to print the camera case and tower. (I renamed the camera mount to tower, so I would keep it straight for me). Anyway, I'm heading to Lowes or HD tomorrow to look for the 8mm (5/16) rod. Did you calculate how much you needed or am I just following the ciclops material list for that?

    ReplyDelete
  4. I bought extra since it's cheap, but I think you would only need three 3-foot pieces. The cross-rods for the laser holders are 11.75" each, the two long rods in the base are 15.5" and the short rod in the base is 12.5" but none of those dimensions are critical, as long as they're consistent. You could easily make it a bit bigger or smaller without causing any issues since you're going to need to measure the finished scanner in order to calibrate FreeLSS.

    ReplyDelete
    Replies
    1. Bill,
      As far as design is concerned, do the lasers and camera have a certain ratio that they need to maintain? By that I mean does the camera and lasers need to be on the same "Z" plane (for lack of a better description)? (The scanner I'm designing lets the lasers and camera slide up and down and lets the turntable move closer and farther from the camera depending upon what needs to be scanned) I'm re-designing the whole scanner as far as the hardware is concerned. And I know you have the hybrid version up and running. So I'm hoping to skip some design iteration time by picking your brain...

      Thanks,
      Travis (again)

      Delete
    2. The relationship between the lasers, camera and turntable is hard to explain, but Uriah posted to the Google+ group a few weeks ago with a diagram that helped. Unfortunately I can't link directly to it, but if you search the group for his postings it should come right up. I think you're best off keeping the lasers at the same height above the table (which is the Y value) but Uriah maintains that it doesn't matter because the lasers create a plane of light. Likewise, the lasers can be closer or further away from the table radially, but what you need to measure for the X distance (right and left of center) is where the plane of the laser intersects the focal plane of the camera. So keeping the Z distance physically the same for both lasers and the camera makes that measurement a lot easier. Does that make sense? That's why I set up the Piclop to have the laser arms straight rather than angled, like the original Ciclop design.

      Delete
    3. That makes perfect sense and is very good to know. I didn't realize that you had made the lasers straight out. I will do that too. I think I'll tie the camera and lasers all together in a one piece fixture so it all moves together.
      I am putting the camera on a gimble so I can put it in any orientation I need for the the calibration to the turntable.

      I will try to hunt down that Google+ link. I am a novice to Google+, can you tell me which group do I need to search?

      I can't thank you enough for the feedback/help.

      (If you ever need cad models or 3d printing I will gladly pay you back. I have a Fusion3D printer, so anything you need printed just let me know and it's yours. It will do up to 12x12x12 inch printing size.)

      Thanks again,
      Travis

      Delete
    4. I was wondering what the name of the Google+ group you're referring to. Would be interested in looking it up. Thanks.

      Delete
    5. I can't seem to put links in the comments even though I'm the blog author, but I think that if you search for ATLAS 3D Users it should come right up.

      Delete
  5. OK. I found the link to the google+ diagram.

    Thank you for that.
    Travis

    ReplyDelete
  6. Do you have a photo of your completed Adafruit protoboard? (or a wiring diagram) I ordered everything from the BoM you posted and I'm looking to get the Darlington and everything else all sorted out and wired up properly. My 3d prints completed last night. You made getting the parts pretty simple, thanks. :-) Usually people do the opposite, detailed assembly instructions, with no BoM for where to get never before seen parts.

    ReplyDelete
  7. I haven't done much with the scanner in the last month or two; the software issues were so severe that I couldn't get any usable scans, so I'm waiting for the designer to work some of them out before trying to go further. As a result I haven't actually put the components on the protoboard yet, they're still spread out across a solderless breadboard. I do have a Fritzing diagram though, and I'll see what I can do to clean that up and post it.

    ReplyDelete