go away spammer

Author Topic: $50 Robot Servo Issues  (Read 1728 times)

0 Members and 1 Guest are viewing this topic.

Offline SlotheryTopic starter

  • Jr. Member
  • **
  • Posts: 26
  • Helpful? 0
$50 Robot Servo Issues
« on: July 30, 2010, 02:23:38 PM »
I have just programmed my board. Plugging the servo into the row which is closest to the capacitor causes it to spin quickly clockwise. Contrarily, plugging the servo into the second row causes it to spin slowly counter-clockwise. During the entire process I have no sensors plugged in; therefore, I would think that the else clause would execute causing the servos in both rows to spin at the same speed in opposite directions. However, this is not so... Would someone offer a solution or explanation to my situation?
« Last Edit: July 30, 2010, 11:28:50 PM by Slothery »

Offline MrWizard

  • Full Member
  • ***
  • Posts: 117
  • Helpful? 0
  • My cylon friend told me a killing joke......
Re: $50 Robot Servo Issues
« Reply #1 on: August 03, 2010, 06:22:21 AM »
You will have to plug in sensors too. Then you can adjust the programming code so the servo's will turn at the same speed.

Offline SlotheryTopic starter

  • Jr. Member
  • **
  • Posts: 26
  • Helpful? 0
Re: $50 Robot Servo Issues
« Reply #2 on: August 04, 2010, 10:39:27 AM »
But without the sensors the servos should turn in opposite directions at the same speed. This is because in the first two conditions cannot execute if the sensor data is below a threshold value and because both sensors are unplugged both conditions will evaluate to false. Leaving the else statement to be executed which simply tells the servos to spin at the same speed in opposite directions.

Offline Razor Concepts

  • Supreme Robot
  • *****
  • Posts: 1,856
  • Helpful? 53
    • RazorConcepts
Re: $50 Robot Servo Issues
« Reply #3 on: August 04, 2010, 11:02:26 AM »
When sensors are unplugged, the ADC goes into an unpredictable state where they can return ANY value, since they are just reading noise. So you can't assume that the first two conditions will be false

Offline Mansoor

  • Jr. Member
  • **
  • Posts: 20
  • Helpful? 0
Re: $50 Robot Servo Issues
« Reply #4 on: August 06, 2010, 01:57:33 PM »
Without any sensors plugged in the code always goes to the third else for me like you suggested. to fix your problem I would suggest getting an osciliscope. that way you can see the voltage wave form directly in front of you. you can measure its width and everything. eliminating the chance that the problem is from the code. if the pulse-width is as it should be. the the problem is from the servo. what i mean is that each servo is a little different. i.e. servo is supposed to be right in the middle at 1500 us for example. but in reality it goes to center at a little higher or lower pulse width. so you have to calibrate each servo to get it perfect. However I do not think that this is the problem if the difference in speed is huge between the two cases. so check with oscilloscope and go from there. good luck!

 


Get Your Ad Here

data_list