Shop OBEX P1 Docs P2 Docs Learn Events
Havoc Heli remote: need some help decoding the signal — Parallax Forums

Havoc Heli remote: need some help decoding the signal

WhelzornWhelzorn Posts: 256
edited 2007-08-28 21:33 in General Discussion
So I'm sure you've seen these things on TV. Its a little tiny RC helicopter for $30, and it's probably the single coolest thing I've purchased in a while. Anyway it uses infrared instead of radio, so I thought it might be an interesting challenge to try and figure out the controller's signals.
So this is what I've got so far: I plugged a 38khz IR receiver into a stamp, pushed the throttle all the way up, and measured the amount of time the sensor's output goes high and low.
the signal looks like this (the remote sends the signal continuously, so I posted 4 samples):
----------
12695
1988
466
783
453
782
457
1302
----------
12697
1987
462
787
452
778
461
1302
----------
12701
1988
462
783
457
779
460
1298
----------
12705
1990
466
783
457
778
457
1302
----------




so with the throttle all the way up:
the sensor stays high (sees no IR) for 12700ish microseconds and then theres a
~2000us pulse,
~450us delay,
~780us pulse,
~450us delay(again),
~780 pulse(again),
~450us delay(third one),
and then a ~1300us pulse.
At this point it starts over with another ~12700ish delay.

The only difference in moving the throttle lower or using the left/right thumb stick is that the ~12700us delay goes down to as low as a 7300us(no left/right, throttle down all the way) or as high as 15000us (throttle maxed, thumb stick all the way to the left).

So I'm sorta stuck at this point. Wheres all the data? can everything be transmitted through that one first delay, and the rest of it's just for identification?
anyone who's got some sort of idea would be really helpful. Thanks!

[noparse][[/noparse]edit] you know, on second thought, is there any easy way to view the output of that sensor without an oscilloscope (just using the BS2 and some other software) I want to see what the signal looks like, I think I measured something wrong.

Post Edited (Whelzorn) : 8/25/2007 6:54:25 PM GMT

Comments

  • WhelzornWhelzorn Posts: 256
    edited 2007-08-25 20:53
    Ok, so it turns out I had the baud waaaay to low for debug. So after turning it up to 115200 (and using a faster stamp) the data turns out to be more useful. Go figure.
    so here it is (3 samples):
    ----------
    DELAY:170765
    PULSE:2022
    DELAY:383
    PULSE:1328
    DELAY:173
    PULSE:693
    DELAY:437
    PULSE:683
    DELAY:440
    PULSE:677
    DELAY:449
    PULSE:670
    DELAY:461
    PULSE:659
    DELAY:452
    PULSE:709
    ----------
    DELAY:170796
    PULSE:2023
    DELAY:384
    PULSE:1328
    DELAY:155
    PULSE:711
    DELAY:437
    PULSE:683
    DELAY:441
    PULSE:678
    DELAY:448
    PULSE:670
    DELAY:460
    PULSE:660
    DELAY:452
    PULSE:708
    ----------
    DELAY:170709
    PULSE:2022
    DELAY:385
    PULSE:1327
    DELAY:172
    PULSE:693
    DELAY:437
    PULSE:683
    DELAY:440
    PULSE:678
    DELAY:449
    PULSE:669
    DELAY:460
    PULSE:660
    DELAY:452
    PULSE:708
    ----------
    



    Thats what it looks like when you turn the remote on, no sticks moved, nothing.
    heres full throttle only:
    ----------
    DELAY:173097
    PULSE:2014
    DELAY:388
    PULSE:1323
    DELAY:156
    PULSE:703
    DELAY:1003
    PULSE:1220
    DELAY:1012
    PULSE:666
    DELAY:460
    PULSE:660
    DELAY:463
    PULSE:657
    DELAY:1003
    PULSE:1206
    ----------
    DELAY:173088
    PULSE:2014
    DELAY:385
    PULSE:1323
    DELAY:157
    PULSE:707
    DELAY:1003
    PULSE:1224
    DELAY:1011
    PULSE:666
    DELAY:458
    PULSE:660
    DELAY:459
    PULSE:661
    DELAY:1003
    PULSE:1205
    ----------
    DELAY:173099
    PULSE:2013
    DELAY:392
    PULSE:1325
    DELAY:157
    PULSE:709
    DELAY:1004
    PULSE:1224
    DELAY:1015
    PULSE:666
    DELAY:455
    PULSE:664
    DELAY:463
    PULSE:657
    DELAY:1003
    PULSE:1205
    ----------
    



    can anyone see a pattern yet? if it would be helpful to have samples from other scenarios, just ask and I'll get them. I have no experience in analyzing signals, so this is a little over my head
    Thanks again
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2007-08-25 21:10
    Whelzorn -

    If you would be willing to re-run the test, displaying the output in HEX, I'd be happy to take a futher look at it. I only use decimal numbers for balancing my checkbook smile.gif

    To be perfectly honest, it's a whole lot easier looking for patterns in HEX or BINARY.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • WhelzornWhelzorn Posts: 256
    edited 2007-08-25 21:36
    Alright, heres the hex output. These are new numbers too, so I didn't just convert the old decimal values to hex. Remember that everything is in microseconds

    turned on, no sticks moved
    ----------
    DELAY:29A1D
    PULSE:7DC
    DELAY:1CF
    PULSE:53F
    DELAY:127
    PULSE:2C1
    DELAY:1AA
    PULSE:2AE
    DELAY:1B1
    PULSE:2AE
    DELAY:1BA
    PULSE:2A1
    DELAY:1C2
    PULSE:29C
    DELAY:1BF
    PULSE:2C6
    ----------
    DELAY:29A70
    PULSE:7DB
    DELAY:1CD
    PULSE:53A
    DELAY:129
    PULSE:2C1
    DELAY:1B0
    PULSE:2B3
    DELAY:1B1
    PULSE:2AA
    DELAY:1B6
    PULSE:2A3
    DELAY:1CA
    PULSE:299
    DELAY:1BF
    PULSE:2C5
    ----------
    DELAY:29A60
    PULSE:7D3
    DELAY:1CD
    PULSE:542
    DELAY:129
    PULSE:2BF
    DELAY:1AE
    PULSE:2C2
    DELAY:1B3
    PULSE:2A9
    DELAY:1B8
    PULSE:2A3
    DELAY:1BC
    PULSE:29A
    DELAY:1BF
    PULSE:2C6
    ----------
    
    full-throttle
    ----------
    DELAY:2A57B
    PULSE:800
    DELAY:1BA
    PULSE:530
    DELAY:136
    PULSE:2C3
    DELAY:3D8
    PULSE:4DB
    DELAY:3E7
    PULSE:2AE
    DELAY:1B6
    PULSE:2AA
    DELAY:1C9
    PULSE:299
    DELAY:3E8
    PULSE:4B8
    ----------
    DELAY:2A58A
    PULSE:802
    DELAY:1BF
    PULSE:52F
    DELAY:13B
    PULSE:2C6
    DELAY:3D8
    PULSE:4DC
    DELAY:3E7
    PULSE:2AE
    DELAY:1B3
    PULSE:2AD
    DELAY:1BB
    PULSE:2A5
    DELAY:3E8
    PULSE:4B5
    ----------
    DELAY:2A58A
    PULSE:7DF
    DELAY:1BE
    PULSE:52B
    DELAY:13E
    PULSE:2C3
    DELAY:3D9
    PULSE:4D8
    DELAY:3E7
    PULSE:2B2
    DELAY:1B6
    PULSE:2A9
    DELAY:1CC
    PULSE:294
    DELAY:3E9
    PULSE:4B8
    ----------
    
  • DufferDuffer Posts: 374
    edited 2007-08-25 22:39
    whelzorn,

    Take a look at the IR Remote kit for the Boe-Bot http://www.parallax.com/detail.asp?product_id=28139

    In·the "Downloads" section on that page is a User Manual and a ZIP file with the source code for a BUNCH of little BS2 programs (from the ·User Manual) that will help you decode just about any IR remote command protocol and a good learning tool on how IR remotes work.

    What you're seeing is what you would expect. Wait pulse, then an 8 part pulse train, then repeat. The wait pulse tells you that the remote is about to send a command, the pulse train then needs to be decoded into a hex byte (the manual above explains how to do it). The resultant code(s) then get mapped to the controller that you're using (if I press this button, I get this command). For proportional controlls like throttle and steering, you just have to work out the Min, Max and step values.

    Steve

    Post Edited (Duffer) : 8/25/2007 10:49:31 PM GMT
  • WhelzornWhelzorn Posts: 256
    edited 2007-08-26 02:30
    Wow, thank you! this should definitely get me off to a good start. My end target is to be able to use the keyboard to send the signals instead of the remote (essentially cloning it's functionality). I'll keep everyone posted on my progress.
  • ZootZoot Posts: 2,227
    edited 2007-08-26 16:54
    Here is a link that might prove useful. Also, remember that the Havoc (Picooz) Helis send their channel info also (A/B/C) in the IR transmission.

    www.rcgroups.com/forums/showthread.php?t=671147&page=5

    And here is an excerpt from the gent's code that looks like it has times for his (home-brew) controller. Not sure what scale these are at for PWM, but it should give you a good start (you might also think about contacting the author for tips).

    ; Channel option.  Uncomment the channel you wish to use then recompile
    
     .equ    ChannelID = 0b00000000    ; Channel A
    ;.equ    ChannelID = 0b00100000    ; Channel B
    ;.equ    ChannelID = 0b01000000    ; Channel C
    
    
     .equ    TrimNoPress     = 0b00000000
     .equ    TrimRPress        = 0b00000001
     .equ    TrimLPress        = 0b00000011
    
     .equ    MaxRXBits         = 0x14
     .equ    TrimStep        = 0x04
     .equ    NumTrims        = 0x08
    
     .equ    RXTimeOutVal    = 0x10 
     .equ    TrimTimeOutVal    = 0xA0
    
     .equ    Start0PulseMinLength     = 75
     .equ    Start0PulseMaxLength     = 82
    
     .equ    Start1PulseMinLength     = 36
     .equ    Start1PulseMaxLength     = 43
    
     .equ    Start2PulseMinLength     = 54
     .equ    Start2PulseMaxLength     = 61
    
     .equ    ZeroPulseMinLength         = 31
     .equ    OnePulseMaxLength         = 75
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST
  • Ol' GeoOl' Geo Posts: 30
    edited 2007-08-27 04:27
    Whelzorn,

    Warning: It is off topic.

    You mentioned earlier in your post: "Its a little tiny RC helicopter for $30." Would you be kind to tell me (or us, if interested) what it is and where it sells. I just started a new hobby in Helicopters in additional to my Robotics hobby. Is it called Heli-robotics hobby?

    Thanks a bunch.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Ol' Geo
    Retired Software Engineer

    An oscilloscope is a window of unseen electronic world. - GM
  • ZootZoot Posts: 2,227
    edited 2007-08-27 16:12
    www.toysrus.com/product/index.jsp?productId=2486857

    They are incredibly cool and fun to fly.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST
  • WhelzornWhelzorn Posts: 256
    edited 2007-08-27 21:34
    Yeah you can get theses things at Toys R Us, Kay-Bee, and any other toy store. There are a few different models by the same mfg. (Air Hogs). Some have forward/reverse thrust (this one doesnt) for only $60.
    I also managed to figure out the way this thing works, *almost* completely. It sends binary 0's as ~670us pulses, and binary 1's as ~1225us pulses (as far as I can tell). Each bit is seperated by a ~460us delay, and theres a ~173000us delay in between each set of data (each set contains 21 bits) The first 6 bits indicate the channel, the next 4 are the throttle power (binary 0-14 [noparse][[/noparse]15 doesn't do anything]), and then theres 4 0's, followed by 6 bits that seem to affect the tail rotor. Then the last bit is always a 1.

    So a sample of the data output looks like this (in binary):
    001100 0000 0000 000000 1 - this is no sticks moved (spaces are just for clarification)
    001100 1110 0000 000110 1 - full throttle
    001100 1110 0000 101110 1 - full throttle, tail rotor left
    001100 1110 0000 011000 1 - full throttle, tail rotor right

    still a bit unclear about the tail rotor info, maybe some of it has to do with trim?
  • ZootZoot Posts: 2,227
    edited 2007-08-28 16:02
    Somebody said...
    still a bit unclear about the tail rotor info, maybe some of it has to do with trim?

    It may. The thing I am not clear on with the trim is this -- when you input trim, does the CONTROLLER take care of adding/subtracting the trim value to the tail rotor speed sent, or is the trim data sent the heli. I'm guessing the former, so you may not see trim info actually show up in the IR pulses.

    Have you tried searching and/or posting at the RC Havoc Heli forum threads? It seems like some folks there have dissected this in great detail.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST
  • Tom WalkerTom Walker Posts: 509
    edited 2007-08-28 16:04
    www.thinkgeek.com has many cool toys...including helicopters

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Truly Understand the Fundamentals and the Path will be so much easier...
  • stephenwagnerstephenwagner Posts: 147
    edited 2007-08-28 16:16
    Whelzorn,

    Take a look at the·Parallax link http://www.parallax.com/html_pages/resources/custapps/app_irrepeater.asp.
    There is much information you can learn from my BS2 code.

    Stephen

    By the way, there is no $30.00 2-axis substitute for a $2000.00 5-6 axis remote helicopter.
  • WhelzornWhelzorn Posts: 256
    edited 2007-08-28 18:26
    Zoot: no, I had no idea anyone else had tried this yet, to be honest. But I should definitely go take a look! And yes, you were correct. Those 4 0's after the throttle are where the trim data goes. It gets sent to the helicopter, and the helicopter stores the value and takes care of the rest. The last 6 bits (before the 1) need to be at certain values for the rotor to even turn on at some levels, so that part needs more analysis. Maybe that forum you mentioned can help me out.
  • DgswanerDgswaner Posts: 795
    edited 2007-08-28 20:10
    I was thinking about putting a bs1 onboard one of those, as to make it autonomous. do you think it can carry the weight required to operate a bs1? I was going to look for a large Cap. or a smaller battery specific for the project. I know the flight time would be short but the charge time is short also.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    A complex design is the sign of an inferior designer. - Jamie Hyneman, Myth Buster
  • ZootZoot Posts: 2,227
    edited 2007-08-28 21:33
    Dgswaner -- I thought about a scenario like that when I picked up my Picooz. Only way would be to completely remove existing board and use a surface mount controller (e.g. sx). Then how would you program it?

    At the Picooz forums a lot of folks seem to have experimented with different batteries, without much luck.

    I think it's probably doable with a different battery and a surface mount controller, but you'd have to redo it from the ground up, and include two tiny, tiny motor amp circuits as well (fortunately each motor only has to turn in a single direction, but still). And then there's the problem of adding the weight of *any* kind of sensors. If you're interested, there are some good threads at the RC forums about getting more efficiency/power out of the Picooz -- that translates to more flying time vs. weight. Getting the most bang for weight vs. flight time might be a good place to start, then see how much extra weight you can pack it and still fly.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST
Sign In or Register to comment.