Go Down

### Topic: Controlling Continuous Rotation Servo (Read 4093 times)previous topic - next topic

#### zeitcheist

##### Feb 07, 2011, 12:20 am
Hi all!

This is in conjunction with the project I posted under Project Guidance. link here

We are using a continuous rotation servo for mobility. Since it is a "modified" servo, we cannot control the degree of turn anymore. But we need to control the turn by degrees.

I am thinking of using a sensor. We have QTR-1A Reflectance Sensor here. I will then paint white strips, say every 45deg. Since this sensor outputs analog value, I may use interrupt whenever this sensor "senses" the white parts on the wheels. In doing so, I may count the number of interrupts (for measuring distance traveled), or stop the turn when the first mark is hit (for 45deg turn).

The rotation of wheels will not be fast, by the way.

Will this be effective?

#### zeitcheist

#1
##### Feb 07, 2011, 09:32 am
Any ideas on how I can control the degree of rotation of a continuous rotation servo? ^^

#### GaryP

#2
##### Feb 07, 2011, 12:26 pm
From where you get your position information?

Kari
The only law for me; Ohms Law: U=R*I       P=U*I
Note to self: "Damn! Why don't you just fix it!!!"

#### zeitcheist

#3
##### Feb 07, 2011, 06:09 pm

From where you get your position information?
What do you mean by "position information"? If you are talking about the 45deg marks, I will put strips of white color around the wheel, every 45deg. This would then "reflect" on the sensor, which I can read thru the arduino. Do you think this will be just fine?

Any other alternatives to what I am considering? ^^

#### GaryP

#4
##### Feb 07, 2011, 07:03 pm
Sorry, my mistake. You have explained it quite well, it's my dyslexia...

I think your idea is usable, if only the bad accuracy of the turning degrees is not a problem. Our similar problem was solved by using encoders from old roller mouse,it's easy and fast enough to read it, and control motors at the same time.

Kari
The only law for me; Ohms Law: U=R*I       P=U*I
Note to self: "Damn! Why don't you just fix it!!!"

#### zeitcheist

#5
##### Feb 11, 2011, 01:13 pm
Hi again.

I tried running the sketch I coded. It simply waits for the interrupt at one pin. This interrupt waits for a RISING pulse (i.e., a white strip is sensed). Problem is, the pin seems to "sense" a number of rises. I want to sense only one RISE, and that will trigger that a 45degree mark on the wheel is sensed. What seems to be the problem?

TIA ^^

#### GaryP

#6
##### Feb 11, 2011, 02:58 pm
Is it possible that the pulse bounces few times when the sensor gets near to the change? Could you take a picture of the mechanical part? And what components you use there?

Cheers,
Kari
The only law for me; Ohms Law: U=R*I       P=U*I
Note to self: "Damn! Why don't you just fix it!!!"

#### zeitcheist

#7
##### Feb 11, 2011, 08:29 pm
Sorry, doesn't have a camera. Actually the output of the sensor we are using is an analog one. Could it be possible that the arduino "sees" the "rise" multiple times during the actual rise in voltage output of the sensor?

#### GaryP

#8
##### Feb 11, 2011, 10:39 pm
You should create, what it is, hysteresis(?). How should I say the thing that I can't say? Damn!

Anyways, when the first pulse says it rising, rise a flag to say it is time to wait until it reaches certain point, then don't let it hit the code again until it is going down, and after certain point, release the flag for the next pulse. You need to define those points yourself, by the curve of the components output.

Something like that, sorry, I don't know how to explain.

Cheers,
Kari
The only law for me; Ohms Law: U=R*I       P=U*I
Note to self: "Damn! Why don't you just fix it!!!"

#### scjurgen

#9
##### Feb 11, 2011, 11:54 pm
may I propose to use dynamixel servos?
They can be programmed to continues rotation AND they feedback the current angle (and other data too, like torque and temperature).
Watch for i.e. the AX-12 (I am using them, so if you have more questions, just ask).

#### zeitcheist

#10
##### Feb 12, 2011, 12:09 am

You should create, what it is, hysteresis(?). How should I say the thing that I can't say? Damn!

Anyways, when the first pulse says it rising, rise a flag to say it is time to wait until it reaches certain point, then don't let it hit the code again until it is going down, and after certain point, release the flag for the next pulse. You need to define those points yourself, by the curve of the components output.

Something like that, sorry, I don't know how to explain.

Cheers,
Kari

Yeah, it's fine. You did great explaining that. Actually, after I posted about this issue, I have coded another sketch that waits for a "rise", then wait for a preset interval before another "rise" can be sensed; a feature like a debounce. I think it is the same as what you explained here. I haven't tried the sketch yet, since we tried other components. Anyway, I'll post later the results. Thanks again!

may I propose to use dynamixel servos?
They can be programmed to continues rotation AND they feedback the current angle (and other data too, like torque and temperature).
Watch for i.e. the AX-12 (I am using them, so if you have more questions, just ask).
Thanks, great suggestion. But unfortunately, we can't afford to buy another servo, not to mention the high \$\$\$ of the servo you suggested. But its features are awesome. ^^

#### zeitcheist

#11
##### Feb 12, 2011, 12:31 pm
We tried the sketch I coded, which includes the logic of debounce, the logic seems okay for now. The sensor seems to read eight white strips on the wheel per rotation (eight 45deg marks). I estimated the time it takes for one rotation, about 2secs. So I divided it by 8, giving me 250ms. I then decided to have a 200ms debounce per "rise" output of sensor. Problem is, would the servo's rotation decrease when loaded? I hope it will not. I'll update this thread when I have tested the movement with about 2kilos of load.

Anyone experienced decrease in rotation speed of servo when loaded as opposed to not?

Go Up