|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Victor 884 calibration
How do you calibrate a victor 884 so when using an xbox 360 controller the motors do not turn when not moving the joysticks.
|
|
#2
|
||||
|
||||
|
Re: Victor 884 calibration
That should be changed in your program. Output the values you receive from your joysticks to screen and when your joysticks are centered set that value to neutral.
|
|
#3
|
|||||
|
|||||
|
Re: Victor 884 calibration
Quote:
Pavan. |
|
#4
|
|||||
|
|||||
|
Re: Victor 884 calibration
All teams should be calibrating speed controllers to their control system. It is the only way to insure that you have full range in both directions and insuring that the joystick will cause a 127 when released (center position). Although the Victors come calibrated to known joystick values they have not been matched to your joysticks. Do your drivers a favor and calibrate.
|
|
#5
|
||||
|
||||
|
Re: Victor 884 calibration
In this case, the first thing I would do is calibrate the Chicklet. Follow the directions in the manual here. If you calibrate your robot code or Victors to match whatever the joystick is outputting now you could create a dangerous situation. Consider this: if your Chicklet is outputting a value of 110 when the joystick is centered, and you calibrate to this, then if the Chicklet gets unplugged (setting the joystick value to 127), your robot will drive forward. As a rule of thumb, you always want to start by calibrating your joystick such that it outputs 127 when it is centered.
|
|
#6
|
|||||
|
|||||
|
Re: Victor 884 calibration
...or calibrating their control system to their joysticks. Doing it in software is not as convenient as using the built-in feature of the Victor, but it helps keep autonomous control values consistent.
|
|
#7
|
||||
|
||||
|
Re: Victor 884 calibration
Quote:
|
|
#8
|
|||||
|
|||||
|
Re: Victor 884 calibration
On my Xbox controller, My return-to-center values are 110 to 140, depending on from which way its returning to the center. I just put an input deadband in that covers these values.
Jacob |
|
#9
|
||||
|
||||
|
Re: Victor 884 calibration
Here is some code that can be used to scale the joysticks:
Code:
/* Typedefs so that compiler-independent types can be used. These should be
* defined in a single header file somewhere and included in all of your code.
* While not strictly necessary, it is a good habit to get into. */
typedef char s8;
typedef short s16;
typedef long s32;
typedef unsigned char u8;
typedef unsigned short u16;
typedef unsigned long u32;
/* Always calibrate your joysticks so that they output 127 when in their
* resting position. Use the IFI Dashboard if necessary to help with this. */
#define JOYSTICK_MID 127
/* This function takes in a joystick value from the OI as well as a known
* minimum and maximum value for this stick and scales it such that the value
* is in the full 0-254 range. The return value from the function is the new,
* scaled value. */
u8 scale_joystick(u8 joystick_orig, u8 joystick_min, u8 joystick_max)
{
s16 scaled_val = JOYSTICK_MID;
/* First, make sure the original joystick value falls in between
* joystick_min and joystick_max, in case it's slightly higher or lower
* than we expected. */
if(joystick_orig > joystick_max)
{
joystick_orig = joystick_max;
}
else if(joystick_orig < joystick_min)
{
joystick_orig = joystick_min;
}
if(joystick_orig > JOYSTICK_MID)
{
/* Formula: ((positive joystick deflection / positive range) * 127) +
* 127. Multiply by 127 before dividing by the range in order to
* avoid floating-point operations. */
scaled_val = ((s16)JOYSTICK_MID) +
((((s16)joystick_orig - ((s16)JOYSTICK_MID)) *
((s16)JOYSTICK_MID)) /
((s16)joystick_max - ((s16)JOYSTICK_MID)));
}
else if(joystick_orig < JOYSTICK_MID)
{
/* Formula: 127 - ((negative joystick deflection / negative range) *
* 127). Multiply by 127 before dividing by the range in order to
* avoid floating-point operations. */
scaled_val = ((s16)JOYSTICK_MID) -
(((((s16)JOYSTICK_MID) - (s16)joystick_orig) *
((s16)JOYSTICK_MID)) /
(((s16)JOYSTICK_MID) - (s16)joystick_min));
}
else
{
/* Do nothing - the incoming joystick value was 127, and the scaled
* value is already defaulted to this. */
}
return scaled_val;
}
Code:
/* #defines as an example */
#define PORT1_X_MIN 24
#define PORT1_X_MAX 249
#define PORT1_Y_MIN 22
#define PORT1_Y_MAX 250
...
p1_x = scale_joystick(p1_x, PORT1_X_MIN, PORT1_X_MAX);
p1_y = scale_joystick(p1_y, PORT1_Y_MIN, PORT1_Y_MAX);
|
|
#10
|
||||
|
||||
|
Re: Victor 884 calibration
Quote:
This is why we recommend the Logitech Dual action instead of the X-box controller. The X- box is not as consistent when returning to center. |
|
#11
|
|||||
|
|||||
|
Re: Victor 884 calibration
I would actually recommend that new teams with no experience in calibrating the victors avoid doing so at all costs unless you can get a qualified person to help. We tried it in 2005, when we had all rookie team-members, and it caused us nothing but harm. The 'bot would go crazy during autonomous, and we could never get the controls to respond right. Looking back now, we can see that this was all do to the fact that we had zero experience in electrical/programming, and made mistakes... but they were easy ones to make. Try to stick to the trim-tabs on the joystick. In cases like with the Xbox controller, your dead band is an awesome and simple solution to the problem.
|
|
#12
|
|||||
|
|||||
|
Re: Victor 884 calibration
This is why I love the USB Chicklet. With the Logitech 3D Pro, full forward is EXACTLY 254, full reverse EXACTLY 0, and neutral EXACTLY 127. You don't need to worry about scaling code, or about calibrating to joysticks and not to software.
|
|
#13
|
||||
|
||||
|
Re: Victor 884 calibration
Quote:
|
|
#14
|
||||
|
||||
|
Re: Victor 884 calibration
Exactly. It's been years since Team 95's robots have ever had (except for testing purposes) a joystick axis hooked directly to a PWM in code.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Victor Calibration | railerobotics | Electrical | 11 | 16-01-2006 18:24 |
| Victor 884 Calibration Incorrect | Just3D | Electrical | 4 | 15-02-2004 15:20 |
| Recalibrating Victor 884 | Greg | Electrical | 8 | 18-02-2003 14:07 |
| Victor 884 | Kevin Ray | General Forum | 25 | 28-01-2003 15:02 |
| Victor 884 | Gary Bonner | Technical Discussion | 4 | 14-01-2002 08:10 |