![]() |
Reducing the sentivity of the joystick in easyC Pro
possible or not?
I read that you'll need to change the joystick's linear function to a cubic one? so how do you do that in easyC? I think you'll need a look up table to save processing power calculating it...so how do you implement that in easyC? also I'm a newbie, so try to make it so that a 10 year old could understand it :p or you can upload the easyC file =D thanks for the help, neurovirus |
Re: Reducing the sentivity of the joystick in easyC Pro
There are two things you can do fairly easily that might work for you:
1. Establish a deadband for your joystick. A deadband gives an area for your joystick that won't move the robot. For example you can set a deadband of 20 so that unless your joystick moves past 147 or 107, then it sends 127 to the robot. When past 147 input joystick -20 to the robot. When past 107 input joystick + 20 to the robot. This solution is easy, but you loose the extremes and your bot may still be too twitchy. 2. Use Excel to generate your lookup table. An array of 256 values. You may prefer to use a hyperbolic function so that values close to joystick center have very little effect, but extreme values will input full power to your motors. You could combine this with your deadband for best effect. Save the file as a comma delimited text for easier transfer into EasyC. Hope this helps! Dan |
Re: Reducing the sentivity of the joystick in easyC Pro
I have been playing around with different functions for the joysticks as well. One method that I have been playing around with is a simple linear function that reduces the overall speed of the bot, with the deadband in there, and allowing it to go to full speeds when the driver holds down a button. I know you are using easy c, but this should be understandable:
Code:
if(p1_sw_trig==1) |
Re: Reducing the sentivity of the joystick in easyC Pro
This was last year's drive code:
Code:
if(p1_sw_trig && p2_sw_trig) { |
Re: Reducing the sentivity of the joystick in easyC Pro
This is how this would look in easyC
Code:
void OperatorControl ( void ) |
Re: Reducing the sentivity of the joystick in easyC Pro
Instead of using a floating point constant like this:
Code:
foo = bar * 0.44;Code:
foo = bar * 44 / 100;Code:
foo = bar / 100 * 44; // BAD IDEA!Code:
foo = (bar * 113) >> 8; |
Re: Reducing the sentivity of the joystick in easyC Pro
Would simply configuring a Tank or Arcade function remove the need for all of that code, or is it necessary to do it like that?
|
Re: Reducing the sentivity of the joystick in easyC Pro
You can simply use a tank or arcade function to drive your robot. The poster in this case wanted to "numb" the output form the joystick for what ever reason so these are examples of how it can be done. This is defiantly not required....
|
Re: Reducing the sentivity of the joystick in easyC Pro
This was brought up in a previous thread. One of the easiest ways to do this is :
Code:
#define Motor_Max (put your maximum value here)Code:
if (GetRxInput(1,1) > Motor_Max) |
Re: Reducing the sentivity of the joystick in easyC Pro
When you have the x and y coordinates, just multiply them by themselves minus a constant and then take the square root. It should look like:
Code:
joystickx=joystickx*(joystickx-2); |
| All times are GMT -5. The time now is 23:17. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi