Go to Post FIRST - Breaking stereotypes everywhere - Sparks333 [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #41   Spotlight this post!  
Unread 17-11-2004, 14:31
Mr. Lim Mr. Lim is offline
Registered User
AKA: Mr. Lim
no team
Team Role: Leadership
 
Join Date: Jan 2004
Rookie Year: 1998
Location: Toronto, Ontario
Posts: 1,125
Mr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond repute
Re: Desensitizing Joysticks

Quote:
Originally Posted by bob1million
My fellow programmers and I have tried many different ways to desensitize our joysticks, but none of ways work very well. Does anyone know a good way to desensitize them?
It seems the problem is big enough to cause some serious thread resurrection.

Here was Team 188's solution to sensitive joysticks for 2004 courtesy Carol, Honson, Tristan and myself:


Code:
temp_p1_long = (signed long)p1_y - 128;
pwm01 = (unsigned char)(((temp_p1_long * temp_p1_long * temp_p1_long)  >> 14) + 128);

temp_p2_long = (signed long)p2_y - 128;
pwm02 = (unsigned char)(((temp_p2_long * temp_p2_long * temp_p2_long)  >> 14) + 128);
make sure you declare temp_p1_long and temp_p2_long as signed long beforehand.

In a nutshell, it's a cubic transfer function that makes the robot accelerate exponentially when you push the joystick. There's a nice wide area to operate slowly, yet full speed is still there when you push it all the way.

We spent a few days testing different transfer functions, and this one worked out the best.

It's pretty CPU intensive (multiplying long integers), and a look-up table would be faster, but try it for a quick and dirty way to get things working smoothly. You can generate a look-up based on the code later on.

Cheers!

-SlimBoJones...
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Programming joysticks NoRemorse Programming 29 24-02-2004 20:26
number of joysticks doy Rules/Strategy 5 01-02-2004 00:05
Team 524 has Team 362's spare joysticks from last year. archiver 2001 0 24-06-2002 02:36
Could use some help with joysticks . . . archiver 2001 5 23-06-2002 23:36
Calibrating speed controllers and joysticks thedillybar Technical Discussion 4 11-02-2002 13:24


All times are GMT -5. The time now is 23:57.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi