Society of Robots - Robot Forum
Electronics => Electronics => Topic started by: madsci1016 on January 16, 2010, 12:40:20 PM
-
I have been trying to interface my custom motor controller with my Axon. Basically, whenever the Axon sends a motor command, the controller responds back with sensor data (distance traveled, battery voltage and current).
I spent hours trying to figure out why I was getting garbage, The controller could 'hear' the Axon fine, but i was getting back garbage from it.
I wrote this
while (temp_b = uart3GetByte(), temp_b != -1)
{
process[motor_index++] = temp_b;
}
//check data
if (motor_index == 8 && process[0] == 'S' && process[7] == '*')
{
good++;
done = 1;
}
else
bad++;
To tell me if the received message matched what it was suppose to get. (Header, footer, and length)
The results showed that i was getting around 50% bad messages.
Then I changed nothing else, except moving the plug to another Uart header (Uart 2) and changed the code to match the new uart. PRESTO! 0% bad messages. Then I tried Uart 1 (I removed the USB chip and have a regular header) and got 2% bad messages.
Why would Uart 3 behave so badly, with nothing else changed?
-
Seeing how your usb chip was bad, have you ever considered that your axon chip might be defective?
It's a bit uncommon, but so is a 50% error rate difference on the identical devices.
-
you haven't shorted the uart 3? or damaged one of the traces or connectors?
-
physically it looks fine. At this point i think my Axon is just a lemon,
smashed power LED on delivery,
USB gave out for no reason
and now a Uart is misbehaving
I don't remember what company i directly bought the Axon from, but i'm gonna stick to direct from SOR from now on, and i have an Axon 2 on the way.
-
Hope you remember, as it sounds like a serious "heads up" thing for people trying to buy the axon from somewhere else.
-
Is everybody ready to laugh at me? It's been one of those days.
So, this method
while (temp_b = uart3GetByte(), temp_b != -1)
{
process[motor_index++] = temp_b;
}
works great, EXCEPT when the data byte from the Uart is 11111110, otherwise know as -1, when the compiler thinks it's a signed char.
So my motor controller was passing two byte unsigned ints, like 00011100 11111110 , the Least significant byte was tricking the while loop into thinking the uart receive buffer was empty, when it really wasn't. This made it look like a bad message. It was just coincidence it coordinated with me trying different Uarts.
So, this
while (!uartReceiveBufferIsEmpty(MOTOR_COM))
works 100% on all uarts.
good grief.
-
Good that you solved the problem.
USB gave out for no reason
Did you use the 3.3V output at all, for anything? Two other people have reported frying their USB by hooking up stuff that shouldn't go there.
-
I used it once to power my Venus GPS, but that was 5 months ago. Nothing has touched those pins since.
-
Hmmm perhaps an accidental short? I guess no way to know . . .
-
Usually a UART problem is bad frequency calibration problem (check clocks etc etc etc)
And a GPS draws a lot of current for than 50mA for sure...
If I remember right that USB thingy can only give out 30mA... So, it may have been the reason.....
-
And a GPS draws a lot of current for than 50mA for sure...
If I remember right that USB thingy can only give out 30mA... So, it may have been the reason.....
The Venus, power wise, will work fine on the Axon 3.3V output.
It cannot supply more than about 73mA, or 90mA if you aren't using USB.
-
The only thing i can tell you is it was not a discrete, one day it worked, one day it didn't. There was a few hours where it would work on one computer but not another, and it would take a few tries. It was more of a slowly burning out.
I still get a steady 3.3V from that pin header.
-
Oooopsss... memory error, sorry Admin...
Have you tried to reflow your axon... Most electronics boards may have some flaws over time
but with a good rework it should be fine. Only thing you need is some hot air...
And it's a common tool at repairing shops
-
It sounds like a chip just slowly failing on its own. A whole host of possible reasons why . . .
It was reflowed on.
-
LOL.
Well, if it was fixable by reflow, it isn't now. I cut the traces to the chip and glued on my own uart pinheader.
I also got my Axon2 in the mail. Haven't decided if i want to replace the modified Axon 1, as it works, and now gives me 4 uarts on board. I might give my Axon2 the same treatment.
I thought i remember reading the Axon2 was gonna have the upgrade to the 640, the 2460 or something, the same thing but more memory. I must be going crazy.
-
Well, if it was fixable by reflow, it isn't now. I cut the traces to the chip and glued on my own uart pinheader.
Yeap, you just reflow a $5 USB chip on it to replace the bad one, and you're set to go :P
(but too late now, lol . . . easy, assuming you have l337 solder skills and/or a reflow oven)
I also got my Axon2 in the mail. Haven't decided if i want to replace the modified Axon 1, as it works, and now gives me 4 uarts on board. I might give my Axon2 the same treatment.
Nothing wrong with a software UART. You can also stack both Axons and have them communicate/work together - have one Axon process all the UART data and send the final result by UART to the other Axon.
[/quote]
I thought i remember reading the Axon2 was gonna have the upgrade to the 640, the 2460 or something, the same thing but more memory. I must be going crazy.
Not a single person has reported using up all the 640 memory. I'd be shocked if anyone does! My ERP has managed only 61% usage, and 24% RAM usage, tops.