View Single Post
  #21   Spotlight this post!  
Unread 04-03-2009, 10:06
Tom Line's Avatar
Tom Line Tom Line is offline
Raptors can't turn doorknobs.
FRC #1718 (The Fighting Pi)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 1999
Location: Armada, Michigan
Posts: 2,554
Tom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond repute
Re: Joysticks with circular motion

Quote:
Originally Posted by EricVanWyk View Post
I'm really liking this idea - I hope I get a chance to try it.

Do you use |R| just for a dead zone, or do you also use it to vary the speed with which it approaches the intended direction?

Again, cool!
We use R as the dead zone. We take the polar angle of the joystick, and compare it to an angle calculated from a 10 turn pot connected to the turret. We feed them into a PID loop that handles pointing the turret. It's generally within a degree of where you push the joystick, and gets full 270 degree rotation in 2 seconds.

Shooter speed is controled by a knob with foot graduations.

Again - I have to credit the programming team. The mentors said "wouldn't it be cool" and the team ran with it. I answered a couple of math questions for them, but I just watched over their shoulders while they figured out the "comparator code" to relate the angles.

I guess I'll spill the beans on the whole control system setup. The camera is mounted on the turret and constantly tries to track anything in the FOV that it can lock on to. However, it doesn't control the turret motions.

The gunner can pull the trigger and fire while aiming - that will fire balls with manual aim. Or pull the trigger and push the top button on the joystick while aiming. That allows the camera to take control of the turret - but only if it has a lock. The assumption is that the gunner continues to aim as best he can, so if the camera loses lock it immediately reverts to the angle the gunner is telling the turret to go to.

It took a lot of programming time to get the transitions between the modes seamless, but now you can barely tell when the gunner is using either method. The neatest part (I think) is that the gyro code that keeps the turret at an angle is tied into the camera code too - so if the bot turns, the camera has little trouble staying on target.