go_away

Author Topic: Servo Control with Microcontroller?  (Read 865 times)

0 Members and 1 Guest are viewing this topic.

Offline cparryTopic starter

  • Beginner
  • *
  • Posts: 1
  • Helpful? 0
Servo Control with Microcontroller?
« on: November 11, 2011, 01:35:48 PM »
So this isn't exactly a robot question, but I figured this was a good place to ask. I'm a mechanical engineer working on an engineering design project. We are building a football-themed arcade style game where a ball will be launched through a moving field goal post. The plan is to have the goal post driven by a servo with the zero point being straight up and down, and the ability to tilt around 45 degrees to either side. I assume this means that I need a servo limited to 90 degrees of rotation, but please correct me if I'm wrong. Also, some of the other sensors we are using will most likely be run from a Renesas rx62n microcontroller. Would it be possible to run the servo from the controller as well? If so, how might it be done? Also, how could we get it to reverse rotation once it hits each maximum. Any help is appreciated!

-Chris

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Servo Control with Microcontroller?
« Reply #1 on: November 11, 2011, 07:59:30 PM »
Hi,

I assume this means that I need a servo limited to 90 degrees of rotation, but please correct me if I'm wrong.

You just need a servo that can turn at least 90°. You can limit its travel in software.


Also, some of the other sensors we are using will most likely be run from a Renesas rx62n microcontroller. Would it be possible to run the servo from the controller as well? If so, how might it be done? Also, how could we get it to reverse rotation once it hits each maximum. Any help is appreciated!

Yes, it can be run from a single I/O line.
You control a (hobby-) servo by a pulse each 20ms (quite some tolerance allowed). The pulse duration determines the position of the servo and the (seldomly adhered to) standard is 1ms to 2ms, with 1.5ms being the center value (they can be from 0.3ms to 2.8ms in some types, but the 1.5ms center position is usually adhered to).
To move it, you change the pulse duration in the 20ms loop in whatever increment you need and to limit the travel to +/-45°, you just find the durations that gives the needed end points and then keep the values within that range - that way you can use any servo that satisfies the minimum 90° travel (i.e. most) and can focus on either price, strength or whatever else you may find important.

Perhaps it helps with a drawing...
Here's a page that shows a rather common servo, with a 0.6ms to 2.4ms timing and the associated angular positions.

« Last Edit: November 11, 2011, 08:09:33 PM by Soeren »
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

 


Get Your Ad Here

data_list