"Flip" button on Syma X1/WLToys v949

er9x is the best known firmware. It has a superb range of features and is well supported by the community. Well worth trying out.
akkuschrauber
Posts: 57
Joined: Wed Sep 12, 2012 5:06 pm
Country: -
Location: Dortmund
Contact:

Re: "Flip" button on Syma X1/WLToys v949

Post by akkuschrauber »

blackmoon wrote:One more question,

The bind button works like other modules ?

i.e. push while powering on the transmitter ?

Because this can be a pita,

(It is the same with the wltoys V939, biding each time you change battery is really annoying, because you don't have much time to do it. I stoped using my V939 because of having to try the bind 5 times in a row before being fast enough to achieve it.)

If this the right behavior, why not implement the following (if feasible) :

Ditch the bind button and auto bind at power up like the rtf toys transmitters do it.
You only need to bind on first use with your th9x.
Maybe you did it the wrong way ?

Try this for proper binding:
Power on the Model (v939), then push and hold the bind button on your 9x while powering on.
Wait a few secs and watch the led on Model (v939) til it goes from blinking to solid.
Power off your Model first, then your 9X ! Really important !

After that, if you want to fly your v939, power your TX FIRST, second your Model !
Your binding should then working and no more every flight binding procedure ...
That's the way we get with such spektrum models/tx ... no matter how secure or insecure such proceder is or how we did it before 2.4 GHz.
On powering, FIRST TX then Model, after flight FIRST Model then TX, thats the rule :D

Like on other TX / RX combinations,
first power tx, second Model on you want to fly,
and after flight, first Model off, second TX, to prevent damage etc. .

Did you tried that ?
Ironie: read [Wikipedia.de] http://de.wikipedia.org/wiki/Sarkasmus

User avatar
Daryoon
Posts: 60
Joined: Sun Jan 08, 2012 5:07 pm
Country: -
Location: http://www.hacksmods.com
Contact:

Re: "Flip" button on Syma X1/WLToys v949

Post by Daryoon »

Some receiver like the v939, yellow v911 clones, require putting the T9x into binding mode each and everytime. It's a known behavior.

The original v911, v929, v949 only needs to be bound once.

My observation is the TX does know when the RX has bound/reconnected to it without waiting the full 10secs or whatever the actual time period is.
User avatar
blackmoon
Posts: 40
Joined: Wed Jun 13, 2012 7:49 pm
Country: -
Location: Belgium

Re: "Flip" button on Syma X1/WLToys v949

Post by blackmoon »

Wltoys V929 only needs one binding, then it will connect every time you switch his battery no need to bind again.

Wltoys V939 needs to bind every time you switch his battery.

So does the Hubsan X4 at least with his rtf transmitter and with my devo10 from where this code is taken, you have to hit the "bind button" on the interface to re-bind each time you switch battery.

Did you only bound your X4 with your 9X one time ?

And it reconnected each time you switched batteries ?

I always follow the power RX first then TX - shut off RX then TX when I bind a model.

Then each subsequent it is a reconnect, I power TX first then RX.

Daryoon beat me to it :D
Power on the Model (v939), then push and hold the bind button on your 9x while powering on.
Wait a few secs and watch the led on Model (v939) til it goes from blinking to solid.
Power off your Model first, then your 9X ! Really important !
This is almost impossible to achieve each time with the V939, at least for me, the bind window is really short, I have to do it time and time again, it takes me maybe five tries to achieve a successful bind.

It is why a shelved it, was really fed with that...
th9xer
9x Developer
Posts: 167
Joined: Fri Jan 20, 2012 11:09 pm
Country: -
Location: Beside the seaside

Re: "Flip" button on Syma X1/WLToys v949

Post by th9xer »

The code for the FlySky protocol has it entering bind mode for a set period if the bind button is pressed at power up (or if the variable Model.fixed_id isn't set, I am guessing this is a menu option in deviation, it isn't used in my project), there is no back talking from the receiver, and it exits bind mode after this set period regardless of the bind button. So shorting the bind button would make it enter bind mode at every switch on for a set period. I have no idea if extending this period would work, if you want to try it alter the line in flysky_a7105.c that says:
#define BIND_COUNT 2500
make 2500 a higher value.

The Hubsan protocol enters bind mode every time, regardless of anything. The Rx does talk back.
User avatar
blackmoon
Posts: 40
Joined: Wed Jun 13, 2012 7:49 pm
Country: -
Location: Belgium

Re: "Flip" button on Syma X1/WLToys v949

Post by blackmoon »

Thank you for the reply Cameron.

So you can achieve an "auto-bind" for the two protocols, I didn't know that the hubsan protocols enters bind mode at each power on.

I think I'll put a normally closed switch inline with the module's power so I can cycle it without cycling the transmitter.

This is really cool, my V939 will have a second life after all. :D

akkuschrauber
Posts: 57
Joined: Wed Sep 12, 2012 5:06 pm
Country: -
Location: Dortmund
Contact:

Re: "Flip" button on Syma X1/WLToys v949

Post by akkuschrauber »

blackmoon wrote: Did you only bound your X4 with your 9X one time ?

And it reconnected each time you switched batteries ?
Yes, only one time.
Binding was:
Hubsan on, th9x with bind button pressed on, wait a little, then the hubsan leds blinks fast and stay on.
After that, release the bind button.
Now power off the Hubsan, then power off the TX.
(The bind button has to be pushed and keep pressed before powering the tx !)

Flying:
Power the TH9x, then the Hubsan.
Ready for flight :D

If you need to "recalibrate" the Hubsan (like on original transmitter without display), then you need to set up your mixer menu in tx to "emulate" the original flight modes, and with advanced mode, you can do it like on stock tx in mode 2, THR/RUD stick do down/right, AIL/ELE stick left right left til the hubsan leds starts to flicker (3 or 4 times), ready calibrated.

Here's my setup:

General Model Settings:
Name: Hubsan_X4
Timer: 05:00, THs Count Up
Protocol: PPM: 8 Channels, 300msec Delay
Pulse Polarity: NEG

Mixers:
CH01 -100%AIL Switch(ID2)
R -75%AIL Switch(ID1)
R -40%AIL Switch(ID0)
CH02 +100%ELE Switch(ID2)
R +75%ELE Switch(ID1)
R +40%ELE Switch(ID0)
CH03 +100%THR
R -100%HALF Switch(SWC)
CH04 -100%RUD Switch(ID2)
R -75%RUD Switch(ID1)
R -40%RUD Switch(ID0)
....
CH14 +100%CH14
R -100%HALF Switch(SWB)
R +100%HALF Switch(THR)
....

Custom Switches:
...
SW11 THR < -99
SW12 CH14 > 0

That's all, no magic behind :D
My TX Module is based on r14 of th9xer schematics and code.

Hope that helps ...
Ironie: read [Wikipedia.de] http://de.wikipedia.org/wiki/Sarkasmus
User avatar
blackmoon
Posts: 40
Joined: Wed Jun 13, 2012 7:49 pm
Country: -
Location: Belgium

Re: "Flip" button on Syma X1/WLToys v949

Post by blackmoon »

akkuschrauber wrote:
If you need to "recalibrate" the Hubsan (like on original transmitter without display), then you need to set up your mixer menu in tx to "emulate" the original flight modes, and with advanced mode, you can do it like on stock tx in mode 2, THR/RUD stick do down/right, AIL/ELE stick left right left til the hubsan leds starts to flicker (3 or 4 times), ready calibrated.

This I knew, I do it like that on my DEVO10

That's all, no magic behind :D
My TX Module is based on r14 of th9xer schematics and code.

This is interesting, I only have R16 and R17, and have not had time to test it yet, stuck on doing my module with pro mini and family matters.

Could you post R14 so we can test it, I don't know which revision Kilrah as tested but it seems R17 doesn't work for him and so for another fellow on RCG.

Thank you.


Hope that helps ...
My pro mini module (I'm a noob a this pcb design stuff, so if something is odd say so :D) :
HubsanX4.jpg
HubsanX4_1.jpg
Attachments
HubsanX4_ProMini_no_LC_board.JPG
User avatar
Kilrah
Posts: 11108
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: "Flip" button on Syma X1/WLToys v949

Post by Kilrah »

OK, akkuschrauber (WTF? ;) ) sent me an archive with all the design files, setup and firmware files he's using (I understand the hex files in there are r14).

I'll post my results here then, as it might interest others.
After bricking an arduino nano (seems it IS possible... by flashing it having forgotten to put the target power jumper on the usbasp), I took a new one and flashed his hex and recommended fuse settings.

Result is... just the same. The X4 binds happily, but no control. Still didn't get time to hook the logic analyzer to the module pins.
akkuschrauber
Posts: 57
Joined: Wed Sep 12, 2012 5:06 pm
Country: -
Location: Dortmund
Contact:

Re: "Flip" button on Syma X1/WLToys v949

Post by akkuschrauber »

Kilrah wrote:OK, akkuschrauber (WTF? ;) )
Akkuschrauber:
http://commons.wikimedia.org/wiki/File: ... volts).jpg
+
http://commons.wikimedia.org/wiki/File: ... zieher.jpg
=
http://commons.wikimedia.org/wiki/File: ... 309309.jpg
Kilrah wrote:OK, akkuschrauber (WTF? ;) ) sent me an archive with all the design files, setup and firmware files he's using (I understand the hex files in there are r14).
Yes, there are all files in to build a working module for our th9x.
Watch my schematics, I talked with th9xer, in r14 you don't need the connection between rx and PBx (don't got the number in head).
There are also model settings for er9x and openTx in and two pdf's with the settings as readable file.

I think really, there are no magic in, but you must use 16MHz clock with 5V on your avr (arduino/selfduino/whatever ATMega328 board) and for SPI lines you need the level convertor, because this Mega runs too slow on 8MHz / on 3.3V ...
Look at the pictures in my archive, no special pieces of hardware, all ripped off anywhere else, and then my nicely build veroboard :D
No failures in transmitted data, works out of the box here ...
There also pictures in with my breadboard and an arduino pro mini (16MHz/5V), tested with th9xer r14 code and worked without problems.
Ironie: read [Wikipedia.de] http://de.wikipedia.org/wiki/Sarkasmus
User avatar
Kilrah
Posts: 11108
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: "Flip" button on Syma X1/WLToys v949

Post by Kilrah »

OK, got it. My RF module is the culprit.
I actually DO have control... as long as the X4 is within 5cm of the TX module.
Not very helpful to me unfortunately, but at least that rules out the firmware. I at least happen to have another module already on the way, but that won't cut it for this weekend's meet, will have to do with the toy radio.
User avatar
Kilrah
Posts: 11108
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: "Flip" button on Syma X1/WLToys v949

Post by Kilrah »

Yay, progress. Opened the module, looked at the circuit and chip. It happens that this module (for which there is no doc) has a TXEN pin to enable the PA chip, that has no pull up/down resistor, so just floating if you don't take care of it.
Once tied high I get a nice 16dBm out with r14, which should be more than enough to throw the X4 way further than needed.
Interestingly while this module is being linked in the Deviation documentation there's no mention of having to do something to that TXEN pin - the only thing is (unsurprisingly) that people report much less than the module's advertised 500m range.
Methinks there will be some feedback to give.

As a side note r17 sends out -6dBm with PA enabled, so that would match Cam's comment of not setting the TX power to max.

Now to scavenge a 9X module to throw that in for the weekend...
User avatar
blackmoon
Posts: 40
Joined: Wed Jun 13, 2012 7:49 pm
Country: -
Location: Belgium

Re: "Flip" button on Syma X1/WLToys v949

Post by blackmoon »

Ok nice troubleshooting, which revision do you recommend then 14, 16 or 17 ?

Especially when using the Xl7105-sy module with integrated antenna.

Specs call for :Transmit output power 0 dBm @ room temperature

Better this from the datasheet :

3 Transmitter Part
3.1 Tx data rate 25 250 500 Kbps
3.2 Frequency range 2400 2483.5 MHz
3.3 Output power ‐10 0 1 dBm

Thx.
User avatar
Kilrah
Posts: 11108
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: "Flip" button on Syma X1/WLToys v949

Post by Kilrah »

Well I only tested r14 supplied by akkuschrauber (that nick will always make me laugh) and my current svn checkout (r17). My spectrum analyzer showed that r17 sent much lower power. Didn't have time to try intermediate revisions as it was my last chance to get it to work before I leave tomorrow, and I had to remove the programming headers to fit the stuff in a JR module case.
So based on this as your chip is low power in the first place I'd recommend r14 as you wouldn't want it to send with even lower power. I'm attaching the hex file I used.

I flashed it to an arduino nano using an usbasp and the following avrdude commands (overwriting the bootloader):

Code: Select all

avrdude -c usbasp -p m328p -U lfuse:w:0xFF:m -U hfuse:w:0xDA:m -U efuse:w:0x05:m
avrdude -c usbasp -p m328p -U flash:w:ppm2spi.hex:i
Attachments
ppm2spi.hex
ppm2spi r14 for Hubsan X4
(12.95 KiB) Downloaded 392 times
User avatar
blackmoon
Posts: 40
Joined: Wed Jun 13, 2012 7:49 pm
Country: -
Location: Belgium

Re: "Flip" button on Syma X1/WLToys v949

Post by blackmoon »

Thank you for the hex.
th9xer
9x Developer
Posts: 167
Joined: Fri Jan 20, 2012 11:09 pm
Country: -
Location: Beside the seaside

Re: "Flip" button on Syma X1/WLToys v949

Post by th9xer »

OK, a few big changes.

The project is now using hardware SPI instead of bit banging it, so anyone that has already built it you will need to change your circuit to work with the new code, sorry !

Transmit power is set to 100mW, nearly flat out.

Also combined all protocols into one hex.
At power up channel 8 is scanned:
* If it is LOW (1000us (+-10us)) normal Flysky modulation is used and the RED LED is lit.
* If channel 8 is NEUTRAL (1500us (+-10us)) Flysky modulation with quadcopter mods is used and the YELLOW LED is lit. With these mods enabled channels 5,6,and 7 take on extra rolls, LEDs, flips, camera, etc. Be careful the various mods on the Flysky protocol can cause unexpected motor starts if you get the wrong one. Ask me how I found out :) see flysky_a7105.c line 172 for more details. As you will see a couple of the options toggle bits in the throttle channel.
* If channel 8 is high (2000us (+-10us)) Hubsan modulation is used and the GREEN LED is lit.
* Changing channel 8 after power up does not alter the modulation.

Added another LED (orange) to show when binding is taking place and finished.

PCB and schematic updated. Need to sleep on the PCB design for a night before I commit to copper.

PCB design now has sockets for AliExpress 500m module and the one I ripped from my JP Twister quad Tx.

Think that's it.

Cam.
Attachments
ppm2spi_jp.png
ppm2spi_ali.png
Hman545
Posts: 33
Joined: Tue May 07, 2013 10:34 am
Country: -

Re: "Flip" button on Syma X1/WLToys v949

Post by Hman545 »

Ordered a Hubsan x4 the other day, haven't got it yet but wanted to be able to use it with my 9x. After some searching I found this thread! I don't code so all the software talk is another language to me. But I can solder quite well, so please put me in the waiting list for a PCB when its finished :) .
When can we expect the schematic and BOM?

Thanks

Herman.
User avatar
JohnEdwa
Posts: 16
Joined: Wed Jul 25, 2012 9:45 pm
Country: -

Re: "Flip" button on Syma X1/WLToys v949

Post by JohnEdwa »

I just realized that this could actually be much more useful project than previously thought!

The original FlySky FS-TM002 module requires AETR channel order, and fits to a JR module slot.
For example, people who use Spectrum radios don't have JR module slots, and even if they connect one through the trainer port (AnyLink style), the channel order is completely wrong and cannot be changed from the radio.

This project already has to read, decode and modify the PPM signal.
Shouldn't be too hard to change the channel order as well, right ?

So, I suggest one addition to the project: a switch, solder pads you could bridge, or just a change in the code, that would change the input PPM order.
What it would be changed to could be modified in the code, but the switch could just change between the normal order (Which is actually the Futaba order with reversed throttle), and a custom one you could set in code.
The HiSKY HT8 module has this feature, as it toggles between Futaba, JR and Walkera channel order.

That way, this module could be used by the spectrum and other people that have radios without a JR module slot as well.
If there is space on the PCB, you could add the AnyLink compatible connector as well. (Standard male header connector).
th9xer
9x Developer
Posts: 167
Joined: Fri Jan 20, 2012 11:09 pm
Country: -
Location: Beside the seaside

Re: "Flip" button on Syma X1/WLToys v949

Post by th9xer »

Will do Hman545.

JohnEdwa, what you suggest is possible. Can I ask what sort of signal is on the signal pin of the AnyLink system ? 5v push-pull, open collector, etc. ?

Cam.
User avatar
JohnEdwa
Posts: 16
Joined: Wed Jul 25, 2012 9:45 pm
Country: -

Re: "Flip" button on Syma X1/WLToys v949

Post by JohnEdwa »

th9xer wrote:Will do Hman545.

JohnEdwa, what you suggest is possible. Can I ask what sort of signal is on the signal pin of the AnyLink system ? 5v push-pull, open collector, etc. ?

Cam.
Traner port outputs PPM, and I think it is the same for every manucfacturer.
Too tired to explain, have a picture.

http://i.imgur.com/E8JvyGo.jpg
Hman545
Posts: 33
Joined: Tue May 07, 2013 10:34 am
Country: -

Re: "Flip" button on Syma X1/WLToys v949

Post by Hman545 »

Tried to open the .brd and .sch files with Eagle but no luck, what software do I need?
May be a stupid question but whats the reason for not using an Arduino? Which would be easier to solder.
User avatar
Kilrah
Posts: 11108
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: "Flip" button on Syma X1/WLToys v949

Post by Kilrah »

You can use an arduino, no problem. Cam is just trying to also make a nice and neat module that perfectly fits in an empty module case :)
User avatar
Kilrah
Posts: 11108
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: "Flip" button on Syma X1/WLToys v949

Post by Kilrah »

th9xer wrote:PCB design now has sockets for AliExpress 500m module
Awesome!
Just one thing, if you could replace that "small holes" module-radio connector with a decent open one it would be great. Might be hard to source it though.
It's often a huge pain to get the pins to align with the "normal" pin-strip connectors. The other day when I made my module I started using a flysky module backboard, and I spent 20 mins trying to insert it when some of the radio pins would always hit the ridge, and all of them would never hit exactly in the holes at the same time. I gave up and ended up using the case/board of my defective Orange module (that has the right connector with larger holes), which fit in instantly.
Attachments
DSC08783_ss.jpg
DSC08783_ss.jpg (89.79 KiB) Viewed 19989 times
th9xer
9x Developer
Posts: 167
Joined: Fri Jan 20, 2012 11:09 pm
Country: -
Location: Beside the seaside

Re: "Flip" button on Syma X1/WLToys v949

Post by th9xer »

JohnEdwa wrote: Traner port outputs PPM, and I think it is the same for every manucfacturer.
Too tired to explain, have a picture.
http://i.imgur.com/E8JvyGo.jpg
Sorry thought the AnyLink leads were more complicated then they actually are. It was late :?
I'll add the request in.
Hman545 wrote:Tried to open the .brd and .sch files with Eagle but no luck, what software do I need?
May be a stupid question but what's the reason for not using an Arduino? Which would be easier to solder.

KiCad http://www.kicad-pcb.org/display/KICAD/Download+Kicad

Kilrah is dead right on the neatness front.
Kilrah wrote:Just one thing, if you could replace that "small holes" module-radio connector with a decent open one it would be great. Might be hard to source it though.
I would love to use one of those nice connectors, they were my first choice, but your dead right they are a nightmare to source. I'll have another look though.

Cam.
th9xer
9x Developer
Posts: 167
Joined: Fri Jan 20, 2012 11:09 pm
Country: -
Location: Beside the seaside

Re: "Flip" button on Syma X1/WLToys v949

Post by th9xer »

Kilrah - Apparently I didn't look right last time. See here http://uk.farnell.com/molex/38-00-1395/ ... dp/9732349 datasheet linked to gives a better picture. I'll order some up for a look see.

Cam.
User avatar
Kilrah
Posts: 11108
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: "Flip" button on Syma X1/WLToys v949

Post by Kilrah »

Woohoo :D
Great, just remember to have large holes in the PCB :)
th9xer
9x Developer
Posts: 167
Joined: Fri Jan 20, 2012 11:09 pm
Country: -
Location: Beside the seaside

Re: "Flip" button on Syma X1/WLToys v949

Post by th9xer »

Right, good point. Will do.
User avatar
Kilrah
Posts: 11108
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: "Flip" button on Syma X1/WLToys v949

Post by Kilrah »

Just checked on 2 different modules I have, they're 2mm.
Hman545
Posts: 33
Joined: Tue May 07, 2013 10:34 am
Country: -

Re: "Flip" button on Syma X1/WLToys v949

Post by Hman545 »

Sorry for all these questions, im relatively new to electronics.

1. I already have a Atmega328-PU, can I use that or do I need the Atmega328-A?
2. Im only using this for my Hubsan X4 and no other quad, so can I omit the Bind Button and Led?
3. Will 33uF 35v electrolytic caps be ok for the both reg inputs?
4. Are all the 100nF and 18nF caps Ceramic Disk type?

Thanks! :)
th9xer
9x Developer
Posts: 167
Joined: Fri Jan 20, 2012 11:09 pm
Country: -
Location: Beside the seaside

Re: "Flip" button on Syma X1/WLToys v949

Post by th9xer »

1. Yes, you may have to re-compile the code though, can't remember the exact differences between the two processors.
2. Yes, probably wise to fix the modulation to Hubsan in the code. Easiest way is to alter line 107 in ppm2spi.c to say

Code: Select all

chtemp = 10000;
3. Yes.
4. They are whatever I have to hand :) so yes.
akkuschrauber
Posts: 57
Joined: Wed Sep 12, 2012 5:06 pm
Country: -
Location: Dortmund
Contact:

Re: "Flip" button on Syma X1/WLToys v949

Post by akkuschrauber »

Hman545 wrote:Sorry for all these questions, im relatively new to electronics.

1. I already have a Atmega328-PU, can I use that or do I need the Atmega328-A?
Thats the same, just less power consumption.
I use it on my veroboard module with r14 of the code, you could see it on page 3 of this thread.
Hman545 wrote: 2. Im only using this for my Hubsan X4 and no other quad, so can I omit the Bind Button and Led?
In r14 of the code I left the Led's, there's no need of them, but in the new one you will need it.
You just need the Bind Button only one time for first bind process, so it is possible to use some kind of jumper, but you could integrate it easy, watch my first version of Cam's great work on page 3.

Oh man, I need to rework my veroboard version, to use the new code, because I got all 3 scenario here.
Some Models with FlySky RX, one WL-Toys v949 and my wife's Hubsan X4 girlycopter :D
Ironie: read [Wikipedia.de] http://de.wikipedia.org/wiki/Sarkasmus

Post Reply

Return to “er9x”