RoboJackets / robocup-software

Georgia Tech RoboJackets Software for the RoboCup Small Size League
Apache License 2.0
183 stars 187 forks source link

Radio doesn't work with six robots #7

Closed justbuchanan closed 10 years ago

justbuchanan commented 10 years ago

After messing around with six robots several times, it seem like it's always the robot on the field with the highest shell number that loses communication.

Because robots only send packets back to the computer after they've received packets, it's possible that the issue is on the transmitting side. If one robot on the field is not sent a packet, it will not send packets back to the computer and show up in soccer with a 'No Rx' message. Maybe the packet sent from soccer to the bots is being truncated so that the last bot doesn't receive anything. If so, this may be an issue in the firmware for the transmitter.

justbuchanan commented 10 years ago

It may have to do with this line here: https://github.com/RoboJackets/robocup-software/blob/master/firmware/base_2011/device.c#L37

I'll try changing it to a 64 next time I'm in the shop to see if it fixes the issue.

ehuang3 commented 10 years ago

@justbuchanan It's possible that there are multiple points of failure which cause the 6 comm bug.

I'll add to the series of observations:

justbuchanan commented 10 years ago

Also, see the comment here: https://github.com/RoboJackets/robocup-software/blob/master/firmware/base_2011/device.c#L506-507

This seems to indicate that the 32 bit issue pointed out above may be even more relevant.

ehuang3 commented 10 years ago

I spoke to Ben, to this effect:

There a communication protocol lower than the Rx/Tx command protocol.

The radio channel is half-duplex and the timing is strictly pre-arranged. The robots send in the order of their slots in the forward packet. This may explain why the failures start from the highest ID. Our soccer control loop run at 60 Hz; therefore, there may not be enough time between forward packets to send all 6 reverse packets.

I suggest running the control loop at a lower frequency first and seeing if all 6 packets start to show up. Ben suggested directly testing radio signals using a spectrum analyzer (an EE's job). Using the analyzer we would be able to see the transmission protocol.

Other notes:

justbuchanan commented 10 years ago

In the soccer program, the radio packets are sent once each time the Processor runloop iterates. I tried halving the rate (60Hz -> 30Hz) the Processor runs at by changing the number on this line, but the issue stayed the same.

This makes me think it's lower-level than soccer, probably something in the USB radio base station.

Also, I tried using lower shell numbers on the field and it does seem to always be the robot with the highest shell number that loses radio. In my case it was shell number 7, so I can confirm that it isn't just shell numbers above 8 that fail.

ehuang3 commented 10 years ago

Just to anticipate future f's,

There is 3ms per slot for reverse traffic. With 6 slots, that's 18ms. A forward packet arrives every 16.7ms.

justbuchanan commented 10 years ago

Hmmm... does that mean that it shouldn't be working right now?

ehuang3 commented 10 years ago

No, just putting that there for posterity.