Havoc Heli remote: need some help decoding the signal
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):
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
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
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
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
To be perfectly honest, it's a whole lot easier looking for patterns in HEX or BINARY.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
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 ----------
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
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
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
They are incredibly cool and fun to fly.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
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?
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
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Truly Understand the Fundamentals and the Path will be so much easier...
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.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
A complex design is the sign of an inferior designer. - Jamie Hyneman, Myth Buster
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