Welcome to Synthiam!

Program robots using technologies created from industry experts. ARC is our free-to-use robot programming software that makes features like vision recognition, navigation and artificial intelligence easy.

Get Started
Asked — Edited
Resolved Resolved by thetechguru!

Sabertooth 2X32 Operation

Hello Everyone,


I have been at my workbench reading all of the Sabertooth threads in the forum and for the life of me can not figure out how to get my sabertooth to do variable speed over the serial 9600 baud connection. Here's what I am trying to do.......

I am building an R2 unit and need him to drive in tank mode using a virtual joystick in my iPhone. The farthest I've gotten is connecting the Sabertooth per the tutorial and I did manage to get it to control the for directions but only in full speed. I guess what I'm trying to do is get the EZB to act like an RC controller. I ordered a kangaroo yesterday because I saw some of you have had success with it. I'm not a coder by any means, I'm much more mechanical in skill but I love working with the EZB and I don't want to take the easy way out and just go RC.

The threads I've seen so far are pretty fragmented because it looks like this has been figured out but not fully explained (dumbed down for someone like me. I am using the Sabertooth 2x32 at 24v powering two scooter motors for R2's foot drives and a Syren 10 for his dome drive also at 24v. I hate asking for help because I'm sure the answer is out there in another thread but for the life of me I can't seem to find it or understand it. *stress*

R2 is all aluminum weighing in at 160lbs so I don't want him flying into a crowd of people even though I do have a remote key fob kill switch. :D

Thanks for any help!

Douglas:)

User-inserted image

AI Support Bot
Related Content
Synthiam
#1  
I am answering from my phone on a train, so I can't provide links, but search for sabertooth speed ramping (may have better luck using google and specifying site:www.ez-robot.com before the search terms). There is a thread about a full size B9 from lost in space with sample scripts for a custom movement panel.

I also believe that speed ramping can be enabled on the sabertooth using describe software so that it works automatically but have not hooked up my sabertooth yet (project had a major delay due to basement flood) so haven't tested or able to give directions yet.

Alan
#2  
There are also 2 sample projects in EZ-Cloud called Sabertooth Speed Ramping, one by Rich and one by Rod. I believe the one by Rich is the first one and Rod may have done some modifications. Try downloading both and compare. The one by Rich will likely have built in documentation either in the scripts as comments or in a notepad object.
#3  
Thank you Alan! I'll check those out and post what happens. Thanks for taking the time while you were traveling. I appreciate it very much.
#4  
So... it looks like you can actually send a command in serial mode to engage ramping mode on the Sabertooth.

This is from the 2x25 manual, but should be the same on the 2x32:

Code:


16: Ramping (decimal 16, binary 0b00010000, hex 0h10)
This adjusts or disables the ramping feature found on the Sabertooth 2x25. This adjustment
applies to all modes, even R/C and analog mode. Values between 1 and 10 are Fast Ramp;
values between 11 and 20 are Slow Ramp; values between 21 and 80 are Intermediate Ramp.
Fast Ramping is a ramp time of 256/(~1000xCommand value). Ramp time is the delay between
full forward and full reverse speed.
1: 1/4 second ramp (default)
2: 1/8 second ramp
3: 1/12 second ramp
Slow and Intermediate Ramping are a ramp time of 256/[15.25x(Command value 10)]
See Figures 8.1 and 8.2 in the Appendix for a graph of values.


So, should be able to send the command using a sendserial() script command. Too tired tonight to figure out any further, but this is certainly something to investigate.

Alan
#5  
I'll take a look! Thank you!
#6  
Alan, Rod's script worked ! Thank you!

Now I just need to figure out how to create a virtual joystick!:D
#7  
Are you using an on-board computer and just want the iPhone as a joystick, or are you running ARC mobile on the iPhone?

If the former, there is a control in the Misc controls called iPhone Sensor Stream Server. This pairs with an iPhone app called Sensor Stream and can read the position sensors of the iPhone, so you could have a script read the variables and use gestures/position information form the phone to direct the robot.

If the latter, also from Misc controls, you can add a WII controller to the project. The mobile app can use that control to emulate a Wii controller, again, using position information, but more directly act as a joystick.

There are simpler methods if you just want on-screen controls.

Alan
#8  
Hi Alan,

My friend and I are putting together a GUI for controlling R2 and all of his servos from the EZB iPhone App. My intention is to control everything from the EZB App. The intention is to have a page with movement controls and some buttons for common servo actions and sounds. Other pages will have even more servo controls for when R2 is stationary and showing off for kids. Essentially I need one joystick to control his foot drives and another to spin his dome. I've considered mounting the Laptop inside the droid but I'm rapidly running out of room as I mount various actuators and servos in the body. So, ultimately the EZB app is most likely the best solution for now. Not sure.

I can't thank you enough for the help! I can't wait to pay it forward someday when I'm more knowledgeable.

How would you suggest I create the joystick assuming I am using the EZB app?

Again, thank you!

Douglas
#9  
Start with one of the sample apps like Roli, which has a Movement Panel for an H-Bridge (although a different one for a Sabertooth) but it will show you how the movement control is built. In fact, the Roli project also shows how to build a joystick like control using script buttons since it has movement and camera control (the camera control drives scripts).

There is a tutorial on building mobile apps here:

http://www.ez-robot.com/Tutorials/Help.aspx?id=196

Alan
#10  
Thank you Alan! That is a great suggestion!

:D
#11  
The scripts for ramping the ST are ok and do the job. However you will get a much smother ramping effect if you enable it's built in ramping. Download the DEScribe software and hook it up to the Sabertooth. You'll be able to control the amount of ramping you need a lot easier than a outside script pulsing the signal to achieve a ramping effect. In the end, once you learn how to use the software, it's a much easier and more elagent solution.

That R2 is really a nice looking bot and a real sweet and clean looking wiring job. You've put this much effort into building a perfect bot, you should really learn how to control the devices that make him run. You'll be much happier, you'll have better control and it'll run smother. ;)
#12  
Hi Dave,

I started playing with the describe software yesterday. I didn't know it could control ramping! Thank you for that info. I'll take a look at it again tonight. I really want my R2 to be as tight as possible.

Thank you!

Douglas
#13  
Photos reoriented at end.
#14  
That's one beautiful robot. My mouth is watering.
PRO
USA
#15  
indeed, i would love to have the skills and patience to build something like yours.
#17  
Sorry for the upside down photos. My iPhone for some reason wants to do that today. lol

Thank you for the compliments and also thank you for the help. I'll dig into Describe and see how much I can figure it out.


User-inserted image


User-inserted image
#18  
Well I managed to get the Describe software to interface with the EZB using the Sabertooth's ramping controls and it works perfectly!

Alan, Thank you for the ramping script help because even though I didn't go that route, the script was able to help me understand how ramping works. I needed that base to figure out how to tune the Movement Panel to get the movements correct.

Dave, Thank you for the Describe suggestion! Once I figured it out, the entire process was easy to set up and I didn't have to use the script "work around."

So with this, I will put together a thread on exactly how I was able to get this accomplished so someone else can benefit.

Sooooooo........

Do any of you know how to get a Movement Pad into the mobile app? I have created one with movement buttons but they are not as fluid as the movement pad in easy builder. The movement pad is the virtual joystick I'm looking to have on my iPhone. I've adjusted the ramping in describe to be perfect with the movement pad.:D
#19  
I'm really glad you got the ramping working. You're right, it's such an easy thing to do once you start to understand the software. I'm amazed on how many different adjustments you make on so many different DE devices with this program.

I'm looking forward to seeing your tutorial on setting up the ramping and what ever else you decide to show. I had planned at one time to do one of my own (and still want to one day) but I've been to obsessed with building my B9 to take time away to do it. Besides, there's so much to cover that a guy could write a book trying to show how to do things.

I wish I could help on the Mobile app. Again, I've been busy building to ever make a mobile app. However once the building is completed in a few months I plan to really start playing around with these cool features.

Good luck and happy building. :)
#20  
Great to hear that the ramping from Describe works. As you saw from your searches, this has been talked about a lot, but I didn't know anyone had ever tried setting it in Describe. As I said in the second half of my first post, it is on my todo list to try, but now I know it will work, that is a big relief.

Alan
#21  
@Dave - Thank you!

@Alan - I was so wrapped up in scripting that I totally missed your original Describe suggestion. Sorry about that! Anyway, Describe is really simple to play with. I'm a total newbie and even I was able to figure it out. If I can do it, then anyone can. I ordered a Kangaroo x2 to go with it because I think it will make it that much better! Hopefully it will arrive next week.

Thanks again for all your help!

P.S. Describe changes it layout based on what you are trying to control. For example, the ramping controls on the 2x32 are on the motor controls tab whereas the 2x25 has them on the general tab. That threw me for a loop because the Describe manual didn't line up when I selected 2x32 from the drop down menu.

http://www.dimensionengineering.com/software/DEScribe/html/
#22  
Again, I'm glad it's working out for you. As far as the Kangaroo goes, for it to work your going to have to use a feedback device on your motor shaft like a pot or encoder. This tells the Roo where the motor is and how fast it's moving. The Roo will not work without it. If you end up using the Roo it will add a hole nother layer of complexity and difficulty but you will have precision control. ;)
#23  
It is my understanding that it will be able to help me achieve variable speed control over the serial connection. I'm trying to duplicate an RC joystick control where the farther you push the stick the faster the motor will go. Am I misunderstanding the roo?
#24  
You're correct. You'll be able to have variable speed. It also corrects itself for load and resistance. Still, be prepared to add some kind of feedback device to your drive motor shaft. The Roo won't work without it. It won't even do a self tune until it detects a feedback device and a motor attached to it with the proper electrical connections made. You also will have to have all the dip switches set properly on both the roo and the sabertooth to match your configuration and how you intend to use it. Once you have all that in place and have completed a successful self tune it works like a dream.:)

FYI, you can use a RC joystick with the roo. You simply attach the RC receiver to the roo's control input port and set the dips correctly. Here's a cut from the roo's manual (I recommend you download the manual and give it a good read or two):

Code:


In R/C mode, the output position or velocity is
controlled by an incoming R/C signal. This could be
used for cruise control, automatically going the
same speed up or down hills, with varying load and
resistance. It can also be used to create arbitrarily
large R/C servos, proper steering or other
applications. This is also an easy mode to use with
microcontroller boards, because nearly all
microcontroller modules from Basic Stamps to
Arduinos can output an R/C servo formatted signal.
For R/C input, set DIP switch 1 to ON. R/C Input
with velocity mode automatically calibrates to the
input from your transmitter. R/C mode with
position control uses a pulse range from 1000us to 2000us, with the center at 1500us. This can be
calibrated with tune mode 4, or programmed with the DEScribe software.


User-inserted image
#25  
Thanks Dave! I'll look into that!
#26  
Holy Smokes! I just noticed the new ARC has virtual joysticks now! Has any one used it with the Sabertooth yet? Variable speed controls?
#27  
not to my knowledge.. I quickly added it to my mobile app and played with it some but only got on/off movement. I didnt dig too deeply into it though.

I am experimenting with using rc car speed controls and programming them with PWM like a continuous rotation servo so that I can utilize the joysticks.

It basically would turn my R7 into a big Roli haha

Aaron
#28  
The virtual joysticks were just added last week. I think DJ only tested them with continuous rotation server Movement Panel and with servos (camera pan/tilt).

May need some tweaking to work with H-Bridges.

Alan
#30  
I managed to get the joystick working with my Sabertooth 2x32 using simplified serial at 9600. Variable speed controls are still not there. I cheated and adjusted the ramping within Describe in order to "feather" the foot drives and decreased the top speed limit. Overall, it works well but you have to get used to driving it. I will say that the all stop works great when you let go of the joystick. Everything comes to a solid stop.

I am waiting on dimension to restock the kangaroos because I believe they will help me achieve variable speed control since I installed encoders on my foot drives and dome drive. Fingers crossed!

In regards to the joystick working with my Syren10, it works beautifully when controlling in R/C mode. Variable speed spin is awesome and the joystick is very precise on the center stop.

All in all, I love this upgrade. If I can get the Sabertooth 2x32 to do variable speed over serial I will be delighted! I want my R2 to be able to be autonomous and I can't use any cheats to do it.


User-inserted image
#31  
@DJ Sures - just saw your reply. We were posting at the same time. lol

Anyway, thank you for the link! I'll look at your script when I get home! I can't wait to get this bad boy up and running.
User-inserted image


User-inserted image
#32  
I use a kangaroo/syren10 for my dome motor and it works great. you will super happy with it!:)
PRO
Synthiam
#33  
I have serial control of speed on the todo list - in the meantime it is HBridge/PWM or Servo
#34  
No sure if you can do this in a mobile app (since I never use the mobile app feature) but you can do a "make shift" crude speed controller for the sabertooth in ARC by using the custom Movement Panel and two slide scripts.... Using variables to represent the two channel speed of the sabertooth you can simply use the 2 slide scripts to change the speed on the sabertooth when needed... One of the best things about ARC is that there is usually always a work around...

Code:


# $R_motor_Value is whatever value you set in your slide script
# $L_motor_Value is whatever value you set in your 2nd slide script

SendSerial(D0,38400,$R_motor_Value)
SendSerial(D0,38400,$L_motor_Value)
#35  
Wow! Thanks guys!

@DJ - I can't wait for that to do listing to come to fruition!

@Rich - I am a code novice. Would you mind expanding on what a slide script/motor value is? Sorry for the newbie question.
#36  
@dbickert .... There is really not much coding involved but I will try and whip an example together in a day or two and post it here...

Cheers
#37  
Thanks Richard! I appreciate your assistance.
#38  
Has anyone tried the new Serial controls for a Sabertooth? I really really really want to switch to the EZB from my Mega for driving R2.


#39  
I have:) works exactly like you would hope! no more on off switch haha

I am still running a PC in my droid with a Xbox 360 joystick

Aaron
#40  
Hi Aaron!

That's awesome news! I really like the Sony Nav controller. I'm hoping there is a way to get Windows to recognize it for the EZB.

By on off switch, so you mean he now stops when he loses contact with the controller? He would take off before.

Thanks man!

Doug
#41  
you should be able to get the sony nav controller to work by using one of the downloadable and editable drivers that are out there.

I had it working with one for a brief moment but ended up wanting more buttons haha

I mean "on off switch" because when you used a joystick before, you either had full speed forward or stopped. there was no speed in between the two. it made my droid look jerky and not as real:)

ever since switching over to a USB tethered computer and xbox controller I have not had any issues in large crowds / convention shows. [thank the maker!]

Aaron
PRO
Synthiam
#42  
Speed control is supported by all analog joysticks. The ARC manual explains more, which can be found in the learn section or by pressing the ? (question mark) next to the X any control.

Read about the sabertooth control here: http://www.ez-robot.com/Tutorials/Help.aspx?id=173

Also, click on the BLUE links for help to understand what a Movement Panel is, for example. The sabertooth control is a movement panel, as documented and explained best in the manual.

For speed control with analog joysticks, ensure you have the variable speed configured. The Sabertooth control supports variable speed.

User-inserted image
#43  
@dbickert

Quote:

By on off switch, so you mean he now stops when he loses contact with the controller? He would take off before.

Do you experience disconnects often? Are you using the new ezb4 x/2? Since I upgraded all my ezb4s I have yet to have any random disconnects from the new ezb4 x/2 or ioTiny... One other thing is to check your coding. Poor coding can be a cause of chronic disconnects... The location of your ezb4 in your robot is also important especially if your R2 has a lot of metal. This can interfere with wifi signals... Just a thought.
#44  
Thanks Guys!

@Aaron, as always you rock!

@DJ, Thank you for these upgrades! Can't tell you enough how much I appreciate it! Eventually I want R2 to follow me around on his own. Yeah, It's a pretty big goal!

@Richard, I upgraded mine as well. Lately, I have been getting disconnects from my laptop outside the droid. He is an all metal droid with an EZB in the dome and an EZB in his body. The plan is to install the laptop inside R2 and use a Sony Nav controller for driving him around with animations triggered via the controller and voice command. Essentially the Sony Joystick will be the only thing outside of the droid. My question for Aaron stems from an error I was getting in the past while controlling the Sabertooth as a servo (prior to this latest serial control release and V2 com upgrade). If the EZB lost contact with the Laptop while I was driving him, R2 would just keep going at his last designated speed. I had to switch to a Mega for driving him. Now that the EZB / Sabertooth connection is serial, I assume he will just stop if he gets out of range of the controller. The reason I want to use a one handed Sony Nav controller is due to it's size. I like to keep the illusion of autonomy alive until I can him to drive himself. :D *eek*
#45  
@dbickert

Quote:

Now that the EZB / Sabertooth connection is serial, I assume he will just stop if he gets out of range of the controller.

As far as I know ARC has always used serial (simplified at a default 38400 baud) to connect to the sabertooth. Nothing has changed in that regard. However the control now has a speed control. A sort of throttle if you will... The sabertooth is also set to "continue on" with it's last serial command sent to it... Meaning once it is send a movement command it will keep driving current to the motors until told to stop... This also means if it is driving and the ezb4 disconnects it will keep driving until someone or something stops it... Not sure this can be changed... The solution is to use an on board PC connected to the ezb4 via USB... Or you can install a remote control switch with key fob to turn on and off your robots main power or just the power to the sabertooth...
#46  
That's the plan! I have been contemplating a remote kill switch and I intend to install the laptop in the body and USB into the primary EZB.
#47  
How are you routing the signals now from laptop to the two ezbs? You will get disconntions and erratic behaviour if either the ezbs OR the laptop are too far away from the router. You could mount a router inside the robot along with the ezbs and the laptop if you have room. However like RR said, a usb connection is the best way to go.
PRO
Synthiam
#48  
Or rather than mounting a router, have one ezb connect to the other. That's the most effective way. Choose one ezb to be the master router.

Of course, this only applies to ezb v4.x/2 users
#49  
@DJ - How about connecting the main EZB to the laptop via USB and keeping the second EZB wireless? Or even better yet, can you go USB with both EZBs? If you can, is there a way to have a camera on one EZB or would that configuration sacrifice the camera? I would love R2 to react to what he sees so I really want a camera in the dome. Yeah, I know, I want the cake and eat it too. lol
PRO
Synthiam
#50  
1) one USB per ezb
2) connect multiple ezb to pc via USB
3) lose camera port when using USB. Therefore use a USB camera

Documented in USB tutorial for ezb
#51  
So can you have 1 EZB on USB and keep the other on wifi? I'm trying to keep the dome completely wireless and would like to use the EZB cam in the dome.

Thank you so much for the help!
#52  
@dbickert

Quote:

So can you have 1 EZB on USB and keep the other on wifi?

Yes you can....
#53  
Thank you Richard! That's great news! I can plug the EZB cam into the dome wifi EZB and hardwire the main EZB into the laptop in the body. :D