Go Down

Topic: Tracking a non-servo (Read 424 times) previous topic - next topic

thetalkingjeff

So far I have this code hooked up to a motor that it says was a servo, but it is not (sm-s4303r-ccw).

Code: [Select]
#include <Servo.h>;

Servo myservo;

int pos = 0;

void rotate() {

  for(pos = 0; pos < 180; pos += 1)
  {                                   
    myservo.write(pos);               
    delay(15);                       
  }
  for(pos = 180; pos>=1; pos-=1)     
  {                               
    myservo.write(pos);             
    delay(15);
   
    //delay(86400000);
 
  }

}

void setup()
{
  myservo.attach(9);
  myservo.write(0);
   

  rotate();
}

void loop()

}



Is it possible to track the position with a non-servo, because I recently found out that it is not a servo. This code just makes it turn one way forever.

AWOL

Are you saying it is a "continuous rotation "servo""?

You can't know or set the position of such a device. It is pointless trying.

thetalkingjeff

Ok. Thanks. Do you have any clue where I can buy a SERVO that isn't continuous rotation but can turn over 360 degrees?

slipstick

Yep, do a search for sail winch servos. Most have full positional control over about 4-6 complete rotations.

Steve

thetalkingjeff


PaulS

Quote
Most have full positional control over about 4-6 complete rotations.
At a (not insignificant) cost.
The art of getting good answers lies in asking good questions.

slipstick

At a (not insignificant) cost.
If you know a way of achieving the same end with no significant cost I''m sure the OP would be pleased to hear about it.

There are relatively inexpensive winch servos (£12-15) but given their intended purpose they're all fairly large. You don't really see any very small very cheap things like SG90 equivalents.

Steve


Northof49

Would a stepper motor (with gear reduction if you need more torque) work for you?  Is it enough that you know the present position of the motor by counting steps from a home position? If so, a stepper motor might work for you.

PaulS

Quote
If you know a way of achieving the same end with no significant cost I''m sure the OP would be pleased to hear about it.
I don't. I was just pointing out that you can't get something for nothing. There are always trade-offs - more hardware (encoders), more cost, larger size. OP needs to determine where the trade-offs outweigh the benefits for his/her project. Maybe a different kind of motor would work, instead.

The art of getting good answers lies in asking good questions.

Go Up