CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Speed and postion control servo at the same time?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
chtham



Joined: 02 Nov 2005
Posts: 3

View user's profile Send private message Send e-mail

Speed and postion control servo at the same time?
PostPosted: Wed Nov 02, 2005 11:53 pm     Reply with quote

It's quite tricky to control the speed and postion of a RC servo at the same time.

Last edited by chtham on Fri Nov 04, 2005 12:55 am; edited 1 time in total
kender



Joined: 09 Aug 2004
Posts: 768
Location: Silicon Valley

View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger

PostPosted: Thu Nov 03, 2005 12:42 am     Reply with quote

Strictly speaking, you can control only one of the two, because speed is a derivative of the position. Tell us more.
chtham



Joined: 02 Nov 2005
Posts: 3

View user's profile Send private message Send e-mail

servo problem
PostPosted: Thu Nov 03, 2005 1:04 am     Reply with quote

Hi,

My final goal is to control multiple servo (the speed and position) serially. First i need to control only one. I understand that a servo rotates 180 degree on a 2ms pulse width and a 0 degree on a 1ms pulse width ; 1.5ms pulse width as center (90 segree). Pulse period is 20ms (50 Hz).

I got an idea that is from 0 degree to 180 degree, it will rotates at maximum speed. So, i need to slowly increment the pulse width to make it rotate slowly.

The problem occurs when i want it to rotate the 1st 90 slow and the 2nd 90 fast.

Thank you for your reply. :-)
kender



Joined: 09 Aug 2004
Posts: 768
Location: Silicon Valley

View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger

PostPosted: Thu Nov 03, 2005 1:22 am     Reply with quote

Instead of giving your servo one 90deg comand, give it multiple commands (1deg, 2deg, 3deg...) at the desired rate.
hillcraft



Joined: 22 Sep 2003
Posts: 101
Location: Cape Town (South africa)

View user's profile Send private message Send e-mail Visit poster's website

Servos
PostPosted: Thu Nov 03, 2005 11:25 am     Reply with quote

Servos generally only move about 120 degrees. The movement speed of the servo is a function of the capability of the servo. I use a high speed digital JR servo for the tail rotor of my helicopter. This allows the tail to react very quickly. A normal off the shelf servo is too slow for proper tail control when a fast gyro is used. You must take a close look at comparative servo spec sheets to get an idea of which servo you should be using. Another thing to remember is that a standard servo is pulsed at 20ms intervals. This means a change of position command can only be given every 20ms which also limits the travel speed of the servo. Another thing to remember is that the travel speed of the servo is also determined by the load on the servo.
sseidman



Joined: 14 Mar 2005
Posts: 159

View user's profile Send private message

PostPosted: Thu Nov 03, 2005 12:12 pm     Reply with quote

I don't think you can get enough access to the "guts" of an RC servo to do what you want to do. The problem is that the control algorithm is rather hidden from the user, and all you can do is modify the input.

Servos have a pot in them that is used to control the width of a one shot. This width is compared to the width of the input pulse, internally, and the output of this process is used to drive the servo.

Of course, you can capture the pot and the motor inputs, throw out the rest of the servo "guts", implement your own h-bridge, and control the servo yourself.

Short of this, you need to use the idea of sequential "go to" sort of commands, like recommended earlier, though this might very well prove unsatisfactory.
chtham



Joined: 02 Nov 2005
Posts: 3

View user's profile Send private message Send e-mail

servo
PostPosted: Fri Nov 04, 2005 12:20 am     Reply with quote

I'm using a standard Hitec (HS-311) servo. I've tested it. It can rotates from 0 to 180 deg. Or another way to say is plus or minus 90deg.

I'm using a PIC16F877, 4Mhz crystal, and CCS -PCM version 3.15...
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group