Go Down

### Topic: Arduino and measure distance (stepper) (Read 4446 times)previous topic - next topic

#### HyperGeil

##### Mar 17, 2014, 09:38 amLast Edit: Mar 18, 2014, 11:06 am by HyperGeil Reason: 1
Hi,

I'm a newbie to Arduino, but an interesting project came up and now I try to accomplish.

I need a way to measure the distance of a guided track - say I have a aluminum track with a toothed rack and the following facts is included.

1. The toothed rack distance may change from use cases
2. The Arduino must run the full track when initializing to measure the distance
3. In each end a STOP contact will be activated
4. The distance must be used for calculation in the next process of the code

My idea was to apply a stepper with a toothed wheel where I know the circumference - and then count the turns. But then I end up with a maybe not finished turn in the end, and what then?

So the short question - how do i measure i distance mechanical and not with ultrasound etc.?
And how do I use the calculation in the code for further processing?

// Kristian

#### Riva

#1
##### Mar 17, 2014, 11:52 am
A stepper motor will usually divide down a single rotation into 200 steps so would 1.8 degrees still be to much margin of error?
Don't PM me for help as I will ignore it.

#### raschemmel

#2
##### Mar 17, 2014, 04:48 pm
Rotary encoder on track wheel will also work.

#### HyperGeil

#3
##### Mar 18, 2014, 11:06 am
@Riva: That could be a possible solution. Can you explain more about, how I count the steps then in the code?

Thanks.

#### Riva

#4
##### Mar 18, 2014, 12:04 pm

That could be a possible solution. Can you explain more about, how I count the steps then in the code?

The code would need to generate stepping pulses for a stepper motor (see here) so a simple answer would be to count the total number of steps you generate between start/end points. If you know one revolution moves the track say 500mm then each step must be moving it 2.5mm (500/200). You could also use gearing to increase the stepper torque and it's accuracy. To be precise about the job you should also have some form of feedback like a continuous rotation potentiometer or shaft encoder so you know the stepper did move the track and did not slip or stall.
Don't PM me for help as I will ignore it.

#5

Go Up