go away spammer

Author Topic: Servo problem  (Read 3788 times)

0 Members and 1 Guest are viewing this topic.

Offline NEROTopic starter

  • Jr. Member
  • **
  • Posts: 20
  • Helpful? 0
Servo problem
« on: December 11, 2007, 09:44:56 AM »
hi...
i have two modified servo...
i operrated my servo using built in pwm module using PIC 16f877a...
so thw pwm is work fine....
my problem is i have no idea to make it rotate anti-CW and make it stop....
and my uderstanding the pwm period for standard hobby servo is 20ms.....
how can i get this period using this built in module

paulstreats

  • Guest
Re: Servo problem
« Reply #1 on: December 11, 2007, 10:26:11 AM »
i'm not sure that the built in pwm will work properly for servo's.

pwm works on a system of sending the high and low pulses at the same width, wheras with a servo, the low pulse should remain at about 20 - 30 ms with the high pulse width changing depending on the signal you want to send to the servo.

the built in pwm is really better used for driving h-bridges.

1 ms should turn it 1 way.

1.5 ms should center it or cause a modified servo to stop

2 ms should turn it the other way.

usin standard pwm on these timings will result in a very short low pulse and not give the servo a chance to update itself

Offline NEROTopic starter

  • Jr. Member
  • **
  • Posts: 20
  • Helpful? 0
Re: Servo problem
« Reply #2 on: December 12, 2007, 09:24:48 AM »
hi...
but with the user defined pwm will make jitter for servo rotation....
any idea?

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Servo problem
« Reply #3 on: December 12, 2007, 11:30:17 AM »

Offline NEROTopic starter

  • Jr. Member
  • **
  • Posts: 20
  • Helpful? 0
Re: Servo problem
« Reply #4 on: December 15, 2007, 04:53:29 AM »
hi....
i tested my servo by stop  periodic timing...
the duty cyle is 1.5 ms.... but it still rotate...
why this is happen?

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
    • dunk's robot
Re: Servo problem
« Reply #5 on: December 15, 2007, 06:03:08 AM »
hi Nero,
don't know if you have worked this out yet or not,
although servo control often gets called PWM the pulse that controls servos is not the same as classic Pulse Width Modulation.
the main difference is servos need only a very short pulse On time compared to the Off time. the period of the pulse (pulse start time to pulse start time) has to remain constant.
this is why the built in PWM module on microcontrollers is not the easiest way to do this.
there's a diagram explaining the timing on this page: http://www.brookshiresoftware.com/rd_how_servos_work.htm

presuming you know all this, there are 2 things i can think that may be causing your problem.
1. something is wrong with your timing. try flashing an LED every 1000mS and confirm it flashes every 1 second to confirm your MCU is actually running at the speed you think.

2. something may be wrong with your modified servo. do you have an unmodified servo you can test with?

Quote
but with the user defined pwm will make jitter for servo rotation....
yes. deal with it for now.
once you have it working this way you can fine tune it. it is possible (although not easy) to get servos running this way with no jitter.

good luck,

dunk.

Offline NEROTopic starter

  • Jr. Member
  • **
  • Posts: 20
  • Helpful? 0
Re: Servo problem
« Reply #6 on: December 15, 2007, 06:08:45 AM »
thanks dunk....
but i still blur about the jitter...
what make the jitter problem?
are the about the timing or pulse

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Servo problem
« Reply #7 on: December 15, 2007, 10:28:09 AM »
NERO, do this:

Send a 1.3ms pulse to your servo and see what happens.

Increase it to 1.35, then 1.4, 1.45, 1.5, 1.55, etc, and see what happens each time.

What you should see is your servo rotate one direction, stop, then rotate the other direction. If it doesn't do this, you are doing something else wrong. Let us know.

Depending on how you modified your servo, 1.5ms is just a rough guide for the stop position, and hardly a rule.

 


Get Your Ad Here