Teensy 3.1 Rover with Roboclaw and Lynxmotion PS2

Not sure how many people might be interested in this. As many of you know, I have been playing around with some Teensy 3.1 boards and have had some boards fabricated to make it easier to connect to something.

I started playing with the Roboclaw code as Linuxguy found some issues with the Roboclaw Arduino library running on a Teensy 3.1. So I have been experimenting with some different ways to handle it. The main issue is that their library is a sub-class of their library BMSerial, which is not setup to work on the Teensy. Several ways to fix this: More details up on the Teensy forum including: viewtopic.php?f=9&p=89534#p89534

My approach to fixing this was to make a version of the Roboclaw library that you pass in your own stream object to use. Could be a hardware Serial object, could be SoftwareSerial object (Their is a Teensy version that works) … I have uploaded my version of the library.

While I was at it, I thought I would try out the Lynxmotion PS2 controller on the Teensy. Had some issues, so I updated my branch of the PS2X library to work on the Teensy, and updated it up on my Github account: github.com/KurtE/Arduino-PS2X

After that was working I thought maybe I should have something that ties them together, so I cut and pasted from an earlier Rover program and have a real simple Rover that you can use the right stick to move and turn, or you can click down on right stick and change to tank mode and use both sticks…

In case anyone is interested, I have included several of these test programs. Most of them are not specific to Teensy, other than maybe which IO pins I configured for.

Edit: Also while I am playing with the Roboclaw here, the Rover code whould also with with a Sabertooth (not the RC only mode ones).
RoboClawStream.zip (6.31 KB)
Teensy_RClawStream_Test-140217a.zip (738 Bytes)
Teensy_PS2_Rover-140217a.zip (5.29 KB)
PS2_Test-140217a.zip (563 Bytes)

You KNOW that I am interested… :smiley: Oh, yeah, I am!

I really need to work on testing this out, but at this point, I am not 100% sure my RoboClaw 2x5 is completely funcional. I still need to unplug the encoders, and see if this is part of the problem, as you suggested. I know the encoders can cause issues if things aren’t exactly right.

This is excellent, Kurt! I just received my Lynxmotion order, so I can build up another robot to test stuff on. This first build of the new robot will just be using two CR servos for locomotion, but I can easily convert it to using motors and a motor controller at some point. I’m going to finish designing and building the chassis for it today, and I have two microcontrollers available that I can use on it: a Teensy 3.1, and a BotBoarduino.

I will plan to check your code out. I may even take the RoboClaw 2x5 off of W.A.L.T.E.R. for a bit and try it out on the smaller robot. I have two more GHM-04 motors (no encoders) that aren’t in use right now, but I don’t have wheels and hubs for them right now. :frowning: I really wanted a pair of those nice aluminum wheels and some HUB-02, but they were apparently discontinued. :frowning:

8-Dale

Downloaded! :slight_smile:

I’m going to get some of your Teensy 3.1 carrier boards made as soon as I can. As soon as I have my code working with the Arduinos, I want to switch back over to the Teensy 3.1.

I’m going to have an Arduino Due next week, when my latest RoboShop order arrives. I’m also going to hopefully start working with the Actobotics set soon - there is an adapter (RB-Sct-357) I believe will allow mixing that and the SES. :slight_smile:

8-Dale