Wednesday 28 August 2013

Project 18 Part 2 (Advance): 3D Infrared Scanner

After multiple setbacks (and seizures), I finally hit a dead end. I almost gave up on this project. This is why I didn't update my blog for a couple of weeks. Eventually, I decided to try to turn that "dead end" into nothing more than a setback.

The biggest problem that I had was dealing with my stepper motor. I'll be using the KP35FM2 ‐ 035 stepper motor, made by Japan Servo. I had no idea what the specifications are for these motors. I couldn't find any datasheet on the internet. To make matters worst, the store owners don't know the specifications either.I found a similar model (KP35FM2 ‐ 044) and to power this motor, I need to apply up to 24V and a maximum current of 500ma. I found an old power adapter which outputs 9V, at 500ma. I have enough current to keep the motor going but applying a lower voltage would result in weaker torque.

I redesigned my scanner and it is a major improvement from my initial design. I replaced my panning servo motor with a stepper motor. A stepper motor is a type of motor which can turn at a specific degree. In my case, my stepper motor can turn at 1.8 degrees per step. This would mean it would take 200 steps to complete a full cycle.



The biggest issue with my previous design was that the sensor's position is constantly changing. I need to minimize this, since my program assumes that the distance readings are all relative to the same point. The image below shows that the IR sensor will always be at the pivot point. Also, the tilting servo will only rotate from 0° to 90°.

Tilt Angle: 45°
Tilt Angle: 0°





















There will be 2 main scanning modes which can be selected within the arduino code. The only difference between these modes is the stepper motor's maximum panning angle. For example, if I set the maximum number of steps equal to 100 (or 180 degrees), then the sensor's field of vision is within 180 degrees.

Partial Scan
This scanning technique is ideal for detecting a small area (example: a corner). I modified the code in such a way so that the stepper motor will only increment 100 steps (or 180 degrees). The images below are the scanning results of 2 laundry boxes, placed perpendicular to each other. To see the scanner in action, a video is posted at the end of this post.

Top View




Full 360 Degree Scan
This scanning technique is a little different than before. Since a stepper motor is capable of rotating a full cycle, I decided to take advantage of this. The scanner will make a full 360 degree turn and once it's cycle is completed, the tilting servo will be incremented by 1 degree. This process is repeated until the tilting servo reached 90 degrees.

I tried to scan my recycling box and the results are slightly disappointing. As you can see below, the scanner seems to behaving erratically on a certain area of the box.This is one of the biggest setbacks.

























It seems that the was a small error within my code. There are hundreds of lines of code(2 seperate scripts) and finding the bug was incredibly difficult. After a successful scan, the images produced by matlab is amazing.

Note: the scale of the graph changes in different perspectives










































Parts:
- 1x servo motor (dagu medium servo)
- 1x bipolar stepper motor (KP35FM2 ‐ 035 by japan servo)
- 1x SN754410 Quad Half H-Bridge (to control the stepper motor)
- 1x medium range IR sharp sensor (range of 10-80cm)
- an external power source for the motor

It took a lot of hard work and dedication to complete this ambitious project.

2 comments:

  1. any chance you can you map out the wiring for the KP35FM2 035? I purchased one to test out my RAMPS 1.4 board

    ReplyDelete
  2. could you provide the code you used ? thank you very much

    ReplyDelete