|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Mecanum Drifting
We have been working on a mecanum chassis for this years competition. We are using the mecanum cartesian function provided in the library. We feed it the following values.
Code:
(joystickx, joysticky, joysticktwist, 0.0) The motors are configured like this | = andymark toughbox - or _ = cim |- -| |_ _| And the chains go from the output straight to the wheel (so nothing fancy there). In the code we had to invert two of the motors so they would spin in the right direction. I was wondering if that would cause the robot to drift because of the cims spinning slower in reverse. I would just like to gather input from the community because I have racked my brain on this one for a while. Is it mechanical / electrical? If not suggestions for how to fix the drifting in the code? |
|
#2
|
|||||
|
|||||
|
Re: Mecanum Drifting
Are you using Victors or Jaguars to control the motor? How are you defining the four motors in your initialization code?
|
|
#3
|
|||
|
|||
|
Re: Mecanum Drifting
We are using Victors
Code:
RobotDrive *m_robotDrive; m_robotDrive = new RobotDrive(1, 2, 3, 4); Code:
m_robotDrive->SetInvertedMotor(RobotDrive::kFrontRightMotor, true); m_robotDrive->SetInvertedMotor(RobotDrive::kRearRightMotor, true); |
|
#4
|
|||||
|
|||||
|
Re: Mecanum Drifting
Quote:
The reason this makes a difference is that the factory-calibrated neutral PWM value for a Victor is slightly higher than the neutral PWM value for a Jaguar. Because of the incorrect translation from -1..1 speed control to PWM pulse width, you'll end up running motors a bit faster in reverse than with the same forward speed command. In your case, the right motors will go faster than the left ones when you're driving forward. At very low speeds, the difference will be relatively large. |
|
#5
|
|||
|
|||
|
Re: Mecanum Drifting
Definitely makes sense, I see that in the RobotDrive source it defaults to jaguars.
Quote:
Thanks a ton for the help! |
|
#6
|
|||
|
|||
|
Re: Mecanum Drifting
Just wanted to say that this did indeed fix our problem!
Thank you very much Alan! |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|