
Hey Lumpy (or anyone who can advise). I'm addressing this first to Lumpy because I know he is using and working with the Kangaroo X2 / Sabertooth setup. If anyone has some insight please chime in.
Anyway, as mentioned in other posts I'm working through issues with my Kangaroo X2 / Sabertooth setup where I'm using two DC motors that have pots for feedback and limit switches. I now have both motors responding through serial commands from ARC. I had an issue where I was continually getting error codes at power up and would have to power cycle the unit to get it to respond to serial commands. However I found I had to make sure the Sabertooth/Kangaroo powered down completely when the robot and EZB was switched off and then powered up after the EZB was powered up.
My issue now is trying to get the speed ramping feature of the Kangaroo to work. There are different ways to set up the Kangaroo; Velocity or Position control. I cant get the speed ramping to work when serial commands are sent from EZB in either control setting. However, I can get ramping to work nicely in Velocity but not Position tests when using the "Live Test" section of the Describe software used to set up the Kangaroo. When doing these test I'm attached directly to the Kangaroo with a Serial Adapter from a USB port of my laptop and EZB is not connected.
Without any ramping my motor will jerk to full speed and stop suddenly. I've e been working with Dimension Engineering on this for weeks but it's been painfully slow. The only way I can get help from them is through e-mail and it sometimes takes days for them to respond. Then I'll get a one sentence question or answer like "sounds like you need to make sure to upload your settings and reboot" or please send us a copy of your settings. This must be a newer product with limited users. I've found no community forums and few people posting info on this board.
One other thing. What is the best way to set servo control to work independently on the Sabertooth/Kangaroo's second motor channel? So far the only way I've been able to get it to work is if I start the first motor Chanel with a servo command and don't release it. I am using a second cable attached to a second digital port on EZB and attached to S2 of the kangaroo. I'll call that port when I want motor 2 to respond to a servo command.
I must say it is a great little board and from what I've been able to set up, it works great. I like the idea of being able to send servo commands to control my DC motors. Very precise and quick. If I can get this speed ramping issue figured out it will be an excellent addition to my B9 robot motor control.
Off the wall, first thing that comes to mind is can you send the serial command to start the motor but then put a " long" delay/sleep serial command ie 100uS then motor on then a short delay ie 80 uS etc until the motor is at your full desired speed!? Akin to PWM.....sometimes a crazy question can lead to a new perspective
Thanks Glen but it didn't work. I'm hitting dead end walls now with this issue. If I cant get it worked out I'll have to abandon the Kangaroo X2 and go back to having EZB ramp speed using progressing PWM commands. I cant put up with the jerky start up and stop. Now I'm even having problems with giving servo commands. I cant get ServoSpeed to work and servo position is resulting in jerky movement. Cant understand what happened. I had the servo commands working OK yesterday.
Tomorrow I'm going to do a factory reset on the Kangaroo and if that doesn't get things working again I'm moving on.
Dang! That's just weird confused.....Lumpy! where are you? and or other Kangaroo people
Well, I got my answer I needed from Dimension Engineering. They say Kangaroo X2 does not support speed ramping in Position Mode. Speed ramping only works in Velocity Mode. The only thing I can control in Position Mode is Speed and position. From what I can tell Velocity Mode seems to be best used with RC controllers. They seemed to say that the only way I can get my motor to stop exactly at certain spots in Velocity Mode is to write script in one of the supported languages (C+, C++, VB and others). With a script like that I could also set ramping, speed and stopping points and send that script through the serial port. Problem is that Velocity Mode is not very precise or exact where it stops. Image an RC car rolling to a stop when you bring the joy stick back to center. I guess you could reverse to stop quickly or break.
To tell the truth if I have to learn all that language and write all these scripts to get a gradual ramp up and down I'm really not gaining much using the Kangaroo X2. I need speed ramping in position mode to get my B9 joint movements to look natural. I can see where this Sabertooth / Kangaroo would be a great little combo for other people in other types of platforms. It does a great job converting RC Signals and magically controlling a DC motor and accepting servo commands. If you really don't mind your motor starting up and stopping fast then the coolness of sending servo commands to a DC motor is for you.
With that said I still have this Sabertooth / Kangaroo X2 combo installed and I did a lot of rewiring to get it installed and working with B9's waist and hip motors. I'm not one to give up and hoped to get this setup to work the way I want in my B9 robot and EZB. So.... I started to rethink Glen's (irobot58) suggestion of sending gradual increasing speeds through a EZB serial port to the Kangaroo. Thanks Glen! . After some trials and more then a few errors I got it to work! I've got a first draft of a nice speed ramp up and down. The trick that works is to send a very low speed setting like s050 with a very short Sleep delay like 0050 before I go to the next gradual speed increase of s100. I continue this (keeping the Sleep to a very short 0050) up to about s300 or s400 then jump to the speed I want. In my case the best natural speed in about s500 or s600. The trick is the timing at full speed so it starts to reverse the ramp code at the right time so it drops speed back down to s050 at the very end of rotation. The result is a nice start up and a very slow cost to a stop. So the code looks something like this:
Like I said this is a ruff script that ramps nicely. I still need to work on it to see if I really need all the speed commands and if I can cut the Sleep commands even shorter. I also would like to see If I can send this script using only one SendSerial command with the speed changes called as a script.
If there are any suggestions on refining or tuning this I would really appreciate it.
That's awesome Dave! Of course the script is cumbersome to build and not as elegant as we like....but...it will do what you want!
I am doubly pleased today as I was able to help out .....and...am currently holding my day old, first grandchild, Oliver in my arms
Perhaps a script that incorporates a variable that adds by certain increments and subtracts will fulfil the "elegant" quality!
I have been helped so many times by the awesome people of this Forum its a pure pleasure and joy to assist someone in whatever way possible ....... Thanks for the accolade Dave
Hey, congratulations on the grandchild! I know you must be proud.
Writing scripts is not one of my strong points. I'm going to have to think about this and try a few things out. Variables may work if I can figure out how to implement them.
Some snippets of code which may help you out
Increase a variable by a set amount
So to ramp up from 0 to 300;
So if you put the send serial command below the :loop label and above the IF it'll run the command, starting at 0 speed, increase by 50, loop back up, send the serial data again, increase by 50 and so on until it hits 300, when it hits 300 (after sending the speed 300) the IF will terminate the script with the halt command.
To add in the speed variable to the serial data, i.e. SendSerial(D0, 9600, "1,p2450 s300", 0x0d) you simply need to break the data at the s and add in the variable so it would be like SendSerial(D0, 9600, "1,p2450 s"+$X2_Speed, 0x0d)
The same could be done for position, but break it at the p like SendSerial(D0, 9600, "1,p"+$X2_Position+" s300", 0x0d)
Note: I haven't tested this, I am unable to as I don't have a sabertooth or a Kangaroo (yet)
Unfortunately I'm out of time, it's late and I need sleep, but hopefully that will have explained a few things and helped guide you in the right direction. If not feel free to ask about whatever you are stuck with and I'll try to explain better.
@Rich Your awesome! I wish I could give you half of Dave's accolade
You have articulated my vague script suggestion
very well. When Dave reads this I am sure he will be very pleased ...and anyone else who needs Kangaroo ramping