Robot drift and turn

We fixed the pneumatic tubing dragging on the floor and checked chain tension which is equal.

We tried adding counterweights and it didnā€™t help much, our team is having issues coding a pid loop do you perhaps have an example in block?

If you could send your code through GitHub, or as a zip file, I could go through it and check if there is anything wrong.

PID.iqblocks (21.6 KB)
Do you know why this wont work? We tried several but this one directly downloaded from somebody and it still doesnā€™t work we have also tried
BA straight - Copy.iqblocks (14.8 KB)
which was our first iteration then tried caution tapeā€™s
project_repaired (2).iqblocks (20.1 KB)
here yet none of them work?

So if there isnā€™t anything dragging against the ground or chain (cable above motor B in pic 2) in the drivetrain, then continue to trouble shoot. Just for giggles, drop the chain tension on the right side by adding 1 link and try running it in a straight line. If it still drifts to the right, then take that link back off the right side and check your drive motor rpms. Do this by lifting the bot off the field so the wheels can spin freely, and in ā€œDevicesā€ on the gen2 brain run each drive motor separately and record the max rpm. If there is a difference of 10+ max rpm on the right side, then perhaps you still have extra friction in the drive.
Otherwise, maybe the motor isnā€™t paired well with the other. My teams free spin all motors to find pairs that have a similar max rpm before adding them to their competition bots.
Good luck!

(post deleted by author)

Iā€™ll check the code as soon as I can and tell you if I see something wrong.

Iā€™ll try all of this at a competition right now lol scored the amazing score of 5 auto because the code kept missing a line to drive backwards it sometimes would sometimes wouldnā€™t Iā€™ll post the code later but does anyone know why