Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 34

Thread: Mech Warfare Scoring Transponder 2017

  1. #11

    Re: Mech Warfare Scoring Transponder 2017

    I was able to get it to build for UNO

    I simply copied the TimerOne library directory from the Teensy location and put it under the Arduino directory.

    i.e. copy d:\arduino-1.8.1\hardware\teensy\avr\libraries\TimerOne
    to d:\arduino-1.8.1\hardware\Arduino\avr\libraries\TimerOne

    Then built it...

  2. #12

    Re: Mech Warfare Scoring Transponder 2017

    I simply copied the TimerOne library directory from the Teensy location and put it under the Arduino directory.
    Okay, that makes my stomach squirm. That's not how package management is supposed to work ...
    That being said, using a timer isn't that hard, and writing the function needed right on top of the AVR timer registers would be pretty simple.

  3. #13

    Re: Mech Warfare Scoring Transponder 2017

    Or you can simply install the library from Paul's (PJRC) github project: https://github.com/PaulStoffregen/TimerOne
    And put it into the standard Arduino location: <your sketch directories>/libraries/TimerOne

  4. #14

    Re: Mech Warfare Scoring Transponder 2017

    And put it into the standard Arduino location
    Yes. That is the part that is ix-nay from a project management point of view.
    Modifying a stock installation is never a good thing, and should be avoided if at all possible.

    Why is that so? When I do that, I suddenly run a "forked" version of the Arduino IDE.
    I might accidentally use the library in some other project, without realizing, and then when I publish it, other people won't know what to do.

    A better option would be to create a new separate library called "TimerOne" that I put in my user-supplied Arduino libraries.
    Or, even better, copy "TimerOne.h" into the project directory of the firmware. That'a allowed by the license at the head of that file.
    (It also needs a copy of TimerOne.cpp I think.)

  5. #15

    Re: Mech Warfare Scoring Transponder 2017

    Quote Originally Posted by Gertlex View Post
    Thanks for the update!

    I'm using an older one... and I don't have the Arduino environment set up (lol). Any chance I can get a .hex file I can just dump onto it?

    Edit: This is a silly big ask since it assumes you'd have the chance to build specifically for any slight variations the older board I have has. That's asking too much, perhaps. Sorry!
    I don't mind building you a Hex file, I'll give you the Hex file output from the Arduino IDE. You can just load it with the AVR ISP. Did you have the original 2013 version of the transponder?

    I'll build the hex file version for the original 2013 transponder and throw it onto the Github.

    In terms of the libraries needed for the transponder, just download and throw the following libraries into the Arduino user libraries folder. If you want to load the new transponder sketches to your transponder, download the following libraries:
    https://github.com/PaulStoffregen/TimerOne
    https://github.com/GreyGnome/PinChangeInt

    Just FYI, I converted the original transponder firmware here to arduino sketches for our transponders.
    https://github.com/MechWarfare/mwsco...onder/firmware

    Our versions of the transponder use the Arduino bootloader and a FTDI cable to program. I felt it would make it easier for more people to work on the transponder if the code was written and loaded with Arduino IDE.

  6. #16

    Re: Mech Warfare Scoring Transponder 2017

    Pull request incoming :-)

  7. #17

    Re: Mech Warfare Scoring Transponder 2017

    Quote Originally Posted by Brooks View Post
    I see the XBee in the photo. Having read somewhere about the high RF environment at the games, what's the best RF interface to use these days?
    I don't think we've found out yet what's the best interface to use with the RoboGame's RF environment. The best thing we found that can do is go to 5.8 GHz analog video for your video link. In our club we're currently experimenting with 900 MHz and XBee Pros for control.

    The scoring system this year will still use XBEE S1. The way we're going to mitigate RF issues is store the HP of the Mech on the transponder itself. In previous years, it would only report hits to the scoring computer. If we have RF issues during RoboGames, the transponder will still keep track of the HP and eventually report the right HP to the scoring computer. The new transponder code will also light up the LED board as soon as the mech hits 0 HP if all RF communications fail on the transponder side.

  8. #18
    Join Date
    Jul 2012
    Location
    Richmond, IN
    Posts
    644
    Rep Power
    32

    Re: Mech Warfare Scoring Transponder 2017

    Good idea.That way even if the main pc has crap data, the bots will still keep the good.

    I suggest adding a known header and a checksum to the packet setup. For simple clearing of the damaged packets so as not to rely on the transponders getting it right 100% of the time.

  9. #19

    Re: Mech Warfare Scoring Transponder 2017

    I suggest adding a known header and a checksum to the packet setup.
    First, there already is a known header in the protocol (you can read it in the github repo!)
    There isn't a checksum, but the Xbee underlying protocol uses checksums (CRCs, actually) already.
    It's very unlikely that something would be corrupted and the Xbee wouldn't catch that.

    Second, the protocol decode could conceivably be more robust.
    Specifically, I can imagine this bit going wrong:

    Code:
      if (Serial.available() > 0) {
        Serial.readBytes(receive,5);
        if(receive[0] == 0x55) {
    ...
    Spefically, this doesn't re-sync if there's a byte lost anywhere. It will block in readBytes() forever.
    Also, if there's some junk bytes (line noise, old UART data, etc) then it will never sync up, because it's out of sync, and each packet is exactly 5 bytes.
    A better way might be something like:

    Code:
      if (Serial.available()) {
        unsigned char ch = Serial.read();
        if (ch == 0x55) {
          Serial.readBytes(&receive[1], 4);
    ...
    This will discard bytes until it gets a 0x55, which is start-of-packet.
    It's still not perfect -- reading two bytes and verifying that they complement to 0xff, and if not, moving back to looking for a 0x55, would make it even more robust.
    And, of course, reading "whatever is there" into a buffer with an end-write-pointer, and only actually looking at the buffer once there are 5+ bytes, would be most robust.

    However, the Xbees actually let you frame the on-air packets, by setting the options correctly (short send timeout, packet min size 5 bytes, in this case,) which will work around most of those problems. Making the "read one byte, then four" change probably still makes sense, though.

  10. #20
    Join Date
    Jun 2011
    Location
    USA
    Posts
    510
    Images
    107
    Rep Power
    33

    Re: Mech Warfare Scoring Transponder 2017

    How are we setting the ID of the individual transponders? I was under the impression that the 2013 ones were tweaked by hand for this. Or do the xbees have a unique serial that we were just checking?

    I don't mind building you a Hex file, I'll give you the Hex file output from the Arduino IDE. You can just load it with the AVR ISP. Did you have the original 2013 version of the transponder?

    I'll build the hex file version for the original 2013 transponder and throw it onto the Github.
    That would be great! Thanks! Yup. AFAIK it's an original 2012 transponder (they were only made that one year I think?) shown in this thread: http://forums.trossenrobotics.com/sh...-Ordering-Info.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. 2017 Robogames Mech Warfare Attendance Survey
    By GhengisDhon in forum Mech Warfare
    Replies: 21
    Last Post: 04-19-2017, 11:06 PM
  2. Robogames 2017 Mech Warfare Ruleset
    By giantflaw in forum Mech Warfare
    Replies: 34
    Last Post: 03-25-2017, 02:43 PM
  3. Sizing and hole patterns for the scoring transponder?
    By sonepoxy2015 in forum Mech Warfare
    Replies: 2
    Last Post: 06-25-2015, 12:55 AM
  4. Replies: 0
    Last Post: 01-29-2013, 07:46 PM
  5. Mech Warfare MWScore Scoring System
    By Upgrayd in forum Mech Warfare
    Replies: 16
    Last Post: 01-28-2013, 11:25 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •