Lynxmotion 4WD1 rover with PS2 controller Arduino code

Hi,

I have the Lynxmotion 4WD1 rover kit with PS2 controller, Sabertooth and BotBoarduino. I checked the git hub repositories of Lynxmotion and Bill Porter but I could not find any suitable Arduino code for controlling the rover with the PS2 controller.

The codes recommended in the tutorials are just for controlling the gripper or arm (for the 4WD1 rover). Can you please provide a code for just controlling the rover itself (driving motors) ?

Thank you,
Barkin.

@Barkin The Rover code samples can be found here, including PS2 code:

Note that even if you don’t have an arm connected to the rover, the arm+rover code will still work for the rover itself.

Suggested code is found at the bottom of the guide here:
http://www.lynxmotion.com/images/html/A4WD1U-guide.html
Link: https://raw.github.com/Lynxmotion/Rovers/master/Rover_2WD_PS2/Rover_2WD_PS2.ino

Bill Porter’s PS2 library:

1 Like

Hi,

Thank you for posting the links. I have already checked these links and tested the “Rover_2WD_PS2.ino” with my rover. However, this Arduino code considers the motors as servo motors and it only drives the right side or left side motors at a time (the rover only turns left or right). Does this mean that I need to modify the code and adapt it for the dc motors ?

Thank you,
Barkin.

That’s a setting with the remote control and / or the Sabetooth. Yes, the easiest way to send commands to the Sabertooth motor controller is through RC PWM commands. Can’t find an order using your email to know which model of Sabertooth you have, so will have to generalize:

  1. Put the rover on a base so the wheels are free spinning.
  2. Ensure using the current method that the wheels on the left both spin in the same direction, and same for the right.
  3. Look at the Sabertooth’s DIP configuration (reference the Sabertooth manual). One setting should be “mixing mode”. Try this.
  4. On your remote control, you may also have several modes which allow for this.

You’ll reach a setting where you only need one joystick (normally the left) to control motion.

Thank you. It has been ordered from a different mail address but the Sabertooth is “2X10 R/C Regenerative Dual Channel Motor Controller” which comes with the rover kit.

It’s likely the 2x12 RC. This is the DIP switch guide for that product. The one at the top is mixed mode.
https://www.dimensionengineering.com/tours/sabertooth_rc/SabertoothRCDips.html

Mixing Mode: With switch 1 in the UP position, the controller is in mixed mode. In this mode the signal sent to the FWD channel controls the forward/back motion of both motors, while the Turn channel controls the difference in speed between the two motors. Switch 1 in the DOWN position (shown) allows control of the motors independently.

A point to note: the Sabertooth PROVIDES 5V via the red (center) wire to the RC receiver, so be sure not to use another battery.

1 Like

Have you gone through the sabertooth settings in Step 5?
http://www.lynxmotion.com/images/html/A4WD1U-guide.html

I had issues a few years ago with my setup, see below:
https://community.robotshop.com/forum/t/botboarduino-and-sabertooth/49678