We just got new swerve drive and we cant seem to get it to work with any of the code we’ve gotten. We’ve had multiple people look it over to no avail. Our swerve kit is the MK4I swerve with neos and cancoders, and we are using the navX2 micro gyro. If anyone has code that would work with our setup it would be very helpful
Nothing to do with the swerve at the moment but do you have any dead zoning on your joysticks in case it’s as simple as joystick drift?
yes and no. Our controllers do have a slight dead zone that “cause” it to happen but its only because on any input our wheels jitter and shake and do random outputs
I would suggest linking your code on github so it’s easier for people to help you trouble shoot.
Had a similar issue with Rev Max Swerve at first and it was because the encoder was plugged into the driving motor controller instead of the steering one. Switching them immediately fixed the issue for me.
edit: this was the absolute encoder with the adapter.
Cancoders dont plug into the motor controllers. They directly through the CAN bus and are assigned ID’s
I don’t mean the Cancoder, i mean the JST PH 6-pin Extension Cable that plugs into the pictured adapter, that’s how it is on the maxswerve it may be different for you though
yeah i understand. I was just saying that the MK4I doesnt use the rev through bore encoders like the max swerve does.
You could try testing each wheel individually to confirm it is a code problem
We have. We cant get any of them to work. We have had 5 people look at our code from many different teams. We had team 5484’s code mentor looking at our code for hours at the northern indiana scrimmage this last weekend where he said theres no way its a technical issue and it has to be code. We stumped like 4 different coders at that scrimmage.
Have you tried using the respective hardware client to test motors individually. Doing this can confirm that steering and driving motors both work correctly on their own. It would also let you confirm that all CAN IDs are what you expect them to be. If possible you should also label your physical motor controllers with their can ids to help with troubleshooting.
Can id’s are set properly, trust me i checked personally and went through and set them one through eight respectively with a map of what they are set to on a piece of paper mounted above the coding station. I also tested the motors in the rev hardware client and they work fine through that.
Hmm, the only other thing i can recommend is checking that the encoders on the steering motors are reading properly and zeroed correctly.
weve went through those. Im not a coder so i dont know what it means or if it was fixed but on saturday I overheard them say how the number that the encoders are requesting were negative and they werent supposed to be
I’m so glad you guys got this up and running. Sorry it came down to the wire, but you put on a master class on how to drive defense this weekend. Congratulations on your well deserved blue banner and we look forward to playing with you and dred playing against you. GOOD LUCK and keep up the amazing work.
Could you attach a video so we can get a more clear idea of what is happening.
Also, have you tuned perfectly your PID constants? Maybe try moving the steering motor only with PID on a timed robot proyect by itself.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.