Author Topic: $50 Robot. Need Help. Turns in circles. Doesn't go strait. How do I adjust code?  (Read 1017 times)

0 Members and 1 Guest are viewing this topic.

Offline ProctorTopic starter

  • Jr. Member
  • **
  • Posts: 10
  • Helpful? 0
Hey Everyone!

I just finished my robot!!! I'm was so exited I couldn't sleep all night. Finally fell asleep at 6am this morning haha. I'll post a picture of my robot.

Ok so the title explained everything pretty much but ill recap.

Specs:
Atmega8
AvrIsp mkII USB programmer (had trouble connecting at first. solved by updating avr studio 4 to version 4.19)
9V battery through 5V regulator for electronics power.
4 AA batterys in single cell holder for servos.
Yogurt caster...muhaha (im going to rebuild the whole chassis)

My problem is simple (..i think) but uh I know you all your guys like showing off your skills  ;)
So my robot goes in clockwise circles when it should go strait :. (therefore) the left wheel is turning too fast or the right wheel too slow
Also totally related and hopefully the same problem but when the Bot chases the light and turns left it turns very slow. whereas when the Bot turns right it spins very fast.

Observations:
Left wheel spins too fast forwards.
Left wheel is slow going backwards.
Right wheel is slower then left wheel going forward.
Right wheel seems faster going backwards but may be the same speed as left wheel. (seems this way b/c it turns so fast right).
~Also the noise:
The robot is louder when turning right then left.

Help:
I'd like someone to explain to me how to change the speed for each servo, left and right. I'm trying to learn how to write C++ and this is my introduction to it. We are using C++ right?

Greatlyyyy Appreciate it!

~Proctor



Offline newInRobotics

  • Supreme Robot
  • *****
  • Posts: 1,015
  • Helpful? 48
  • N.I.R.
Hi there

I don't think this is code problem. I assume You have used servos that were modified to perform continuous rotation, it looks like problem lies in servos being not centered properly when pot was glued, that would explain servo spinning faster to one side than the other.
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian W

Offline ProctorTopic starter

  • Jr. Member
  • **
  • Posts: 10
  • Helpful? 0
Yeah that is the reason they are messed up but Admin or someone was saying that if you messed up and glued the pot in crooked you would be able to fix it. The only thing is it would reduce the range of speed.

So I need to reduce the speed in my left servo to match the speed of my right servo.
I need to increase the reverse speed of my left servo if possible.

Offline newInRobotics

  • Supreme Robot
  • *****
  • Posts: 1,015
  • Helpful? 48
  • N.I.R.
You need to find slowest overall speed and use it to run both servos in any given direction. So, if right servo goes CW at 20RPM and CCW at 25RPM, and left servo goes CW at 30RPM and CCW at 31RPM, You have to drive both servos to any direction no faster than 20RPM because that is the usable speed of right servo.
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian W

Offline adanvasco

  • Full Member
  • ***
  • Posts: 107
  • Helpful? 6
  • Necessity is the mother of invention.
Also, if you don't want to sacrifice speed, you could open the servos again, I mean, completely, and measure the resistance from the pot at the servo going at good speed, and replace the pot from the other servo with a similar resistor. That's another way of modifying servos, btw.
Knowledge does not weigh.

Offline FrontierRobotics

  • Beginner
  • *
  • Posts: 5
  • Helpful? 0
You could also just take out the pots and pop a resistor in :D

 


Get Your Ad Here

data_list