HobbyKing.com New Products Flash Sale
Reply
Thread Tools
Old Apr 20, 2010, 09:13 AM
Registered User
Germany
Joined Mar 2007
200 Posts
Coaxial IR protocol (SH, Syma, etc...)

Hi,
has anybody ever tried to analyse the IR protocol used by SanHuan? I hooked up my oscilloscope to the transmitter and as far as I found out it should not be too difficult to reprogram the IR protocol in a PC. What I found out so far:

carrier frequency: 38.17kHz
constant length, package-to-package 159ms
(all timings in µs)
header: 3360 pulse, 1040 space
one (or zero): 724 pulse, 320 space (=1044, ratio: 2/3 to 1/3)
zero (or one): 320 pulse, 724 space (=1044, ratio: 1/3 to 2/3)
length: 33 bits

It should be possible to create a configuration file for lirc and send commands to the helicopter via the serial port. Would be cool to fly with a joystick on a PC!

Darkstar.
Darkstar2000 is offline Find More Posts by Darkstar2000
Last edited by Darkstar2000; May 26, 2010 at 04:49 AM.
Reply With Quote
Sign up now
to remove ads between posts
Old Apr 20, 2010, 03:19 PM
Registered User
Ceros007's Avatar
Montreal, Québec, Canada
Joined Apr 2010
1,447 Posts
I'll do it... one day.

Fly with a joystick and a wireless security camera attached to the helicopter. It would be like an army mini-coax UAV, but without guns

But I don't have tools like oscilloscope. But I know how to program. Actually i'm a Software Engineer Student.
Ceros007 is offline Find More Posts by Ceros007
Reply With Quote
Old Apr 20, 2010, 04:44 PM
Registered User
Joined Mar 2010
61 Posts
If you're a software engineer student (like me), you have access to your campus labs, just ask the proper teacher
hallucynogenyc is offline Find More Posts by hallucynogenyc
Reply With Quote
Old Apr 20, 2010, 05:16 PM
Registered User
Ceros007's Avatar
Montreal, Québec, Canada
Joined Apr 2010
1,447 Posts
Lol. Ok i Should have said i dont have the tool like : time!
Anyway, first thing first, I don't have my first heli yet!

Well i guess that i just found my big final project!
Ceros007 is offline Find More Posts by Ceros007
Reply With Quote
Old Apr 22, 2010, 07:11 AM
Registered User
Germany
Joined Mar 2007
200 Posts
Short Update:
It looks like there are 32 bit sent each package and the last pulse seems to be a stop code. First 8 bit are for throttle, but also the last 8 change, so not straight forward. Next 8 bit are for rudder and elevator straight forward: 4bits each most significant first. Middle position means all bits unset and direction is coded somewhere else. Surprise: the trim is coded in the stream! For the next bits I have to dig a little bit further.

Darkstar.
Darkstar2000 is offline Find More Posts by Darkstar2000
Reply With Quote
Old Apr 22, 2010, 07:33 AM
Registered User
Ceros007's Avatar
Montreal, Québec, Canada
Joined Apr 2010
1,447 Posts
Nice. Keep on the work. Would be awesome fly control it via PC.
Ceros007 is offline Find More Posts by Ceros007
Reply With Quote
Old Apr 22, 2010, 09:20 AM
Registered User
Germany
Joined Mar 2007
200 Posts
Ok, you software engineers. Here is something for you. I recorded the bits and attached three files:
1. Throttle moving, everything else constant
2. Full throttle and trim moving
3. Medium throttle and trim moving

As you can see byte one and four is changing when the throttle changes. But when the trim changes in byte three byte four is also changing! So find the connection.

Darkstar.
Darkstar2000 is offline Find More Posts by Darkstar2000
Reply With Quote
Old Apr 22, 2010, 10:30 AM
Registered User
Germany
Joined Mar 2007
200 Posts
More news. Here is one example:

Code:
01110010 00000000 11000000 11000001
byte,bit explanation
1,1 fix (always zero)
1,2...8 throttle
2,1...4 rudder
2,5...8 elevator
3,1 1=left rudder, 0=right rudder
3,2 1=nose up, 0=nose down
3,3 1=trim left, 0=trim right
3,4...8 trim
4,1...2 channel: 11=A, 10=B, 01=C
4,3...8 checksum

Big question is now: how to calculate the checksum????? It's your turn software engineers!

Darkstar.
Darkstar2000 is offline Find More Posts by Darkstar2000
Reply With Quote
Old Apr 22, 2010, 11:06 AM
I'm FAMOUS
Joined Mar 2010
5,105 Posts
Whoa.

Keep this up!
Subbed, in a big way.
killbucket is offline Find More Posts by killbucket
RCG Plus Member
Old Apr 22, 2010, 02:43 PM
North East England
Joined Feb 2004
3,138 Posts
Well, I understand little of this but I find it fascinating; we move a stick and the model responds - but how many of us actually know why?

Yet another reason to appreciate the expertise and technology that goes into our models.
Redbaron25 is offline Find More Posts by Redbaron25
Reply With Quote
Old Apr 22, 2010, 03:13 PM
Registered User
Ceros007's Avatar
Montreal, Québec, Canada
Joined Apr 2010
1,447 Posts
Quote:
Originally Posted by Darkstar2000 View Post
Big question is now: how to calculate the checksum????? It's your turn software engineers!
Ahaha... I don't know!
Ceros007 is offline Find More Posts by Ceros007
Reply With Quote
Old Apr 22, 2010, 04:37 PM
I'm FAMOUS
Joined Mar 2010
5,105 Posts
emailed my nephew

He's a Navy Nuke, who worked at Microsoft. Eats code for breakfast.
killbucket is offline Find More Posts by killbucket
RCG Plus Member
Old Apr 23, 2010, 06:18 AM
Registered User
Germany
Joined Mar 2007
200 Posts
Ok, from the first look into the data with some collegues it looks like the checksum is a simple addition: if one value raises 1 bit, the checksum does the same. So it should be not too complicated to find the right algorithm.

Darkstar.
Darkstar2000 is offline Find More Posts by Darkstar2000
Reply With Quote
Old Apr 23, 2010, 07:09 AM
Registered User
Germany
Joined Mar 2007
200 Posts
Ok, I am coming nearer: it looks like the checksum is the addition of the first three bytes plus 15 (1111):
Code:
01110010 00000000 11000000 11000001

   01110010  (0x72)
   00000000  (0x00)
   11000000  (0xC0)
   00001111  (0x0F) +
--------------------------
 0101000001  (0x141)
last 6 bit: 000001
It seems to be correct, but I will have to confirm this.

Darkstar.
Darkstar2000 is offline Find More Posts by Darkstar2000
Reply With Quote
Old Apr 23, 2010, 07:29 AM
Registered User
Ceros007's Avatar
Montreal, Québec, Canada
Joined Apr 2010
1,447 Posts
Hey darkstar, were are you from? What university?
Ceros007 is offline Find More Posts by Ceros007
Reply With Quote
Reply

Castle Creations      DRIVE / FLY / SUPPORT  

Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Discussion FrSky 2.4ghz - Telemetry protocol discussions PLMS Radios 1370 Apr 24, 2013 12:58 AM
Discussion SanHuan 6023 or Syma S107 ? Tuc Coaxial Helicopters 20 Mar 21, 2010 09:15 AM
New Product New larger SanHuan coax w/ gyro rich95 Coaxial Helicopters 0 Oct 21, 2009 04:34 PM
Sold Scorpion IR Receiver and IR Remote Control - $10 shipped dswitkin Aircraft - Electric - Power Systems (FS/W) 2 Aug 30, 2009 09:20 PM
For Sale CHEAP - Miniature Helicopter (Sanhuan) $15 Shipped ropuri Aircraft - Electric - Helis (FS/W) 1 Jan 31, 2007 03:00 PM