
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.
Thanks for any help!
Douglas
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
This is from the 2x25 manual, but should be the same on the 2x32:
Code:
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
Now I just need to figure out how to create a virtual joystick!
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
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
There is a tutorial on building mobile apps here:
http://www.ez-robot.com/Tutorials/Help.aspx?id=196
Alan
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.
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
Alan
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.
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.
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.
Alan
@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/
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:
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
May need some tweaking to work with H-Bridges.
Alan
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.
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.
Code:
@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.
Cheers
I am still running a PC in my droid with a Xbox 360 joystick
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
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
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.
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.
@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.
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...
Of course, this only applies to ezb v4.x/2 users
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
Thank you so much for the help!
Yes you can....