Pages: 1 [2]   Go Down
Author Topic: Roving robot  (Read 3687 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 2
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The code looks great.  
So to build the rover, I will use two continuous servos and one regular servo for the sonic ping.  I do not know where the arm fits in.  Maybe an updated photo will help.

Q1) The continous servos:  Do I need to calibrate them so that they can go forward and backwards?  Maybe your code only handles forward.  
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 2
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Answer: Yes, you need to calibrate them for forward and baclword operation
Logged

0
Offline Offline
Full Member
***
Karma: 1
Posts: 223
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry I've been quite busy lately. The "arm" in the code is just referring to the servo that moves the ultrasonic sensor. And yes, the code will tell the robot to move backwards under certain conditions.

-Z-
Logged

Netherlands
Offline Offline
Newbie
*
Karma: 0
Posts: 25
Robots rock
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Very cool project! I will definitely use some of these ideas for my HummBot project.
My HummBot will start with two IR sensors, but having seen this I will also add a Ultrasonic sensor.
The sensor you used is nice and small and seems pretty accurate.

Thanks, Mega
Logged

Visit my robotics blog at http://megabotblog.blogspot.com/

0
Offline Offline
Newbie
*
Karma: 0
Posts: 21
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I know this is an Old topic but this is exactly what im trying to do. I get a "problem uploading to board" error when trying to upload the code from this thread. im using the latrest arduino board and the latest software 0013.

avrdude: stk500_getsync(): not in sync: resp=0x00
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x00

is there any working code to make a robot like this floating around?
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 56
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Go on this page there is a code source for a robot.
 
http://www.irit.fr/~Nicolas.Lassabe/robot.php
Logged

0
Offline Offline
Full Member
***
Karma: 1
Posts: 223
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If you are getting that error, it usually means you have something wrong in the hardware, the computer is having difficulty communicating with the arduino. If the code compiles, the code is not the problem.
« Last Edit: February 24, 2009, 06:33:02 pm by zitron » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 29
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hello everyone,

im dealing with a similar project yet i am going to be using 5-6 servos.  i know there is an easy program that can control servos on pwm pins nine and ten but how can i control all six.  I was wondering if i could buy a motor controller to couple with my arduino, is this possible? What type of motor controller would you suggest? Or, if there is a easier alternative please let me know.

btw I know very little about what i'm doing and researching this is hasn't gotten me much luck.
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 56
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You can control 12 servo motors with digital pins without motor controller.

On this projets I controle  5 servos :
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1209542023/5#5

Logged

London
Offline Offline
Tesla Member
***
Karma: 10
Posts: 6250
Have fun!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
You can control 12 servo motors with digital pins without motor controller.
I don't think its practical for an Arduino sketch to drive that many servos in software if it needs to spend much time doing other tasks as well. The problem is that each servo needs to be driven for 1 to 2 milliseconds and all the servos should be updated every 20 milliseconds. That doesn't leave much time to do anything else if lots of servos need servicing

This  thread has a library that drives up to 8 servos using a Arduino hardware so that the sketch does not need to spend time pulsing the servos : http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1230479947
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 56
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I agree with you. I dont spend time to wait the servos, there is the source code here :
http://www.irit.fr/~Nicolas.Lassabe/controller_robot.pde

It's not so difficult to write your own controller to do that without to have a library.
Logged

London
Offline Offline
Tesla Member
***
Karma: 10
Posts: 6250
Have fun!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

shenakan, I did look at that code before posting my comment.  It handles the refresh nicely but still blocks for the duration of each servo pulse.  8 servos pulsing at 2 milliseconds will only leave 20% of the available processing time to do anything else.
« Last Edit: February 25, 2009, 04:51:16 am by mem » Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 56
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You'r right I don't spend time 20ms to wait but I spend between 1-2ms for pulses.

With 8 servos, this means I spend between 8-16ms for pulses every 20ms. So I still have between 55%-71% to execute my code and not 20% (if my operations are correct). It is not so bad. It was enough to control my robot with sensors.

(1000ms/(20ms+16ms)*20ms=555ms)
(1000ms/(20ms+8ms)*20ms=714ms)
Logged

London
Offline Offline
Tesla Member
***
Karma: 10
Posts: 6250
Have fun!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

with 8 servos:
 20ms frame - 16ms pulsing leaves 4ms, 4 ms is 20% of 20 milliseconds.

I just wanted to pointing out that if you pulsed 12 servos by waiting for each pulse to finish you would have little time to do anything else.
Another issue with the sketch directly pulsing the servos is that it needs to be structured to service the servos every 20ms or so. As your code demonstrates, that can certainly be done, but for some it may be easier to only have to consider a servo when a new value needs to be written.

I also think that an advantage of a library is that it assists the grouping of the major systems of an application into separate components. This can make a complex application easier to understand, maintain and enhance because it reduces the likelihood of unintended interaction between components by providing a clear set of interfaces.

Anyway, good to read about your robot – have fun!
« Last Edit: February 25, 2009, 05:42:51 am by mem » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 7
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Nice work!
Im just wondering, is an ultrasonic sensor adequate for detecting when it has run into something, or is it better to have contact sensors as well?
Logged

Pages: 1 [2]   Go Up
Jump to: