|
Re: CAN, PID, Mecanums
The robot is currently not moving at all when the joysticks are moved.
I know it is either a problem with the encoders or with my code, but I can't be sure which. The robot previously moved when being controlled by different code using percent vbus, so I know the other wiring is correct.
Here's what i'm currently doing in my code:
in begin vi:
i open a can reference to each motor, specifying speed mode, device number, and whether or not it is inverted. then I "set speed ref" using "quad encoder" as the speed reference (correct for KOP encoders?). I "set PID" constants, and then I enable the motors. I currently have my PID constants set as P: 0.1 I: 0.004 D: 0. Are these reasonable for mecanums directly driven by toughboxes? If not, could someone give me an explanation oof the process of manual tuning so I can be sure I did it correctly? The motors are then wired into a 4 motor drive of "existing motors" and the "max output" is set. (this should be the top speed in rpm, right?)
in teleop vi:
x and y axis are wired to x and y of a holonomic drive, and x axis of another joystick is wired to rotation
The robot does not move at all and the colors on the jaguars do not change, even when the joysticks are pushed fully in any direction. I believe the problem is in one of 3 places: wiring of the encoders, logic of my code, or values of my pid constants.
|