how do i get a servo to stop spinning at a point and return back to zero
Sounds like you are talking about a modified servo that has been converted for continuous operation? Is so it really isn't a servo anymore but rather a bidirectional geared DC motor, however it still uses servo commands to operate. Such a modified servo should stop when the servo output command is sent as 90degrees or 1500 microseconds. There may be a little calibration error in the servos electronics so that value may have to be tweaked a little one way or the other to find the neutral (stop) position.
If you are talking about a normal unmodified servo then it should stop turning on it's own, at the command position last sent to it and to return to the prior position, a new command has to be sent.
Lefty
What might the code look like I have no idea what I am doing, this is the first time i have tried working with servos
There are a number of Servo Libraries on the Arduino Playground. Arduino Playground - HomePage
This is a link to the software servo library. Arduino Playground - Servo
You must first download the library then include it at the top of your sketch. It gives some examples of how to use it. There are other servo libraries as well as a lot of other usefull information in the playground, it just takes a little research.
Let us know if you have additional questions.
There is a servo library that comes with arduino that is easier to use than than the sofware servo library in your link.
Squalls, you can find some example sketches in the Arduino IDE (desktop client)- from the file menu, navigate to: /examples/servo and you should see two sketches that should get you started.
I think the problem I am having is that it is continuous, and I am trying to use the normal servo comands
The normal commands will control the speed of of continuous rotation servo, not the position.
If you need to move the servo to particular positions then you would be better off with a normal servo.
Can you say more about your project and what you want the servo to do?
I am trying to program a lamp to give it the affect of it breathing. I need the motor to push the fabric in and out to give it the illusion. So the 45 degree spin would push it out and as it spins back it would pull the fabric back. If you think the normal servo would be better I will get my hands on one. I was given a continuous so I have been trying to work with that.
If you think the normal servo would be better
Yes, you require a normal unmodified servo for what you wish to do, a modified servo will not work.
You would send a servo command to move the shade out, then delay any amount of time you wish, command to move the shade back in, again delay any amount of time you wish.
Lather, rinse, repeat as needed
Modified (continuous rotation) servos are generally used as drive wheels for small robots, as in go forward at a continuous speed, now stop, now go reverse at a continuous speed, now stop again, etc.
Normal servo goes to a precise commanded position and stops.
Modified servo goes at a precise commanded speed and direction of rotation until sent a new command.
Lefty
The terms AC and DC servo are widely misused and don't have much distinction anymore. A DC servo used to mean a brush style permananet magnet motor. It can also mean a trapezoidally commutated brushless permananet magnet motor. AC servo has been applied to sinousoidally commutated brushless permananet magnet motors and possibly also to AC induction motors with a closed loop position control.
If you are using a permananet magnet brushless motor, which most servos are these days, you probably want sinusoidal commutation for smooth low speed response. A trapezoidally commutated motor is simpler to drive, but will have a torque ripple at low speeds. A permananet magnet motor has full torque at zero speed. An AC induction motor has reduced torque control at very low speeds, they are also not commonly used as a servo motor.
I hope this clears the air a little,
Re: AC vs DC servo motor in high acceleration applications...
Rocky140, your post was highly informative but was it intended for another thread?