PDA

View Full Version : [Question(s)] Debugging phoenix code



KingPin
12-09-2017, 12:12 PM
Is it possible to use serial debugging while controlling a robot with the arbotix controller (or any other method of controlling it) running a version of the phoenix code?

If yes, how do I get this to work?

jwatte
12-09-2017, 01:30 PM
Yes, Arbotix has two UARTs, one of which goes to the Dynamixel bus, and one of which goes to the Xbee socket.

You can hook up only the "Rx" part of a USB serial adapter to the "Tx" pin that goes to the Xbee socket on the Arbotix. Then run a terminal emulator, and look at what you're printing out.

Warning, though: The Xbees are really slow about sending data both ways. As long as you only send data one way, they are nice and fast, but bidirectional ends up creating really long command latency.
You may want to cut off the "Tx" pin going to the Xbee, so that the Xbee doesn't get the data that you serial print, and only tap that out to a serial adapter, to work around this problem.

KurtEck
12-09-2017, 02:58 PM
There are a couple ways I have done it in the past:

a) Use a different board. That is why earlier I made a version of the bioloid library that could take use different serial ports and ran the code on an Arduino Mega such that I had more Serial ports available. Also used with Teensy...

b) As @jwatte mentioned, the robot commander code is only one way communications, so it does not do anything with stuff sent back to it if the code does Serial.print... So I created a quick and dirty VB app, that allows me to configure two Comm ports. One that logically connects to the commander and the other logically to the Arbotix board. All inputs from the commander are routed to go to the Arbotix board, and all inputs from the Arbotix board are displayed in a listbox as part of the program. I was going to add additional capabilities to send debug messages back, but never bothered.

I then connected it up a couple of different ways. Example I used USB XBee adapter and took XBee out of Commander for it, and then plugged the commander in to USB cable... That way no cables to Robot. But could also bypass xbees and use FTDI cable to arbotix board as well.

I believe I posted this VB app up here in some other threads, but...

KingPin
12-09-2017, 03:08 PM
Thanks! Works fine. Why didn't I think of it myself....

Very useful this!

KingPin
12-10-2017, 07:36 AM
Can't find the app either unfortunately, sounds very practical.

KurtEck
12-10-2017, 08:18 AM
I have the VB code up as part of my Phantom_Arm code base...
https://github.com/KurtE/Phantom_Arm/tree/master/VB%20Test%20App

Warning it has been awhile since I tried it out, but it worked the last time I tried it.

KingPin
12-10-2017, 08:21 AM
Nice! Thanks! I'll try and keep my finger on the powerbutton.

KingPin
12-10-2017, 08:36 AM
@KurtEck, works flawless. Very, very pratical.