
I have searched and searched for the proper sendserial command structure for controlling a kanagaroox2/sabertooth 2x12 setup and am not getting any answers from DE. They are clueless when it comes to their own devices at times. In any case, I have successfully tuned my kangaroo and have been able to use servo commands to control it in independent mode but I am still not able to get it to react to sendserial commands. I have seen other threads on this that are 4 years or older and am hoping someone can help me solve this mystery. The solutions from 4 years ago are no longer working with current firmware. Has anyone made any adjustments to the baud rate in DEScribe or any other adjustments in DEScribe? Thank you for any help!
Upgrade to ARC Pro
Get access to the latest features and updates before they're released. You'll have everything that's needed to unleash your robot's potential!
Code:
uartWrite(1, 0, is the command for ARC to send info to the Kangaroo. The 1, is the EZB board number you are sending to and the 0, is the Uart port you're attached to on that EZB. Your numbers may be different depending how your wired.
"1, p113261 s10000" is the command for the Kangaroo to move the motor attached to motor 1 to position 113261 and a speed of 100000. Your numbers will be different depending on how your setup is built and what your autotune found. You may have to use the describe software to open the autotune stored on the kangaroo to see what it set your values at. If you send a command outside of the set values the roo wont move.
, 0x0d) is the code that tells Kangaroo that the return key was hit (just like on the keyboard on your laptop). Every command you send through the serial port to the kangaroo needs this. You can change 0x0d to it's Hex equivalent but that's just showing off. LOL
Mind the quote marks and commas.
Strong advice: use the Describe software to save your final working autotune to a safe location you will be able to access if you ever need to reload it again. This way you wont need to do another tune if you accidentally change a setting or need a new Kangaroo for these motors. However if you ever need to redo your build or change something with the motors you will need to retune again.
Please post your code so we can look it over.
Good luck.
I took your suggestion and merged it with Lumpy's code for his dome since we are both essentially spinning something. In my case, it's R2D2's Periscope and lifter.
I need serial control to use the home command with my limit switch to ensure the periscope aligns properly before lowering into the dome. I don't want it to crash and ding it up. lol
Anyway, here is my code to move the periscope and my set up (which is still unresponsive)...
uartwrite(0, 1, "2, start", 0x0d, 0x0a)
sleep(200)
uartWrite(0, 1, "2, home", 0x0d, 0x0a)
sleep(200)
uartwrite(0, 1, "2, unit 1=1", 0x0d, 0x0a)
sleep(200)
uartWrite(0, 1, "2, p1000 s400", 0x0d, 0x0a)
sleep(3000)
uartWrite(0, 1, "2, home",0x0d,0x0a)
I have D5 plugged into S1 on the Roo, D6 to S2, and D5 ground to Roo ground. When I run the script nothing happens and the EZB eventually breaks the Wifi connection and I can't reconnect unless I restart the EZB. This happens everytime I try to run the above script. It's important to note that the EZB is not giving me a connection error with the uartWrite commands, so I know it is aware of the Roo. *stress*
Is it possible I've missed a DEScribe or a dip switch setting; perhaps even a baud issue? *confused*
Thank you so much for your help! BTW - I mentioned your DB9 and EZB prowess at Droid Con in my Actuators and Ewoks presentation last month. I spent the last half of the presentation showing builders how my EZB controls my droid animations with simple servo commands.
Actuators and Ewoks Droid Con 2018
- Doug
Start
1: uartwrite(0, 1, "2, start", 0x0d, 0x0a)
2: sleep(200)
3: uartWrite(0, 1, "2, home", 0x0d, 0x0a)
4: sleep(200)
5: uartwrite(0, 1, "2, unit 1=1", 0x0d, 0x0a)
6: sleep(200)
7: uartWrite(0, 1, "2, p1000 s400", 0x0d, 0x0a)
8: sleep(3000)
9: uartWrite(0, 1, "2, home",0x0d,0x0a)
Done (00:00:06.5051509)
Thanks again for helping me with this. I can't wait to get it working. This kids at the hospital will love the periscope!
- Doug
I also have noticed that if I try to send an improper command through the serial port that the ezb will disconnect and reboot. This will probably keep happening until you get your script right. Try just putting one command in a script at a time to test your command until you get the hang of it and figure out the proper structure. I'll keep helping you as much as I can.
Thanks so much for the honorable mention in your speech. I'm thrilled you thought what I have done was good enough to present to people that you respect and want to help.
I downloaded your B9 scripts and it turns out I was forgetting to init the roo at 9600! I removed the 0x0a from the code, added the init script, made separate home commands in script manager, and BOOM!, instant success! I can't tell you how much I appreciate your jumping in and helping me out. If you are going to be at Star Wars Celebration next April 2019 in Chicago, please let me know.
Thank you sooooo much! R2 is gonna have his lifter soon!
- Douglas
Here's what did the trick and opened the door..
uartInit(0, 1, 9600) #Initialize Baud Rate
uartWrite(0, 1, "1, start", 0x0d) #Start Lifter Motor
sleep(200)
uartWrite(0, 1, "1, home", 0x0d) #Home Lifter Motor
sleep(200)
uartwrite(0, 1, "2, start", 0x0d) #Start Rotary Motor
sleep(200)
uartWrite(0, 1, "2, home", 0x0d) #Home Rotary Motor
sleep(200)
I'm glad you caught the int command. I was distracted when I posted to you and missed the lack of that command. That was why you're ezb would lock up and reboot.
I'm moving from Wisconsin to Florida in a few months so the Chicago trip would be a challenge. However it would be great to attend and see all the cool stuff and people. You and your R2 would be on the top of my list.
Good luck and have fun!