We are using an X-drive in one of our robots, but we have noticed that when we give the robot a setmotorspeed command to 100 on all 4 motors, 3 of them start moving inmmediatly, but the 4th motor takes a bit longer to start, this cause a small change in angle and then the bot keeps moving forward in a straightline, but it is affecting us cause we align the robot perfectly and when trying to move forward it drifts a little to the right before starting to move forward.
Is there anyway to fix this though programming?
We’re sorry that you have encountered this issue. To help resolve this problem, we will first check to see if it is a mechanical issue that might be causing this behavior.
Does this issue occur consistently with the same 3 motors working good, and the same 4th motor being slightly slower to start? If so, it is likely this issue is because there is either more friction on this 4th motor or there is a lot more robot weight on this 4th wheel. Both of these will cause this 4th drive train motor to have to work harder to keep up, which would result in slightly delayed acceleration if the friction or weight imbalance is severe enough. Ideally X-drive / holonomic robots needs to have fairly even weight distribution on their four wheels to work well.
If the three good motors are not consistent, then another potential issue that might cause this behavior is if either the robot drive train or the floor is not perfectly flat. If either of these have slight deviations from perfectly flat, then X-drive / holonomic robots will appear to drive to one direction slightly because the 4 omni-directional wheels are not equally in contact with the ground.
In your program, please also check to verify that you are using the same motor power (Set Max Power block in Modkit, setMotorCurrentLimit in ROBOTC). If one your Smart Motors is set at a lower power level in your program, that motor will be weaker. If the motor is not heavily loaded, this will cause it to accelerate at a weaker pace but eventually reach the same top speed.
You can also use this maximum power power block to manually dial back the motor of motors that spin fast to compensate for things like uneven drivetrain weight distribution in an X-drive / holonomic robot. For example, if the 4th (slow) motor is at 100%, you could experiment with setting the 3 faster-accelerating motors to 90%. This could help overcome mechanical issues like higher friction in one part of your drive train, or uneven weight balance that causes one motor to work harder.
If you have any further questions, please feel free to contact our technical support folks at email@example.com.