Log in

View Full Version : New team needs help with gear tooth sensor


zako234
30-01-2008, 20:43
Hey guys, this is my school's first year with robotics, and we just got our robot moving for the first time today. I am our team's head programmer, and was chosen as the head programmer because i'm the only one who actually knows how to program in the first place. I am very skilled with Java and C#, and have figured out how to work with C for this competition.. Anyway, now that our little robot can move, I have to figure out how to do the autonomous mode. Anyway, i was considering using the (working) gear tooth sensor to figure out how far my robot is traveling, and hopefully get it to go where I want it to in the 15 seconds with that.

OK! now that we have the background worked out, I need help with the gear tooth sensor. I have absolutely no idea at all what-so-ever on how to use it, how to code for it, or even how to wire it. I downloaded the encoder code, however it's not quite making sense to me. Pretty simply, i just want to be able to figure out how far my robot is going. If anyone would be kind enough to donate any wisdom, or knowledge to me, I would be very appreciative.

-- EDIT--
I am using MPLAB

sloteera
30-01-2008, 21:09
Welcooome man...

Well... if you want to use gear tooth sensor, you must to know PID controls.
PID controls is a method that controls the movement of your robot.

But...
Basically, the gear tooth sensor is a pulse counter.
You should to use near any screw.

Example: the robot wheel's have 10 screws... when it turned, the gear tooth will count the screws and return 10 pulses in digital input of FRC...

10 screws = 1 turn of the whell = 2*3.1415*R_wheel

You'll know that ten screws corresponding to 'x' feet displacement of your robot, so you should to do a simple operation:

10 screws = 1 feet (Example)
'x' screws = 5 feet


When you find the quantity of screws, you'll set as your set point on your program....

gear_tooth_sensor = set_point - rc_dig_in0x

when 'gear_tooth_sensor' = 0, your bot will stop.





To get counter, you need set a interruption on FRC, and... the conection wires is: Signal - 5V - GND...


Our autonomous in last year: http://www.youtube.com/watch?v=0_NWM2OEfI0 ( gear tooth + gyro + CMU cam + sensor magnatic to detected Spider lag)

I try to explain, but my english isn't so good..:o
Good luck for your team!!!!

MrForbes
30-01-2008, 23:43
this thread

http://www.chiefdelphi.com/forums/showthread.php?t=62340

might help you figure out the wiring, it needs two cables, one to 12v power, and also a PWM signal cable to the robot controller.