Tri-Controlled via PS2 controller Offset

Hello :slight_smile:,

So I have a Tri-Track with a BAP28, Sabertooth and BotBoard II. I have also purchased a wireless PS2 controller + receiver etc. It is all connected up perfectly and runs very well apart from one flaw, to drive the Tri-Track forwards, the left analogue stick has to be pushed in a North Easterly Direction (controller wise, not magnetical field). I have tried switching the 2 channels from the Sabertooth, altering parts of the code (using default PS2 controller code from LynxMotion website currently), using other PS2 controllers but all to no avail. I was wondering if anyone else has experienced this problem before and knows a solution? Its not an urgent matter but just can make it a fair bit more confusing to steer the tri-track around. Youve all been excellent so far with your replies and feedback and I would just like to thank you.

Kindest Regards
John

If you’re saying you have to provide a slight right turn to drive straight forward, then maybe your joystick center is off a little. Get readings for hands off stick, and correct accordingly.

Alan KM6VV

There is also the chance that the tracks / motors are not identical and you will need to compensate for that in the code.

Identical motors often run differently when ran in a different direction.

Alan KM6VV

I have tried to use numerous other PS2 controllers so I suspect it is either the motors or coding. The 2 motors being used have been used previously for projects by someone else so it is unknown what they were used for/if they have been damaged etc. Another thing that slightly confuses me is that whilst using the default coding, there is the gear change using the PS2 controller however this seems to only affect one motor. I have set up all the wiring correct and used the default code so not entirely sure what I have messed up on. Sorry for all these questions, been trying to work on them a fair bit just my coding knowledge is pretty limited having been trying to analyse it for hours and hours on end. I have tried altering the default coding such as

ldrive=((lvert*GEAR) + 1448.5 - (GEAR 128)) ’ Forward / backward
rdrive=((lhori
3) + 1453 - (3 *128)) ’ steering

to try and make sure that the motors start off still rather than moving when turned on.

Not sure which code base you are trying. If it were me I would try with the Rover code that Xan did. The last time I played with it, I fixed it to work with updates to HSERVO. That was in the thread: viewtopic.php?t=6994&p=68643#p68643

In the above code only the left wheel (track) is being updated by the logical Gear the right one is being stuck in 3… Maybe should be
rdrive=((lhori*GEAR) + 1453 - (GEAR *128)) ’ steering

Again don’t know which code base you are using, but if Xan’s I believe it had a Tank mode, I think it was toggled on or off by clicking down on one of the joysticks? This way one joystick did one track and the other did a different Track. Allows you to check to see if both of them are properly zeroed and the like…

Good Luck
Kurt