Society of Robots - Robot Forum
Electronics => Electronics => Topic started by: javafiend on March 15, 2008, 07:45:26 PM
-
How do you manually calibrate the Sharp IR? I would like to use it for my obstacle avoidance whenever an object comes within a predefined range.
Thanks.
-
1) Check the datasheet
and if its not in there already . . .
2) make a chart by measuring distance vs signal from your ADC (using UART)
now using data from 2), either make a lookup chart, or put it into an equation:
http://www.societyofrobots.com/sensors_interpret.shtml
-
what do u exactly mean by calibration?
you just have to wait a fixed amount of time after the sensor is setteled in a position then you read the value using adc.
this time is mentioned in the datasheet and its about 50 ms
-
Ok, sounds like the first thing I need to do is set up UART for my bot. Back to the tutorials for me ;)
EDIT::
Uh oh, just peaked back at the UART tutorial and noticed that TX and RX are on the same pins as my servos. I'm running four wheels and ultimately using all five pins for servos. How can I use UART and run all of them at the same time?
-
why the heck dont you change the servos controls into another port ?????????
-
why the heck dont you change the servos controls into another port ?????????
Because I'm running 5 servos and only have 5 ports. Am I missing something on the $50 robot board that gives me expanded space for servos?
-
there are unused pins on the AVR microcontroller used in teh 50 dollar robot
-
calibration means findinout out what ur mcu reads for different values of distance now how u do it??/
keep ur sharp ir at a known distance and using uart see wats the reading of ur mcu keep doing this at different distances and find out the trend in the readings
ex-
distance reading
10 cm 90
12 cm 100
14 cm 120
18 cm 150
draw a graph using these readings by taking distance in the X axis and Reading in the Y axis and suppose u have to avoid something within a distance of 6 cms then take 6 cms in The X axis and find out corresponding reading
use that value in the code and thats wat calibration means
and about the TX AND RX ,try to make the yart circuit on another breadboard and use ur mcu there for the calibration
-
Because I'm running 5 servos and only have 5 ports.
as long as i believe a servo only need one pin to control it
so as long as you have 5 ports only , you can control up to 5*8 = 40 servos only ;D
-
Because I'm running 5 servos and only have 5 ports.
as long as i believe a servo only need one pin to control it
so as long as you have 5 ports only , you can control up to 5*8 = 40 servos only ;D
thats 8 servos per pin ONLY if you buy an external servo controller
what javafiend want is for the microcontroller to control the servos directly
-
doesnt he mean motors like the hitec ones? which have an embedded driver ?if no
why dont you buy one of those as they are cheap and easy to use??
making your own servo driver is a whole project itself
-
well servo control is quite easy, u should not have any problems at all and abt the motor driver ya using it is difficult but not impossible , it can be done too
-
So what I'm hearing is that I should use UART to just get the initial sensor data for calibration. If I wanted to keep UART constantly connected, I would need a separate servo controller.
Now what is this about each pin being able to control 8 servos? Can someone point me to something showing how this works and is implemented - both hardware and software?
-
Now what is this about each pin being able to control 8 servos?
1 pin controls 1 servo ,1 port controls 8 servos
when you say 1 pin controls 8 servos this means that you are using the same control signal to all servos
so the 8 servos would act the same
i dont think you meant that anyways.
check the website for more info about servos
-
well u dont need to connect the usart always , just do ur sensor calibration in another ckt by using uart then use them in ur program
and do u understand the difference between port and pin????
8 pins === one port
like portd which has pins from 0-7
-
and do u understand the difference between port and pin????
8 pins === one port
Because I'm running 5 servos and only have 5 ports.
Ah, that may be where I originally confused the issue. I should have said I only have 5 pins.
-
i really reccomend usig a breadboard to make the usart circuit and testing ur sensors there
-
If you are using the board from the $50 robot. There are mcu pins not connected up to anything. Its up to you to add more headers to connect them up.
look at the picture below:
(http://www.societyofrobots.com/images/sbs_avr_schematic_small.png)
pins pc0,pc1,pc2,pc3,pd2,pd3,pb0,pb1,pb2,pb3,pb4,pb5,pb6,pb7 arent connected to anything. They can all be connected to extra headers for you to use for servo's etc..
-
yes andtry uising usart
-
In addition to what paulstreats and airman00 said, you can also use the analog ports to control servos - you just need to reconfigure them to digital ports in software (sor utils file explains it).
You can control like ~14 servos I think with the $50 Robot (I didn't count, but its around that number).
-
analog port means the analog to digital converter pins isnt it?
-
no , i guess admin meant the digital to analog ones, which are related to the timer(called pwms)
-
you can use the analogue input pins. you just need to configure them as digital i/o and set them to output
-
ook thats easy to do by software
-
It sounds like the microcontroller pins are kind of multi-purpose. For example, I was concerned about using PB6 and PB7 (XTAL1 and XTAL2) for anything besides whatever XTAL is. Perhaps I am in over my head :(
-
for ur 1st bot or whatever...
always remember the KISS principle or ull end up with a robot whose motors even dont turn properly
-
what is this KISS principle?
-
what is this KISS principle?
Keep It Simple Stupid
-
what is this KISS principle?
Keep It Simple Stupid
lol ,, tricky one
-
hmm... really really Tricky
-
I'm not sure what to google for to find examples of pins being used for more than one thing. Can anyone help me out or throw out a link or two?
-
its all in the datasheets
check some mcus datasheets