View Single Post
  #5   Spotlight this post!  
Unread 19-09-2008, 19:22
kamocat's Avatar
kamocat kamocat is offline
Test Engineer
AKA: Marshal Horn
FRC #3213 (Thunder Tech)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 2008
Location: Tacoma
Posts: 894
kamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nice
Send a message via AIM to kamocat Send a message via MSN to kamocat
Re: Completely new to programming robots...

Quote:
Originally Posted by paraphrase
How do you make a robot move?
I'll choose to answer that question quite literally. Since we are still using Victor 884s this year, you'll use an unsigned byte (0 to 255) to control the Victors, with 127 being neutral. In truth we are using the TTL outputs, connected to a PWM bumper, so there will be some VI that transmits the unsigned byte somehow (I assume it'd just be a series of 8 bits, but there's probably a couple more to mark where to start reading the number. Personally, I'd like to do it all with the FPGA, and just use the PWM bumper as a way to transmit the signal from the TTL module to a PWM cable. Of course, this would require opto-isolation, and FIRST doesn't seem to be too into that. Next year we won't be using the 884s, so they might just give us a fused H-bridge and let us create our own PWM. (Actually, it would be more like an H-bridge with a relay shut-off to the motor if the cable is pulled. The good thing is, this would still be about a tenth of the price of an 884).)

Assuming you're using a joystick control, you have the right and left drive tied to the x axis, and their offset tied to the y axis (after you've subtracted 128 and converted the y axis to a signed byte). This would work just fine, assuming the unsigned bytes saturate instead of rolling over. (you can temporarily turn it into a signed word and use the "In Range and Coerce" vi, found in Programming -> comparison)

And that's certainly not the only way of controlling a robot. I'm working on an image-based method of controlling the robot, which can be found at http://sotabot.com/robot/programming.html It's labelled "robot tracker" because so far, it just tracks the paths of both the right and left drives, given the speed of both drives. I'm still working on an efficient way of reading objects off the screen (without looking at every pixel in a 40px radius). There's also some other VIs there that I thought might be useful.

Hope that helps!
__________________
-- Marshal Horn