Thread: pic: Uber 3.0
View Single Post
  #36   Spotlight this post!  
Unread 07-08-2011, 01:19
AustinSchuh AustinSchuh is offline
Registered User
FRC #0971 (Spartan Robotics) #254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Feb 2005
Rookie Year: 1999
Location: Los Altos, CA
Posts: 803
AustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond repute
Re: pic: Uber 3.0

Quote:
Originally Posted by apalrd View Post
Two comments:
Also, while I like the cheesy poofs code (and 33 re-implemented it for an off-season project), I still don't get why the code Nick pointed to (cheesy poofs 2010) has a switch for QuickTurn vs SpeedTurn. Why not just do quicktunrs when the throttle is at 0 and speedturns the rest of the time?

That said, the cheesy drive algorithm is very solid.
That switch is partially that way because it has always been that way. We have found that particular choice to work well, and have no desire to change it.

Say you want to turn 5 degrees. If the robot is still in "SpeedTurn" mode, you can slam the wheel to one side, and it won't move. Then, you can tap the quick turn button. This will cause it to send +- 1 to the wheels for a very short amount of time. The net result is a turn by a small amount without having to steer carefully. We find this rather useful. This move is a lot harder to do if you try to turn the wheel with quickturn already engaged.

I also like being able to send any set of powers to the left and right wheels. So, the "SpeedTurn" algorithm won't let you send +1, -0.1. But, if you hit quickturn, you now can send that set of values out. This can't be done if the robot does it automatically for you.

Also, I am a big fan of devices having a psychologically linear response*. Having a device switch modes without a command from the user doesn't fall into that category for me. If you are driving slower and slower, and have the wheel in a full turn, once you stop applying throttle, the robot will stop. If it switched into QuickTurn automatically, it would instead suddenly start to spin. That rubs me the wrong way.

If you have any more questions about why the code does what it does, fire away. I like to believe that every line of code in the drive algorithm is there because it is necessary and helps handling.

(I have heard that the algorithm for QuickTurn isn't quite right in that code. It should be that quickturn does left = throttle - turn; right = throttle + turn; rather than setting throttle = 0.)

*It doesn't have to actually be linear by the technical definition. The driver should feel like turning the wheel twice as far turns twice as much, or the elevator moves twice as fast, or etc. It may not actually be that 2x the wheel moves 2x as fast, but if the driver feels that way, he/she will be able to control it better.
Reply With Quote