Pages: [1]   Go Down
Author Topic: Controlling Continuous Rotation Servo  (Read 1316 times)
0 Members and 1 Guest are viewing this topic.
Makati, Philippines
Offline Offline
Jr. Member
**
Karma: 0
Posts: 54
Arduino Rocks!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?

Thanks in advance!
Logged

Makati, Philippines
Offline Offline
Jr. Member
**
Karma: 0
Posts: 54
Arduino Rocks!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Any ideas on how I can control the degree of rotation of a continuous rotation servo? ^^
Logged

Espoo, Finland
Offline Offline
God Member
*****
Karma: 6
Posts: 586
"Oops, try again..."
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

From where you get your position information?

Kari
Logged


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

Makati, Philippines
Offline Offline
Jr. Member
**
Karma: 0
Posts: 54
Arduino Rocks!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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? ^^
Logged

Espoo, Finland
Offline Offline
God Member
*****
Karma: 6
Posts: 586
"Oops, try again..."
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged


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

Makati, Philippines
Offline Offline
Jr. Member
**
Karma: 0
Posts: 54
Arduino Rocks!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 ^^
Logged

Espoo, Finland
Offline Offline
God Member
*****
Karma: 6
Posts: 586
"Oops, try again..."
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged


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

Makati, Philippines
Offline Offline
Jr. Member
**
Karma: 0
Posts: 54
Arduino Rocks!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Espoo, Finland
Offline Offline
God Member
*****
Karma: 6
Posts: 586
"Oops, try again..."
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged


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

Italy
Offline Offline
Full Member
***
Karma: 3
Posts: 142
jayduino rox
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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).
Logged

Juergen

Makati, Philippines
Offline Offline
Jr. Member
**
Karma: 0
Posts: 54
Arduino Rocks!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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. ^^
Logged

Makati, Philippines
Offline Offline
Jr. Member
**
Karma: 0
Posts: 54
Arduino Rocks!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Pages: [1]   Go Up
Jump to: