Page 22 of 31 FirstFirst ... 12181920212223242526 ... LastLast
Results 211 to 220 of 302

Thread: PhantomX using a Teensy 3.1

  1. #211
    Join Date
    Jan 2008
    Location
    Norway, Stavanger
    Posts
    786
    Images
    276
    Rep Power
    71

    Re: PhantomX using a Teensy 3.1

    Good to hear from you Kurt.
    I assume the main changes you do to the phoenix code is in the control_diy-xbee file, not so much in the other files? I'm asking since I've moved 99% of the MorpHex code over to two new files in the project. So I can almost just replace the control files, just need to change some minor stuff though.
    Kåre Halvorsen aka Zenta
    ---------------------------------
    Zenta's YouTube channel
    Zenta's Blog
    Zenta's Instagram

  2. #212

    Re: PhantomX using a Teensy 3.1

    Hi Kåre,

    Yep - the changes are in that file. I just updated it on github, that it tries to read in all packets and save the last one per pass. There were some debug messages added (which should be removed once we are happy) and a one line change, which instead of doing a return once it receives a valid data packet, it goes back up to the top to see about reading in more packets...

    That appeared to get rid of the debug messages I was seeing of bad packets, timeouts, ... Probably need to do more testing. Also I have some changes for the BAP remote, that I am still debugging, which allows me to set the delta time between packets. (Or maybe I should simply repace the BAP with a teensy

    Kurt

  3. #213
    Join Date
    Jan 2008
    Location
    Norway, Stavanger
    Posts
    786
    Images
    276
    Rep Power
    71

    Re: PhantomX using a Teensy 3.1

    Hi Kurt,

    Thanks for the update. I've done some testing and I can't say saw much difference from before. Most of the time it work fine but now and then there is a visible glitch when doing body translations or rotations. I noticed that the "XBeeRecvPacket Tmeout" for every glitch. During a 5 minute test the result on the terminal was like this:
    Phoenix-Arc32 keyboard monitor D [<start addr>][<cnt>] - Dump EEPROM memory
    O - Enter Servo Offset mode
    S - DL seq(s) - VB only
    T <n> - Set or show debug Trace level
    V <n> - View Sequence
    : Idle proc init
    XBeeRecvPacket Tmeout
    XBeeRecvPacket Tmeout
    XBeeRecvPacket Tmeout
    XBeeRecvPacket Tmeout
    XBeeRecvPacket Tmeout
    XBeeRecvPacket Tmeout
    XBeeRecvPacket Tmeout
    XBeeRecvPacket Tmeout
    XBeeRecvPacket Tmeout
    XBeeRecvPacket Tmeout
    XBeeRecvPacket Tmeout
    XBeeRecvPacket Tmeout
    XBeeRecvPacket Tmeout
    XBeeRecvPacket Tmeout
    XBeeRecvPacket Tmeout
    XBeeRecvPacket Tmeout
    XBeeRecvPacket Tmeout
    XBeeRecvPacket Tmeout
    API Packet size error
    XBeeRecvPacket Tmeout
    API Packet size error
    XBeeRecvPacket Tmeout
    XBeeRecvPacket Tmeout
    XBeeRecvPacket Tmeout
    XBee Packet Timeout
    At the last "XBee Packet Timeout" the robot turned off (could also hear the melody on speaker like when you hit 0). The API packet error happens during walking only. I'v done the same test twice and it follow the same pattern, turned off after about 4-5 minutes.

    I hope this make more sense for you than me..
    Kåre Halvorsen aka Zenta
    ---------------------------------
    Zenta's YouTube channel
    Zenta's Blog
    Zenta's Instagram

  4. #214

    Re: PhantomX using a Teensy 3.1

    Hi Kurt,

    Sorry for the slightly off topic, but i'm working on a digital dashboard/data logger project for my track car using the mbed platform. I'm using DipTrace (per your recommendation, i like it) for the schematic and am starting the PCB and hope to get some PCBs made sooner or later. Knowing what you know now, do you recommend using DipTrace for the PCB Design and using Seeedstudio for the PCB fab? Were you able to get assembled/populated PCB assemblies from Seedstudio?

  5. #215

    Re: PhantomX using a Teensy 3.1

    Yes and No...

    That is some read in the function APIRecvPacket is timing out... Probably need to figure out which one and why. Probably still
    overflowing buffer and the like.

    One thing to try is to slow down the transmission of packets.

    Could try changing: DataPacketDeltaMS con 33 ; how many MS to wait between sending messages.
    in the transmitter to maybe 50 (or 20 packets per second) and see if that helps.

    Probably still need to add some more validation of packet sizes.

    Kurt

  6. #216

    Re: PhantomX using a Teensy 3.1

    Quote Originally Posted by TXBDan View Post
    Hi Kurt,

    Sorry for the slightly off topic, but i'm working on a digital dashboard/data logger project for my track car using the mbed platform. I'm using DipTrace (per your recommendation, i like it) for the schematic and am starting the PCB and hope to get some PCBs made sooner or later. Knowing what you know now, do you recommend using DipTrace for the PCB Design and using Seeedstudio for the PCB fab? Were you able to get assembled/populated PCB assemblies from Seedstudio?
    I use Diptrace for both schematic and layout. I have had good luck so farm with taking my output from Diptrace and having Seeedstudio fabricate boards for me. I have also had good luck using oshpark to fabricate recently as well. Earlier on I used PCBfabexpress to do some other boards. They also did a nice job but were higher priced then Seeeduino or Oshpark. Likewise I have also tried the ones you can order directly from Diptrace (Bay Area Circuits), which worked, but again a little more expensive.

    So far I have not tried anyone to actually assemble boards. If you can restrict your design to a specific set of parts, you can get Seeedstudio to do a few prototypes for you. I was playing around with the idea of trying this, but have not so far.

    Kurt

  7. #217
    Join Date
    Jan 2008
    Location
    Norway, Stavanger
    Posts
    786
    Images
    276
    Rep Power
    71

    Re: PhantomX using a Teensy 3.1

    Hi Kurt,
    Quote Originally Posted by KurtEck View Post
    Could try changing: DataPacketDeltaMS con 33 ; how many MS to wait between sending messages.
    in the transmitter to maybe 50 (or 20 packets per second) and see if that helps.
    I didn't get time to test this yesterday. I was struggling with getting a bluetooth connection for debugging on MorpHex. It's probably 7 years since I played with the BlueSmirf, and had forgot all about them..

    If I remember correctly one cycle takes around 50 - 60 mS when doing body rotations, when walking the cycle varies a lot due to the pause between the steps. So, in any cases the remote sends out packets faster. Especially when walking at slow speed there is a big difference. I'm just wondering if the old stuff of yours was a more reliable way?

    I'm sorry but I don't fully understand how the XBee com works. Is it so that the packets in the XBee (on the robot) just stacks up? And that is a problem? So there isn't a way to just store the last package that was sent and use that on the robot?

    I can do some testing changing the DataPacketDeltaMS on the remote to 50, I'm just afraid the problem will occur when walking slowly then?

    When using Teensy this wasn't a problem at all? If so, a solution for me is to simply upload the old and new software on the remote when I'm playing with BAP or Teensy.

    Another solution, would it be possible to make the program on the remote to support both protocol methods? Maybe hold a button on the remote at startup if we want the old/new protocol? Just an idea..

    Sorry for all the Q's..
    Kåre Halvorsen aka Zenta
    ---------------------------------
    Zenta's YouTube channel
    Zenta's Blog
    Zenta's Instagram

  8. #218

    Re: PhantomX using a Teensy 3.1

    Hi Kåre,

    Lots of possibilities. Taking a bit more time than I was planning on :lol:

    Yep - earlier I added the extra handshaking to avoid issues like this, but of course it came with a cost, which was all of the time of the handshaking... Could still continue with that or a variation of it.

    Right now, I am playing with an approach that when we are walking and the like, after we compute everything for the next step, we currently delay (pause) until the next commit. With the stuff I am playing with, instead of a simple pause, as an option I instead loop calling off to the function that reads in the XBee data, as to not allow them to stack up. Problem is I put in what logically I think should work, and it is hanging up. So added some debug messages to see what is going on:
    Currently looks like:
    Code:
       IF (GaitPeak > 2)  or Walking THEN ; Walking, sync required
          Walking = (GaitPeak > 2)      ; This make sure the last walking cycle to be synced
           ;Get endtime and calculate wait time
          GOSUB GetCurrentTime[], lTimerEnd   
          GOSUB ConvertTimeMS[lTimerEnd-lTimerStart], CycleTime
    #ifdef BACKGROUND_CHECK_INPUT
          if (PrevSSCTime > CycleTime) then 
            WHILE ((PrevSSCTime > CycleTime) and ((PrevSSCTime - CycleTime) > BACKGROUND_CHECK_INPUT))
              hserout 1, ["BCI ", dec PrevSSCTime, " > ", dec CycleTime, "(", dec lTimerEnd, "-", dec lTimerStart,")", 13]
              GOSUB ControlBackgroundInput    ; Read in any pending inputs as to not overflow queues
              pause 5;    // sleep at least a little...    
              GOSUB GetCurrentTime[], lTimerEnd   
              GOSUB ConvertTimeMS[lTimerEnd-lTimerStart], CycleTime
            WEND
            hserout 1, ["BCI Exit loop", 13]
          endif
    #endif
           ;Wait for previous commands to be completed while walking
          if (PrevSSCTime > CycleTime) then 
              pause (PrevSSCTime - CycleTime) ;   Min 1 ensures that there alway is a value in the pause command  
          endif     
       ENDIF
    Here is a snapshot showing the output, with a problem:
    Code:
    BCI Exit loop
    BCI 200 > 52(27267-27140)
    BCI 200 > 61(27291-27140)
    BCI 200 > 70(27313-27140)
    BCI 200 > 77(27330-27140)
    BCI 200 > 87(27353-27140)
    BCI 200 > 94(27370-27140)
    BCI 200 > 101(27387-27140)
    BCI 200 > 3(27148-27140)
    BCI 200 > 10(27165-27140)
    BCI 200 > 19(27188-27140)
    BCI 200 > 26(27204-27140)
    BCI 200 > 33(27221-27140)
    BCI 200 > 40(27238-27140)
    BCI 200 > 47(27255-27140)
    BCI 200 > 56(27278-27140)
    BCI 200 > 63(27295-27140)
    BCI 200 > 70(27311-27140)
    BCI 200 > 77(27328-27140)
    BCI 200 > 84(27346-27140)
    BCI 200 > 93(27368-27140)
    BCI 200 > 100(27385-27140)
    BCI 200 > 2(27146-27140)
    BCI 200 > 9(27162-27140)
    BCI 200 > 16(27180-27140)
    BCI 200 > 25(27202-27140)
    BCI 200 > 32(27219-27140)
    BCI 200 > 39(27236-27140)
    BCI 200 > 46(27253-27140)
    BCI 200 > 53(27270-27140)
    BCI 200 > 63(27294-27140)
    BCI 200 > 70(27311-27140)
    BCI 200 > 76(27327-27140)
    It looks like there is an issue with my old GetCurrentTime function and/or the interrupt handler associated with the timer and/or someplace the timer interrupt is turned off... As I said I am rusty with this stuff, but should be able to figure it out.

    Note: Although I will probably not do much more on Baps, debugging this will probably influence some of the work I do on the Arduino side as well to minimize overrunning buffers. Soon I will test this stuff again on the Linux side, but probably not an issue as I use a thread to read the XBee data as it comes in. On Teensy, may do like I mention for Arduino and/or could use a scheduler task that automatically takes care of this for me...

    Now back to debugging the timer

  9. #219

    Re: PhantomX using a Teensy 3.1

    Update: found one issue where the timer interrupt was disabled and not reenabled, which was causing the above issue.

    I put in some more places where was sleeping to call off to the input... Not sure if %100 there yet, but hopefully better.

    Updated github so you can take a look

  10. #220
    Join Date
    Jan 2008
    Location
    Norway, Stavanger
    Posts
    786
    Images
    276
    Rep Power
    71

    Thumbs up Re: PhantomX using a Teensy 3.1

    Thanks Kurt,

    I'm not sure if it matter, but FYI I'm testing the code on a Phoenix with ARC-32 only, not with SSC-32. I still get the same issues as yesterday. Short moment after trying to walk I got the "XBee Packet Timeout" at the end and it turned off.

    XBeeRecvPacket Timeout(65535,12,27163)XBeeRecvPacket Timeout(65535,12,31290)
    XBeeRecvPacket Timeout(65535,12,39952)
    XBeeRecvPacket Timeout(65535,12,44382)
    XBeeRecvPacket Timeout(65535,12,48720)
    XBeeRecvPacket Timeout(65535,10,53062)
    XBeeRecvPacket Timeout(65535,12,58557)
    XBeeRecvPacket Timeout(65535,10,66451)
    XBeeRecvPacket Timeout(65535,12,70708)
    XBeeRecvPacket Timeout(65535,8,74709)
    XBeeRecvPacket Timeout(65535,12,78703)
    XBeeRecvPacket Timeout(65535,12,82689)
    XBeeRecvPacket Timeout(65535,12,86451)
    XBeeRecvPacket Timeout(65535,12,101113)
    XBeeRecvPacket Timeout(65535,12,109884)
    XBeeRecvPacket Timeout(65535,12,116731)
    API Packet size error: 44160
    XBeeRecvPacket Timeout(65535,12,132261)
    XBeeRecvPacket Timeout(65535,12,143140)
    XBeeRecvPacket Timeout(65535,19,149766)
    XBeeRecvPacket Timeout(65535,12,155836)
    XBeeRecvPacket Timeout(65535,8,159811)
    XBeeRecvPacket Timeout(65535,12,166014)
    XBeeRecvPacket Timeout(65535,12,167530)
    XBeeRecvPacket Timeout(65535,12,168181)
    XBeeRecvPacket Timeout(65535,12,168832)
    XBee Packet Timeout

    At the moment I don't think we should spend more time on it Kurt. After all, my BAP robots work ok with the old protocol. I think its better if you spend time on making it work with a PhantomX with Teensy instead. If your new protocol seem to work flawless with the Teensy I could simply try to merge the two DIY remote codes into one and like I suggested just hold a button at startup for selection old/new protocol?

    Oh Wait! I just forgot to test your suggestion of changing the DataPacketDeltaMS to 50..

    Lol, that did the trick! I still get a lot of timeout while waking and some packet size error, but they are not visible. But the most important part is that it didn't turn off anymore. And I didn't get (almost) any timeouts during body translation and rotations anymore. Great!

    Did a 5 minute test without any glitches. I'll start testing this on my MorpHex with ARC-32 + SSC-32 at first to see how it work. I'm not sure if I get time for it this evening. My wife deserve some attention in the late evenings too...

    Thanks Kurt!
    Kåre Halvorsen aka Zenta
    ---------------------------------
    Zenta's YouTube channel
    Zenta's Blog
    Zenta's Instagram

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. PhantomX Hexapod Kit
    By SuperMiguel in forum Projects For Request and/or Sale
    Replies: 12
    Last Post: 12-29-2013, 09:36 PM
  2. Question(s) PhantomX AX Quadruped Mark II PhantomX Robot Turret Equipped??
    By hwan we in forum Robotics General Discussion
    Replies: 1
    Last Post: 03-11-2013, 02:09 PM
  3. Question(s) PhantomX Drawings?
    By phil0stine in forum Humanoids, Walkers & Crawlers
    Replies: 2
    Last Post: 01-03-2013, 02:09 PM
  4. For learning: PhantomX Hexapod vs PhantomX Quadruped
    By Leugim in forum Humanoids, Walkers & Crawlers
    Replies: 4
    Last Post: 10-26-2012, 08:50 AM
  5. My PhantomX Hexapod
    By Gilrock in forum Humanoids, Walkers & Crawlers
    Replies: 0
    Last Post: 09-26-2012, 02:23 PM

Posting Permissions

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