Australia
Asked — Edited

Sabertooth Autotune

I cant seem to get my sabertooth/kangaroo to do an autotune. The moment I apply power to the sabertooth the motor starts running at about half speed and wont stop till I disconnect power. I am using a REX motor with encoder, limit switches, a 12 volt power supply and a battery to dump the regen power into. I have the sabertooth dip switches set to 1 on, 2 off, 3 on, 4 off, 5 on, 6 on. I have the kangaroo dip switches set all four on I just cant seem to work out what I'm doing wrong. Here is a pic of my set up. User-inserted image


ARC Pro

Upgrade to ARC Pro

ARC Pro is your passport to a world of endless possibilities in robot programming, waiting for you to explore.

Australia
#1  

I'm all out of Ideas tired Still cant get this to work. Help me Obi Wan... You're my only hope

Steve

#2  

Steve, First, very neat and clean wiring. Looks very professional.

I'm a little unclear. Does the motor start running like you say when you turn on our your home made electronic switch with the EZB? Are you saying you never get to push the little button on the Kangaroo the proper amount of times to start a tune? The Sabertooth starts by it's self and runs the motor before you get a chance to push the Kangaroo Self test button?

What LED lights are lit on both the Kangaroo and the Sabertooth?

EDIT: After rereading your first post I think you have the dip switches set incorrectly on the Sabertooth. You need to have 1 and 2 set to OFF and 3,4,5,6 set to ON. Give that a try and see if it makes a difference. ;)

Australia
#3  

Hi Dave,

Thanks for the praise :) I like neat wiring. I am inspired by your mind blowing B9.

Yes the motor starts running as soon as I apply power via the home made switch and continues running disregarding limit switches altogether. Interestingly, the motor continues to run after I switch the sabertooth off with the home made switch for about 20 seconds and then fizzles out and stops.

I did try pressing the auto tune button on the kangaroo while the motor was running, knowing all the while in the back of my mind that it was probably not going to work. I could get the orange LED to start flashing on the kangaroo according to the number of presses for each tune but the motor just keeps on turning as it was before. The motor also seems to not running at full speed, about half.

One other thing I tried was to connect to the kangaroo via the TTL cable to my laptop, but the DEScribe software couldn't find the kangaroo. The TTL cable has red, black white and green cores. I connected the green core (I think is TX) to S1 on the Roo and the white core (I think is RX) to S2 on the Roo. I think that colour code of the cable is correct? Not sure what going wrong with this either. tired not having a lot of luck.

Unfortunately I cant remember which LEDs were lit and I cant check at the moment cos I'm away for the weekend (wedding anniversary ;)) When I get back tomorrow night I will try changing the dip switches as you suggested and let you know how that goes.

Thanks for your advise Dave, I couldn't do this without you.

Steve

PRO
Synthiam
#4  

Auto tune is for pwm mode only, I believe? Isn't it for detecting pwm signal?

The dip switches need to be set for receiving serial commands - not pwm. Unless you choose to switch the saber tooth over from serial (d0) to pwm.

#5  

I'm 100% sure you have your dip switches set incorrectly on the Sabertoooth. The Sabertooth is not seeing the Kangaroo (or responding to it) because you have it's dips on the wrong setting. Set them according to what I stated above and we can start from there.

If you read through the entire Kangaroo manual you will find a section towards the end walking you through installing it onto the Sabertooth. I don't know why they put it at the end. That seems kinda backwards to me. In that section they even have a picture at the beginning of it showing the dips set in the proper configuration with a caption saying "Sabertooth DIP switch setting all modes". The instructions says that this dip setting sets the Sabertooth to packet serial mode at address 128.

When attaching your TTL cable hook TX to Control input S1 and RX to S2. Attach Ground to 0v. I dont know what TTL cable you have so I cant halp with it's color coding. You need to ash the manufacture about that. I had intermittent connection issues with the USB attachment point on my laptop with the TTL-USB cable I was using. I thought it was the cheap cable I was using. I bought a better one but still had the problem. when it lost connection or gave me the not connected (cant remember the exact message) I had to wiggle the USB connection and push the connect button in the DeScribe Software. Some times I had to do this several times to connect and also everyonce in a while while I was working with settings in the software when I wanted to upload the settings to the Kangaroo.

That brings me to the software. Remember to upload any changes you make in DeScribe to the Kangaroo. You don't have to restart the Kangaroo each time but you do need to upload any changes. There is a real neat feature in DeScribe where you can test any changes you make in real time before you Upload. It's in the "Custom Test" tab. Make sure DeScribe shows it's connected to Kangaroo in the center box at the top of the program before you try to test any settings live (DeScribe should auto scene you have the Kangaroo attached and set up the software to adjust the Kangaroo). After you done testing your setting live then you must upload them and restart the Kangaroo when you disconnect the TTL and hand control over to the EZB through the Uart. You can use a serial pin on one of EZB's Digital ports but you wont be able to receive any feedback information from the Kangaroo that way. You need the Uart port for feedback.

Good luck and keep us posted. ;)

Australia
#6  

Hi Dave,

You Da man! :D

I changed the dip switches as you suggested and everything worked as expected. I have done the auto tune. I did however need to remove the index wire from the encoder because when I started the auto tune the motor moved to the first limit switch and stopped and went no further. Once removed I was able to do a complete successful tune. One other thing I will have to fix is during the tune there were a few sudden movements which caused the motor gear to jump a tooth at one point. I will need to increase the spring pressure holding the motor to the large gear and do another tune, but that's no big deal. ;)

Now I need to work out how to send data via the EZB. Do I use the script manager? Do I need to connect to the roo with the DEScribe software before I try anything?

Not really sure where to start :(

Anyhow.. Thanks for all your help Dave. I hope I'm not too much of a pain in the butt blush

Steve

#7  

That's fantastic Steve! The biggest hurdle with using a Roo with a Sabertooth is getting that first tune done. It's all down hill from here! :)

I also found that the index pin should not be attached with this setup. Heck, that was another hurdle you jumped with ease. Your going to be just fine working with these controllers.

No, if your happy with the way your motor is preforming with the settings that the autotune set for you then you never need to use the DeScribe software to make your own adjustments. However it's helpful to be able to get in there and see what the Autotune has set the positions and speeds at. More on that later.

Sounds like your now ready to attach the EZB. I'd suggest using the Uart port of the EZB to attach to the control ports of the Kangaroo. Just match the TX, RX and Ground (S0 is the ground on the Roo) of each. The pinout of EZB's Uart (starting at the hole closest to the ADC Ports) is TX, RX, GR, 3.3vdc. Do NOT attach anything between the 5v port on the control side of the Kangaroo and the EZB. This port on the Roo is 5vdc out. The Roo gets it's controll power from the regulator on the Sabertooth. You can use this 5v power port to power other sensors like a pot or something. I'm not sure how many amps it;s rated for off the top of my head. So you'll just end up with three wires going from EZB's Uart to the control ports of the Roo.

Scripting your movement speeds and position stops is very easy. You just need to know what the values are for your min / max rotation points are that the autotune set between your limit switches. The easy way to find out would be to plug in your TTL cable and start up the Describe software. You can try to guess at these values but I had little luck doing that. The Positioning tab will give you all that info. In that tab you can see (and adjust) your hard and soft limits. Hard limits are where you actually hit the limit switches and Soft limits are anywhere you want the controller to stop before it hits the switches. It's a good idea to never let the trigger to hit your limit switches. They are there for panic situations (I'm sure your going to have a few as you set your system and code your scripts ;) ).

As long as we'er talking about panic events; If you ever go into the Describe software make sure you have "Runaway Detection" enabled. It's enabled by default and is a real good thing to have working for you. It will stop the motor if the Roo thinks you have lost control if the motor. If that ever happens you need to power cycle the Roo to get it to move the motor again. If this keeps happening and you actually have control you may need to disable the Runaway Detection till you get things worked out.

Back to Scripting; You can use the Script manager or just open a EZ Script and use that. I like to start with a stand alone EZ Script and then copy it into the script manager when I get it right. However that's just me and some people may find that extra step unnecessary or annoying.

There are two commands you need to send before you can get the Roo to have the Sabertooth move the motor. (Three actually in your case but more on that later) 1: You need to Initialize the EZB Uart port (you only have to do this one time after you power up the EZB). 2: You need to start the proper motor channel of the Kangaroo's two motor channels your using (you only have to do this one time after you power up the Roo or if you turn off the channel for any reason). I always place the Uart command in ARCs Initialization script. that way it's ready when you want to send data through the UART. You always have to have the Uart port Initialized before you can send any data through it. You can also place the Roo's motor channel start command in the ARC Initialization script but only after the Uart is Initialized with a short sleep command between them. This will give the Uart port time to start. Here is an example of what that would look like:


uartinit(1,0,9600)           
sleep(0250)
uartwrite(1,0,"1,start",0x0d) 

Breakdown of the above code: uartinit(1,0,9600) Initialize UART port 0 on EZB board 1 at 9600 baud sleep(0250) pause script 1/4 of a second uartwrite(1,0,"1,start",0x0d) Send a Uart command on EZB Board 1 through Uart port 0. This will Start drive channel 1 on the Roo/Sabertooth. 0x0d very important. This is the return command (just like hitting the return on your keyboard) that the Roo needs to process the data you are sending. Every command you send to the Roo needs this at the end.

Now that you have your Uart port initialized and your Roo/Sabertooth motor channel your using started your ready to send movement commands.

However since you're using an encoder your Roo has no idea where your motor is sitting on your turning radius. If you were using a pot you could have it attached to a ADC port and use the GetADC command to get a voltage reading, have it do a little math and that would tell you where it sits. With an encoder you have to let the Roo/Sabertooth do a Homing procedure so it can ordinate it's self to where it's sitting. Thr Roo has a built in homing routine that will do this when you send the proper command. It will move to one limit switch and stop. You can control it's speed and bring your motor back to center with additional commands. Again, I have all this in ARCs Initialization script so it's part of the robot's start up routine. Actually it looks and sounds very cool. This command will look like this:


uartWrite(1, 0, "1, start", 0x0d) #Start channel 1
Sleep(0500)
uartWrite(1, 0, "1, Home", 0x0d) #Automatic rotate left to limit switch
Sleep(9000)
uartWrite(1, 0, "1, p157307 s15000", 0x0d) #rotate right to limit switch
Sleep(11000)
uartWrite(1, 0, "1, p79440 s20000", 0x0d) #rotate to center postion

In addition to commands I've explained you'll notice a p##### and a s#### in two of the commands. These are p for the position you want to stop at and s for the speed you want to moved at. Like I said above these values are set into the Roo by the autotune procedure. You can find them with the DeScribe software as I mentioned. I tried to guess but had little luck doing that.

Now, your finally ready to send a command to where you want your torso to move to. The above procedures seem like a lot to do but really only needed to be done at startup and is completed in a matter of seconds (once you have it all scripted).

Here's an example of a single command in a script that will start moving your rotation motor and move it to a point (lets just call it 45 degrees to the right of your center point) on the radius:

uartWrite(1, 0, "1, p113261 s10000", 0x0d) #rotate half right

Here's the above command broken down: uartWrite(1, 0, Start of command to send your data through the uart port. 1 the EZB Board your useing. 0 the Uart port your useing on that EZB board. It can be 0, 1 or 2. p##### and a s#### are the position to stop at and the speed you want to move. 0x0d very important. This is the return command (just like hitting the return on your keyboard) that the Roo needs to process the data you are sending. Every command you send to the Roo needs this at the end."

Let me know how you end up fixing the jumping gears. I have this problem also. I think it's a cause of no speed ramping support in the Roo. The motor starts up to speed right away and the result is jumping gears. I added a stronger spring but still have this problem when the speed is set too high. DE sent me a Bata version of the DeScribe software with acceleration settings. I've yet to try it on my waist motor as I've been concentrating on my arm design. Hope it ill work. It would be nice to have speed ramping on this waist motor. At the least it will look more natural.

Hope this hasn't been too long or confusing and helps a little. Let me know if you need any more info or help. ;)

Australia
#8  

Hi Dave,

Words cant express how grateful I am. The effort you go to to help people like me, passing on all your hard earned knowledge is truly heart warming. :)

I cant wait to try out everything you have suggested. Thank you very much Dave

I will keep you posted

Steve

Australia
#10  

Hi Dave,

I have him doing some basic moves like turn left, turn right and centre using the script manager and voice control. Once I had the position numbers from the tune I had to tweak them a bit to get him to stop where I wanted but all in all, pretty easy. I also tweaked the homing speed as it took nearly a minute to go from centre to the limit switch when first initialised. I had to find a happy medium with that though as if moving too fast there was a big jolt when it found the limit.

I'm having a ball getting things moving. very exciting :D Thanks to you Dave :D

Anyhow, must head off to work now tired

Steve

Australia
#11  

Hi Dave,

I was toying around with ways to stop the gears jumping and I noticed I had a roll of Velcro strap sitting next to me and thought that might help. I fed a length around the motor and the leg section as a temporary fix and it worked a treat. It still allows a small amount of motor movement via the spring but nowhere near enough to jump a tooth. Its also easily removed when needed. Works so well I may just leave it there. User-inserted image User-inserted image

Steve

#12  

Humm, how about that. Nice. Simple and elagent. We still want to let the motor and gears self adjust as the torso spins and the springed hinge let's that happen. I'm guessing that the little bit of slack in the velcro leash alows for that but keeps the gears from jumping when you have a quick start up.

You guys from Down Under are pretty smart.

I wonder if a short bungee cord or a rubber tie down cord would be to weak.

Australia
#13  

Hi Dave,

I emailed DE regarding the "Beta" version of the DIScribe software and told them I needed it for speed ramping while using a kangaroo. They sent me the new version and an update file for the kangaroo. I have spent a few hours playing with it this afternoon and after some head scratching and two cups of coffee, I have the waist motor ramping. :D Nice soft starts and soft stops. The ramping effect does not seem to work on the first "homing" movement when first initiated so I needed to keep that speed down to limit the sudden jolt when it finds the limit switch. It wasn't that hard to do either... although, I made it look hard ;)

All in all, very happy. Far "Beta" ;) than jerky starts and stops I had before.

Steve

Australia
#14  

I need some more advise regarding Sabertooth 2x12/Kangaroo motor controllers. I have the one in the lower half of my B9 as seen in the previous pictures working perfectly, ramping and all. This controller will only be controlling the waist rotation motor that its currently connected to. I have a second Sabertooth 2x12/Kangaroo in the upper half to be used for the bubble lifter linear actuator and the radar rotation motor in the head section. I have mounted a 100mm (4") linear slide potentiometer and external limit switches to the actuator for feedback to the kangaroo. I have done an auto tune and have it working awesome. It has just occurred to me that the motor for the radar section I intended to connect to the second channel of the sabertooth has an encoder for feedback.

I think this is where I will come unstuck. Is it possible to connect two motors to the one sabertooth with different types of feedback (Ch 1 potentiometer & Ch 2 encoder)?

My thinking is that I cant and I'm going to need another sabertooth/kangaroo combo for the radar motor. Can someone please confirm this for me before I buy another one.

Here's some picks of my linear actuator set-up.

User-inserted image

User-inserted image

User-inserted image

User-inserted image

#15  

Hi Steve,

I asked this same question to DE support and they told me "No". There is no way to mix a pot and encoder using the same Kangaroo X2. You need to choose this option with the dip switches on the Kangaroo and the choice is either one or the other. When I thought the process through it seemed to make sense to me. A pot measures the voltage difference as the wiper moves across a voltage bar. An encoder counts light flashes or electrical pulses as it turns. Two completely different functions. Hope this helps.

Soon I'll be setting up an autotune for the mechanism that will be moving my B9 arm in and out of the torso. I'm a little worried as it will be an oddball setup that the auto tune may have trouble with. I'll be using the same Rex motor your using in your waist with the encoder built in. If you can picture this; the motor will be mounted under a platform and have a double pulley mounted on it that will winch the arm in and out of the torso on a linear slide sitting on top of the platform. It will all be attached with a strong cord that will run from the arm above the platform to the motor double pulley below through multiple pulleys and spring tensioners (to keep the slack out of the cord). This is the same design RC Sailing Boat builders use to manage the sails on their big RC yachts. My worry is that the Kangaroo wont be able to autotune this setup very well. You have seen how crazy the autotune process is with the motor reversing motor direction, checking different speeds and generally acting nuts. It's will be interesting to see how this will work. I may have to manually adjust the settings in the Kangaroo if the autotune cant figure it out on it's own. I had to do this with the arm section and it was a pain.

BTW, very nice engineering and design on your feedback device for the linear actuator. How fast is this actuator? I was not able to find one fast enough to move my bubble with enough speed to suit my taste. If I had been able to find something my bubble lifting setup would have been so much simpler and easier to build. ;)

Australia
#16  

Hi Dave,

Thanks for confirming that for me, another saber/roo it is ;)

I have the linear actuator travelling about 80mm of its full 100mm of travel because that seemed to be the limit of the rubber neck boot from Will without stretching it too far. This also keeps the movement away from the actuators built in limit switches. I did have the external limits slightly closer to the ends of the travel at first but the during the auto tune as it found the first external limit, it would "jerk" a little, as it does during an auto tune, and it triggered the internal limit and just stop and the tune would fail. Took me a while to figure this out though. I thought I had the wrong settings on the roo dip switches at first, and then I thought I had the pot connected wrong, but what it needed was to reduce the travel a little as is was too close to the internal limits. Once I had this fixed and a successful auto tune, I checked the figures with the DEScribe software and wrote the script to the soft limit figures and ended up with the 80mm travel I was after. It does this travel in about one second from end to end. Its seems to be a good speed. I can tweak that with the pot on the Roo as well. I did try the ramping effect on the actuator but it was too jerky. I think that's because the linear pot is nowhere near as high resolution as the REX motor encoder. Another advantage of the linear actuator is I can stop it anywhere in its travel and it can hold the weight of the head with no extra support or whining from the motor. All in all I'm pretty happy with this set-up. I wasn't sure if it was going to work as I hadn't seen any other B9 bubble lifters done this way

Anyhow.... I must head of to work now

Thanks again Dave :D

Steve

#17  

Nice Steve. Very well done. Seems like your becoming a Roo expert. I'm so glad this is working out so well in your build. If I hadn't put so much work and expense into my forked servo lifter I'd rip it out and refit with your setup. It sounds like it's a smooth, quiet, quick and strong device. :)

You mentioned you were able to use the pot on the Roo to fine tune the speed. I was under the impression that that pot only worked in Mixed mode where the outputs are mixed together for differential drive mobile robots. confused

Australia
#18  

Sorry Dave , I have probably spoken too soon about the pot on the roo. I haven't tried it yet on the linear actuator roo, I just assumed it would work in independent mode blush My Bad! I didn't even think about that. I'm sure you are right. What you said makes complete sense.

It did however seem to have an effect on the ramping of the waist rotation motor which is in independent mode. It seemed to alter the speed of the ramping without going back and forward into the DEScribe software. You still needed to get it close to what you want in the software but it seemed to just tweak it a bit. I found setting the ramping speed to about 3/4 of the full speed gave a nice soft start and stop without taking to long to get up to speed.

By the way I forgot to say this earlier, Good luck with your arm slide auto tune. I hope it works as expected without too many headaches. I cant wait to see them in action :D

Steve

#19  

That's very interesting about the pot affecting the ramping speed. The ramping (or acceleration as DE calls it) is a Bata feature and completely undocumented. I have a feeling you, me and the programer at DE are the only one's to have this version. I haven't seen any updates to the full public release version since he sent me this beta version. I think he sent it to me because he got tired of me nagging him for a reamping feature. :P I'm cool with that. As my Dad always told me; "The squeaky wheel gets the grease".

Anyway, after I get these arms mounted on my CSS I'll have to redo the auto tune on my waist motor and your setting and pot info will be great to know. Thanks a ton! :)

It's so very nice to have someone else working with the Kangaroo X2 and able and willing to play and tweak settings. There is so little support for this little gem of a controller. Although the support at DE is knowledgeable and friendly, it's a bit slow. I think it's a small company like EZ Robot and only have a few people working the various job descriptions. I suggested that they start a community forum so users could help each other like here on EX Robot but that went no where. It would probably be a resource issue for them and hard to monitor. Still, there is hardly any way to get help other then dont objectsupport email system and very little on the internet where people who use the Kangaroo X2 have documented or talked about issues, fixes or tweaks. Tony (Toymaker here on this forum) did some visionary type work with the Kangaroo X2 using mixed mode. He shared his scripting with us on the forum but his skill and logic in scripting so so far ahead of anything I could hope to understand at this point that most of it went over my head. He even adjusted it to work for me in Independent mode and although It did respond for me, again, the script was so ahead of my skill set I couldn't make it work for my needs. blush I feel bad as Tony spent a lot of time trying to help me.

I'm not going to "Hijack" your thread here. Dont want the forum police getting upset. But if you want a peek at where I'm at as of last night with mounting my B9 arms onto my CSS of my B9 Robot go over to my Project Page. Cant wait to get it all hooked up to the Sabertooth/Roo/EZB and see this bad boy suck in and out and wiggle around like a Night Crawler on a hot summer night after a heavy rain. :P

Link to my latest effort on my B9 Robot

Cheer's! ;)