Canada
Asked — Edited
Resolved Resolved by Rich!

Sendserial Format

Hey all,

I'm trying to get my Dimension Engineering KangarooX2 module to work with my Syren10.

I can link/tune via the USB connection. It allows me to move and control the Syren10 no problem.

I'm having troubles sending and getting the SendSerial command to work with my EZ-B.

The the module is setup to communicate 9600/8N1 and plugged into my D3 port on my EZ-B.

The command for the module is

1,p2450 s200

I've tried the following:

SendSerial(D3, 9600, 1,p2450 s200) SendSerial(D3, 9600, '1,p2450 s200') SendSerial(D3, 9600, "1,p2450 s200")

None have worked so far. Not sure if I'm just messing up the string format or what?

Anyone?


ARC Pro

Upgrade to ARC Pro

With Synthiam ARC Pro, you're not just programming a robot; you're shaping the future of automation, one innovative idea at a time.

United Kingdom
#1  

Try

SendSerial(D3, 9600, 1, "p", "2450", "s", "200") SendSerial(D3, 9600, 1, "p", 2450, "s", 200) SendSerial(D3, 9600, 1, 0x70, 2450, 0x73, 200)

United Kingdom
#3  

We don't know if it worked yet;) But I've been playing with SendSerial a lot lately with the TellyMate which had similar style commands so fingers crossed.

Canada
#4  

I'll give it a whirl when I get home tonight.

Thanks Rich!

Kris

Canada
#5  

Still tinkering. I think it has something to do with the comm speed.

Pulling it all out to tinker with it on the workbench.

#6  

I've rewired my B9 leg section to be controlled with a Kangaroo X2/Sabertooth 2x12 combo. I've heard a lot of good things about this set of boards being able to control rotation like a servo.

I'm having some trouble getting this combo to work using SendSerial from EZB and ARC. I read in a different thread that Lumpy got this to work in his R2D2. Here the thread at post #8: Link . I haven't yet tried to link/tune via the USB connection like Lumpy did because I don't yet have an adapter. I do know it will move the DC motor because I've been able to have the Kangaroo auto tune. It moved the motor through the steps to find the limit switches, pot feedback and speed of the system. All worked great and I thought I would breeze through this. However when I try to send a command from ARC through SendSerial nothing happens. In the other thread I pointed to above, Lumpy found an added command and got his dome to work. No go with my setup. Here's the syntax from his thread we both used and his explanation:


Dome Center - SendSerial(D0, 9600, "1,p2450 s800", 0x0d, 0x0a)
Dome Left - SendSerial(D0, 9600, "1,p3675 s800", 0x0d, 0x0a)
Dome Right - SendSerial(D0, 9600, "1,p1225 s800", 0x0d, 0x0a)

D0=EZ Robot Port
9600=Baud
1=Motor Channel
Pxxxx=Position
sxxx=Speed
0x0d=Return Key *
0x0a=New Line*

*These two items are what caused me grief for about a week. Once
I added them to the command line everything began to work.

I did make sure I changed my entry so it pointed to the port my cable was attached to. Any ideas? Hopefully Lumpy will read this and chime in if he can help. Here's the statement I used. This should send it almost to the end of stroke and the limit switch:

SendSerial(D14, 9600, "1,p1200 s800", 0x0d, 0x0a)

One odd thing; I do notice that the steady blue light on the EZB blinks off and on quickly when the SendSerial command is sent. Also the signal pin on the port I'm using stays high (5vdc) after the command is sent. Is this normal?

Thanks in advance, Dave Schulpius

#7  

@Dave Just a couple of thoughts.....does the blue light blink fast when any other commands are sent? Has the Bluetooth become a "bottle neck" for serial data! Have you tried a dead slow " s100" command to see if that has an effect? Also does the rapid blinking occur if the Kangaroo is plugged in? ,, to see if there is a poor relationship with that board. Can you use another serial peripheral to compare a serial command?

Trouble shooting is a big part of what we love to do ;)

#8  

Hey Glen! Thanks for the interest and help. This is the first time I've tried to use the SendSerial feature so I'm kinda a newbie in this area.

The blue light only winks once quickly at each and every SendSerial sentence sent. I haven't tried it with any other control or command. Like I stated earlier; The signal pin of the port I'm using stays high after a SendSerial command is sent and connected to the Kangaroo. Not sure what happens with it's disconnected. I'll try that today.

I haven't tried running the Sabertooth yet without the Kangaroo. I actually planed to try this today. I also have an extra Sabertooth, Kangaroo and EZB so I plan on setting up all new hardware to see if I may have a faulty board somewhere. I have a feeling it's either the way I have everything wired or my Syntax. However both seem correct to me.

As far a Syntax; the only thing I'm unsure of is why Lumpy added both a 0x0d (Carriage Return) and a 0x0a (New Line) in his statement. The Kangaroo manual says a "New Line" statement is needed. The documentation of how to use the Kangaroo and Sabertooth sucks and I cant find a forum that is talking about them much. When I do find a thread it's either about people waiting on one to arrive or saying that it works great for them. Not much about how they set it up.

I'm not sure but I don't think there could be a bottleneck for the Bluetooth. I'm testing this in a new occurrence of ARC with only this one EZ Script control installed and it's connected to just this one EZB board.

Using another Serial device is a good idea but I'm not sure what I could use. Again, I'm new to this part of it all and feel a little lost. Any suggestions on what other kind of serial peripherals are out there I could easily use and find? I do have a USB to Serial adapter on the way from Amazon that should be here Tuesday. I hope to be able to use my laptop and use a Terminal to send commands. This way I can see Kangaroo's feedback error codes if I'm doing something wrong. One of the cool things about Kangaroo & Sabertooth is that they return a lot of feedback info with blinking lights and serial error codes (if you have the RX (return) line hooked up).

Thanks again, Dave

#9  

Have you tried the code without the return and just the newline? I've only messed with send serial a very little bit and it was months and months ago but as far as code goes, I know that having the return then the newline, the device could see nothing as the command.

Command, return, newline could be interpreted as:

Command, return newline

Therefore there is nothing before newline so there is no command.

So try Command, newline. I can't say it will work but it will only take a few seconds to try.

#10  

Yep, I did try that but will give it another go. Maybe after power cycling everything on and off it may work.

United Kingdom
#12  

I haven't read the last few posts properly, only skimmed over them as I've literally just got back home after a weekend out doing some crazy stuff :)

Lumpy's code which worked was;

SendSerial(D0, 9600, "1,p2450 s800", 0x0d, 0x0a)

So, Dave your code should be like;

SendSerial(D14, 9600, "1,p1200 s800", 0x0d, 0x0a)

Which is what you have. It should work. If not then you could try substituting the ascii characters for their decimal and hex values... User-inserted image

So...

SendSerial(D14, 9600, 1, 0x2c, 0x50, 1200, 0x53, 800, 0x0d, 0x0a)

Where 0x2c is the comma, 0x50 is the P, 0x53 is the S.

It is also normal for the blue light to flicker when sending serial commands, while this video is for a different issue I was having take a look at the blue light (or the glow from it at least).

#13  

Thanks for the info and vid Rich. That answers my flicker question.

I'm going to go over all my wiring and replace all boards just in case I screwed something up. I'll also try to use the decimal and hex values and see where that sends me.

Thanks for taking the time Rich and glad you made it back home alive after a crazy trip. eek

#14  

OK, I got it working. I'm not really sure what I did. After I realized things were running properly I tried adding and removing the 0x0d, 0x0a entries. I found it didn't matter. I could leave both in or take any one out and the command statement still worked. However I did have to have a least one of them in the sentence.

I also was able to test the servo controls with the Kangaroo x2 and they work great! So it looks like I can use either SendSeriel commands or servo commands. The response is quick and smooth.

Sadly I now have a different problem now. I went ahead and wired the setup in permanently and now I cant get the it to start again. However now I have a different error code. Right away on power up I get three continually blinks of the Kangaroo's LED. I have everything wired up properly I think and I have no idea what changed. I have a e-mail sent in to Dimension Engineering to see if they can tell me what this error code means.

#15  

whew! Glad things worked out well with the serial code and the EZB....now Kangaroo error code..perhaps it require some sort of internal "boot" or reset! :)

Canada
#16  

Sorry, late to the party.

Seems like you got it going but it's being finnicky after the permanent install.

Hopefully DE can help you straighten it out.

#17  

Hey Lumpy, we were talking about you. Were your ears ringing?

DE did get back to me. They say it sounds like a wiring problem. I did double check it all but it looks like I need to go over it all again. I bet I have a bad connection or wire somewhere.

#18  

Out comes the multimeter ! continuity at least :) Couldn't be too many ...4? 6?
Best of luck(make sure you visit those ice caves on Lake Superior at Bayfield) :) Glen

#19  

LOL Glen. The Ice caves of Lake Superior is about a 7 hour drive or more. With all the snow and cold we've had here in lower Wisconsin I have no desire to look at any more ice. I can make my own with all the snow and Ice I've shoveled. tired In fact I just spent the past hour shoveling. It's not such a bad thing until I think about the time it's taking away from my robot build and figuring out this latest challenge.

Well, I've got a few minutes now so it's off to the shop to find my muitimeter and check out that continuity thing you were talking about. ;) If I don't find any obvious opens I'll have to pull the boards and check for cracked header pin solder joints. I may have cracked one when I tightened down the input connection screws.

#20  

I guess I've hijacked this thread a bit. However it was dead for awhile so I hope Lumpy doesn't mind.

I do have good news though! I've got my Kangaroo x2 wired in and working properly with the SendSerial commands. As I said above I did have this working once before and then everything stopped working after I hard wired everything into the robot with blinking error lights. The error blinks seemed to say I had something miss-wired. Not so! After going over everything many times and trying different combinations between power supply, batteries and then both, the problem turned out to be a position issue with the limit switches. Let me explain:

Before using the Kangaroo everything needs to be hooked up the way it's going to be run. Motors, position feedback device, power type and limit switches if they are going to be used. Then the board needs to be put through a "Teaching" session where it moves the motors to the limit switches (if used) and also changes direction and speeds several times.This is very cool to watch. After about a minuet (and if the learning session is successful) the board now knows where the limits of the rotation are, the speed of the motor and how much weight it's moving. It should then end up in the center position and halt knowing everything it needs to know about the system. The thing I was doing wrong was I needed to start this "teaching" session close to the center of the rotation. I was starting the session near to my limit switches and that must be what the blinking error message was trying to tell me. Once I moved the motor away from my limit switches and toward the center everything started to work again. Yah! :P

There are other oddities about using this board that I'm learning that I plan to reveal in a new and different thread. I want to do a Review / Tutorial on this cool little board. I think it could prove to be a valuable addition to bots of all sizes used along with EZB. I will share one thing now:

When using the Simple Serial language like we were discussing in the above posts I found I needed to send a "Start" command before things started working. Sometimes I had to send it twice. When the Kangaroo successfully receives this command the little yellow LED on board will quickly blink very brightly. It will then accept serial commands from EZB. This SendSerial command looks like this:


SendSerial(D14, 9600, "1,start", 0x0d)

Oh! One more cool thing! Not only can I move my DC motors now with this board combination using SendSerial commands in ARC scripts but I can also use the ARC's servo Controls or servo commands in ARC Scripts! I just pointed the servo commands or set the port in the servo controls to the one and only digital port I have the Kangaroo/Sabertooth attached to! I haven't attached a second motor yet but I should be able to run two motors like described from just one digital port (I think).

Cheers! Dave Schulpius

#21  

Thank you for sharing your experience with this item Dave. Look forward to any updates. Steve S

#22  

Thanks for the detailed info Dave. :)