View Single Post
  #4   Spotlight this post!  
Unread 28-11-2010, 16:42
PSHRobotics PSHRobotics is offline
Registered User
FRC #1182
Team Role: Programmer
 
Join Date: Feb 2010
Rookie Year: 2008
Location: Missouri
Posts: 38
PSHRobotics is an unknown quantity at this point
Re: [FTC]: Not Deadbands now.....speed limits

Quote:
Originally Posted by lemiant View Post
Or just change the multiplier, from * 100 to whatever you want for the maximum speed. This way you keep the entirety of the joystick for driving, instead of having your code lump the outer edges together.
I know this is a slightly old topic, but the original poster has not responded saying how he fixed his issue and it is something that I had been looking into earlier and would like to see if anyone has actually found an effective solution.

That's how we have been doing it for the past couple of years. In which case, he would scale the joystick values by dividing by 127 and then just multiplying by 90. (I use LabView, but I believe the logic works the same).

What I am curious about, however, is that the original poster seems to want the values to be above 60 (and under 90). I am unsure how I would actually do this.
I would think the best way to do it would be to find the "sign" of the joystick value (which rzoeller has shown in his code) and split into an if, then, and else sequence where if the sign is positive (1) you take the joystick value divide by 127 then multiply by 30 and finally add 60. While if the sign is negative you take the joystick value divide by 127 then multiply by 30 and finally subtract 60.
Reply With Quote