Timer use in Turnigy 9XR or other

tgy9x is a fork of er9x, and is the default firmware that is released by hobbyking on the Turnigy 9XR transmitter.
Post Reply
wrenow
Posts: 27
Joined: Mon Dec 17, 2012 12:54 pm
Country: United States
Location: near Dallas, Texas

Timer use in Turnigy 9XR or other

Post by wrenow »

What I would like to do, but have, so far, been unable (and found no joy in a search).

Use a momentary, like the trainer switch, to control, say, a servo on channel 7.

On hitting the switch, I want the servo to go to 100% for about .5 sec then have the switch disabled for a period (say 7.5 sec).

In other words, on hitting the trainer switch, I want it to only be active a maximum of once every 8 sec but, when active, be "on" for about .5 to 1.0 sec. For bonus, if it is held closed, trigger for about .5 sec every 8 sec.

Alternatively, it could be active as long as I hold the switch closed, if, upon releasing it, it is disabled for the remainder of the 8 sec.

I have tried various things in the EEPE simulator, to the point I am thoroughly confused.

Any thoughts?

Thanks,

Wreno

User avatar
MikeB
9x Developer
Posts: 17993
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Timer use in Turnigy 9XR or other

Post by MikeB »

You have posted this under STOCK firmware, but are using eepe. DO you have er9x loaded?

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
wrenow
Posts: 27
Joined: Mon Dec 17, 2012 12:54 pm
Country: United States
Location: near Dallas, Texas

Re: Timer use in Turnigy 9XR or other

Post by wrenow »

That is correct - STOCK firmware, but developing under EEPE. neither er9x nor open9x loaded in the radio. Stock firmware not downloaded into EEPE, either.

I am using EEPE to simulate, then converting to the stock Turnigy 9XR by programming it in under the radio's interface.

I have not yet tried burning either er9X or open9X, as the goal is to see how far I can go on the project using the native firmware/interface (lowest common denominator for noobs), but the EEPE simulator is a lot faster to "trial and error" on and to test theoretically calculated options.

This is part of a fire control system for model warship combat. I have gotten the convergence working the way I want and am in the process of building a hardware ship emulator to make sure it works properly in the physical realm (one of 4 turrets completed and installed, 2 of 8 servos installed). I have discovered that Open9x makes a more(memory) compact solution for part, with its system of being able to adjust both X and Y on curves, but the er9x, with set of about 8 mix elements, and a couple of soft switches, and a dummy channel, does a dandy job - just tring to whittle it down while leaving understandability and simplified tweaking to allow for variances in ship configurations. But, now that the targeting control is well underway (pun intended), I am looking to add fire control restrictions.

So you can have a better idea what I am looking to do:

Under our club's rules, your rate of fire is restricted by caliber. 0.25" = once every 8 sec, 7/32" once every 6 sec., 3/16" once every 4 sec., .177 once every 2 sec.
However it takes a certain amount of time (.25 to 1.5 sec) for the pneumatic system to charge and fire. I might be able to handle this delay pneumatically or mechanically if I have to.

Add in the headache (I have not yet mentioned this possibility) that, if you arm a single barrel in a turret (say a triple), it represents all the barrels in that turret and can be fired as many times in the interval as there are barrels. So, again, say a 7/32" triple, it gets to fire 3 times in 6 seconds. It can do so be either firing all three quickly in the first second and then waiting and additional 5 seconds, or firing once every 2 seconds, or whatever - just so long as it does not fire more than 3 shots every 6 seconds.

This is not a big issue, as most turrets are set 9and only able) to fire all their guns at once.

You can see why, with many ships having 3-4 turrets, each (in a perfect world) requiring 3 channels (some can be doubled up if you have to), having 16 or more programmable outputs is a plus. Gots ta love the 9X family.

I hope that clarifies what I am trying to do and in what hardware/software.

Cheers,

Wreno

Cheers,

Wreno
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Timer use in Turnigy 9XR or other

Post by jhsa »

The 9XR stock firmware IS er9x, but is an older version..
I f you search under openTX firmware I think there was already someone configuring a model warship as well.. maybe you can find some answers..
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
wrenow
Posts: 27
Joined: Mon Dec 17, 2012 12:54 pm
Country: United States
Location: near Dallas, Texas

Re: Timer use in Turnigy 9XR or other

Post by wrenow »

Yep, I know Greg, and his fire control project takes a substantially different tack than my approach. I have not heard if he is down to timings yet, but he is trying to customize specific firmware (using trigonometry, etc) to do what I am attempting to do with the off-the-shelf stock firmware.

Also, I am aware that the stock 9XR firmware is a fork of the an earlier ER9x, which is why I am using EEPE for the simulation and brainstorming (or, perhaps, brain flatulence at times :lol: ) - pretty easy to take the listing and make the few changes necessary to enter on the radio's console (like changing which pot is which, etc., as the order/location is different on the simulator and the 9XR).

However, in trying to read about the Timer usage, I am still foggy as to whether there is a way to make it work for some or part of the task. interestingly, I got it to switch the servo to 100% and then off after a couple of seconds, but only on the first try. Subsequent flicks of the trainer switch did nothing.

More 'sperimenting in store, it seems. Any advice appreciated.

Cheers,

Wreno

ReSt
Posts: 1581
Joined: Tue Dec 27, 2011 11:34 pm
Country: -

Re: Timer use in Turnigy 9XR or other

Post by ReSt »

If you are using switches and slow up/down for one function, you must use separate channels for the switch and for the slow.

One channel that has the switch and another channel with the slow that uses the switched channel as source.

Reinhard
User avatar
MikeB
9x Developer
Posts: 17993
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Timer use in Turnigy 9XR or other

Post by MikeB »

Try this to start with:
Mixes:
CH06: +100% FULL Switch(SW4)
CH16: +100% FULL Switch(SW2) Slow(u10:d0)
Custom switches:
CS1: OR SW3 !SW2
CS2: OR TRN !SW1
CS3: v>ofs CH16 60
CS4: v<ofs CH16 -90 ANDSW CS2

CS1 and CS2 actually form a flip-flop to remember the TRN being switched for 8 seconds
The 8 seconds is timed by CH16 taking 10 secondes end to end, but CS3 switches after 8 seconds (-100 to +60)
CS4 produces the 0.5 secoond fire control.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
wrenow
Posts: 27
Joined: Mon Dec 17, 2012 12:54 pm
Country: United States
Location: near Dallas, Texas

Re: Timer use in Turnigy 9XR or other

Post by wrenow »

Thanks for the input. And, especially for the detailed mixes and explanation, Mike - need to ponder that through a bit more and perhaps flow-chart it. I was kind of drifting in that general direction, but was using delay instead of slow. I am glad to see that I may have had the right inclination. The beauty of the slow is giving the partial second increments - coolness, thanks.

Got it to "kind of" work a bit in the SW simulator, have not tried it on the hardware simulator I am building (have the dummy turret mounts ans rotation servos in, but the depression and firing cards are still under construction). So far, no real surprises in the rotation - works like the simulator with some minor latency/hysteresis issues in the cheap servos I am using, mainly on very slight master turret moves, but I kind of expected that. I am already using Channel 16 as a dummy channel for other things right now, but 15 is available.

Interestingly, in Open9X, the programming for many of these features is both more flexible and more compact, so I am now exploring.

Will let you know what I settle on.

Cheers,

Wreno
User avatar
MikeB
9x Developer
Posts: 17993
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Timer use in Turnigy 9XR or other

Post by MikeB »

Curious to know which features you find more flexible and compact.
I've kept er9x as 'standard', you get what you get. With open9x(opentx) you have to select the features you want at compile time, and not all features fit in the stock unit with the M64 processor.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
Rob Thomson
Site Admin
Posts: 4543
Joined: Tue Dec 27, 2011 11:34 am
Country: United Kingdom
Location: Albury, Guildford
Contact:

Re: Timer use in Turnigy 9XR or other

Post by Rob Thomson »

I suspect a case that he gets on with the methodology of openTX more.

I find that they are similar... But different. From the looks of people using then firmwares ; it is always. A mixed bag. People either prefer one way or the other.

Me... I like opentx. Many features are more advanced. But then.. Sometimes I miss the er9x way.

Who knows. Don't think either us really better/worse than the other. Just different :-)

Sent from my GT-I9300 using Tapatalk 2
Slope Soaring, FPV, and pretty much anything 'high tech'
...........if you think it should be in the wiki.. ask me for wiki access, then go add it!
User avatar
kaos
Posts: 3247
Joined: Wed Dec 28, 2011 1:15 am
Country: United States

Re: Timer use in Turnigy 9XR or other

Post by kaos »

yep, not too many functions one has while the other can't do. It is like dexterity, some right handed some left handed, that is how our brains are made up to start with, different. ;)
wrenow
Posts: 27
Joined: Mon Dec 17, 2012 12:54 pm
Country: United States
Location: near Dallas, Texas

Re: Timer use in Turnigy 9XR or other

Post by wrenow »

Mike,

As for the Open features I am liking: On the curves, you can adjust both X and Y if you want. Since some of mine come in 1/3's of other increments, it really helps to be able to adjust both. for instance one potential curve i would use is is -100=+33 to -33,=+67 then -32=0, +32=0, +33=-100 to +100=--67. This would need to be fine-tuned to the turret separation and traverse angles. Kind of an odd duck, but allows the bow and stern cannon to parallel each other when the target is at a location each can engage (assuming they have a 270 degree traverse range). I also figured out a cobble in ER, but t'was not quite as elegant or easy for a noob to figure.

Also, for mixes (I have done the above with mixes only as well), Open allows well over +- 125% on throw percent and offset, I believe. In ER, I can do he same thing by adding the same channel, with each line adding a portion of the total offset (say +100 and +67), but this is a step I don't believe I need in Open. Thus, it through the mixes in Open, I can cut at least a couple of lines of mix per turret.

By the way, don't get me wrong, I LOVE ER! It (with EEPE) is my go-to with the T 9XR for simulation. And I cannot thank you and the other contributors enough. As best I can tell, it is lean, mean, and tight. And I love the enforced compatibility. Just pointing out that, for some of my (probably rather unique) situations, Open may have some features that offer a simpler solution (perhaps at the expense of things I do not need).

However, at this point, I believe in lowest common denominator, and so am developing on the stock T 9XR from the on-board interface, but using EEPE as a simulator to brainstorm. I have hit no brick walls yet. My plan is to later port what I have learned into Open for those who prefer it (unless my plans changes with the impending Taranis, which may take me in a different direction.). kind of like this has taken me away from further development of stand-alone Picaxe based individual turret control subsystems within the ship (which are still a very viable option).

Interestingly, one of the guys in our club is considering taking his surplus 9X board (he now has a Gruvin brain transplant), and making a custom case for it through http://www.frontpanelexpress.com/index. ... PAodhUAAlQ to give him a more preferred control layout a la the MP8K and M*2k route.

Cheers,

Wreno
Thanks,

Wreno
User avatar
MikeB
9x Developer
Posts: 17993
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Timer use in Turnigy 9XR or other

Post by MikeB »

Having the odd curve available with both x and y values is somethnig I might add. I do try to keep the EEPROM contents compatible. Changing the whole curve structure to allow many such curves could easily upset existing users. My current idea is just to take the last two 9-point curves, probably unused by most users, and create a single x-y 9-point curve (when time permits).
I need to update eepe at the same time, and there is only me working on er9x/eepe at present.

Using extended weights can lead to other problems with arithmetic overflowing in mixer calculations, as well as needing more storage on the Mega64 of the stock boards.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
Kilrah
Posts: 11109
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: Timer use in Turnigy 9XR or other

Post by Kilrah »

wrenow wrote:However, at this point, I believe in lowest common denominator, and so am developing on the stock T 9XR from the on-board interface, but using EEPE as a simulator to brainstorm.
Your post sounds like you don't know of companion9x, equivalent of eePe for openTx, which does the same about simulation and more (simulates the radio's UI too) :)
wrenow
Posts: 27
Joined: Mon Dec 17, 2012 12:54 pm
Country: United States
Location: near Dallas, Texas

Re: Timer use in Turnigy 9XR or other

Post by wrenow »

Oh, I do know of Companion9x and have it installed alongside EEPE to play in both worlds, just happen to be devoting most of my time to EEPE/ER at the moment with occasional excursions into Companion/Open to see if/how to implement the same "function I just figured out" and to see if there are additional ways to attack the same function. I have not tried and was not aware that Companion emulated the stock 9XR hardware UI, but will look into it. Just did not want to get hitched into doing something in Cmpanion that would not be backwards compatible by accident.

Got to say that the whole Er / Open and T9XR / Taranis possibilities make amazing things, heretofore difficult or impossible, relatively trivial once you think it through and "do the maths." Part of the difficulty now is the flexibility that allows several ways to get the same results at the RX end. Lots to try and wrap my noggin around.

When I think back to the fudging it took to get a Spektrum DX6i to convert one channel to dual throw (so you could get -100, 0 AND +100 on one channel).....

Again, my thanks and admiration for all the contributors on both projects (and all the earlier firmware writes that improved on the original 9X). 'Tis a brave new world.

Cheers,

Wreno

Post Reply

Return to “tgy9xr”