# controlling Stepper motor position

I wrote code for my Bipolar stepper and it works (it goes from 0-360). How can I control it that it goes from 0-120 , or from 120-180 degree…any ideas???

Well, you should probably try modifying the 360 deg code you are currently using.

Or, at the very least, posting the code.

http://www.arduino.cc/en/Tutorial/PWM

Steppers are controlled by PWM signals.

360deg = 100% 0deg = 0%

Therefore: 180deg = 50% 120deg = 33%

:)

Steppers are controlled by PWM signals.

360deg = 100%

@InvalidApple: Steppers are controlled by correct sequencing of their coils. Single channel PWM by itself is not going to do very much for a stepper.

My appologies AWOL (and those playing at home)!

I was thinking of a servo-motor.

'canucks_chick', you were trying to make a robot hand which could grab things with varied force: Maybe a servo motor would be best suited.

:)

I was thinking of a servo-motor.

No, R/C servos are controlled by PPM, not PWM.

Hmm...

I suppose that you are right.

This tutorial here describes PPM, but I would look at it and say that it was describing PWM http://www.hooked-on-rc-airplanes.com/servo-tutorial.html. Would you be able to explain the difference?

:)

I think that I found a good sight.

http://www.endurance-rc.com/ppmtut.html

It explains that PPM is a "timeshare" version of PWM.

"PPM basically is several PWM signals lined up back to back"

So you could see how I got mixed up.

In fact, I don't think that I have ever heard it get called PPM until now.

Even when doing my Electronic Engineering degree, I have always been told that it is a PWM signal.

No hard feelings :)

Even when doing my Electronic Engineering degree, I have always been told that it is a PWM signal.

But all sparkies think that 'j' is the square-root of minus one, so what do they know? ;D

It's true, we do. We also have messy desks - it's a requirement (LOL).

But to answer the origenal question on the post, get a Servo motor instead; start with a PWM signal, and expand it to a PPM signal with something like D-FFs if you want to add more servos.(or if you look around, I'm sure you will find a device which has already been made for time multiplexing).

However, you may just use one PWM signal for each servo if you want to keep it simple.

:)