ERSKY9X Coding

erskyTx runs on many radios and upgrade boards
ersky9x was a port of er9x for use on the sky9x board.
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: ERSKY9X Coding

Post by jhsa »

MikeB wrote: Wed Apr 05, 2017 10:56 pm Then there are the latch, f-flop, timers and monostables. Should these include the delay option? Is it meaningful if they do?
Latch and f-flop yes. Timers and monostables I don't think so, as they are already time based.
Perhaps we just need a new logical switch function of "Delay". This would take a switch and a time as parameters and so provide the delay when needed.
It could be an option, although implementing the delay on every switch would be the perfect solution, and a much cleaner one for the user. It is more intuitive to have a delay on the switch itself than having to create another switch with only the delay and a switch.

Voice alerts do include a delay option.

Mike.

Exactly, and all voice alerts have their own delay. :)

João
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

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

Re: ERSKY9X Coding

Post by MikeB »

I'm not sure about the F-Flop. One use for these is to have a switch that toggles each time it is "clocked". To do this, the 'data' input is the complement of the switch output. If you add a delay, then I don't think it is guaranteed to work properly.

As it is, adding a delay on all logical switches (but not including it on some functions) requires the existing method to be re-written and has significant complications when switches reference other switches, and also requires an extra parameter to be added to every logical switch with all the extra code to display and edit it, noting that there is no space currently on the display for this.
Adding a new logical switch function of delay, is relatively easy, fits with the current methods of processing and also fits with the existing editing screen.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: ERSKY9X Coding

Post by jhsa »

We could try that, But then what about if you use the delay function on a LS that has a timer as function?
So, just that we understand, to cascade LS's with delay, we would need to crate a delay for each switch, right? That would mean an extra LS for each delay??

What do you think about the "Range" idea?

Thank you

João
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
elral
Posts: 8
Joined: Fri Mar 24, 2017 7:59 am
Country: -

Re: ERSKY9X Coding

Post by elral »

MikeB wrote: Wed Apr 05, 2017 1:18 pm What radio? If you have a MENU button, then a short press enables editing mode (option highlight flashing), then the encoder changes the value.
This problem occurs because of the "shortcut" to the DR/EXPO screen for the case the source is a stick. If the source isn't a stick, the the encoder button works to allow editing. I'll see if I can improve this operation.
It's ARuni Board, no Menu Button. But as I have the 7way Button I can change it with <Left> / <Right>. Maybe the next Transmitter will get only a rotary encoder.

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

Re: ERSKY9X Coding

Post by MikeB »

I hope to post a new test version later today with an improvement in it.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

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

Re: ERSKY9X Coding

Post by MikeB »

jhsa wrote: Wed Apr 05, 2017 11:40 pmWe could try that, But then what about if you use the delay function on a LS that has a timer as function?
So, just that we understand, to cascade LS's with delay, we would need to crate a delay for each switch, right? That would mean an extra LS for each delay??

What do you think about the "Range" idea?
The timer will work as before, just you get another LS output that switches on "delay time" later if the timer is still on.
Yes, you would need another timer for each delay you require. What I currently have no feeling for is how many switches anyone might want with a delay added.

The range idea may well be useful, but will need another parameter to be made available, along with the display/editing problems to be solved. I'm just wondering if the AND switch option should become an extra parameter instead, with options as to it's function (e.g. AND, range parameter 2, delay).

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: ERSKY9X Coding

Post by jhsa »

Mike, if you remove the AND switch than all will be as it was before you added it. You will need extra switches anyway. So I think that is a no no.
All the changes I am talking about are exactly to reduce the number of switches and channels used and simplify the programming. If we need to still add more switches, then We can throw the idea in the bin as it is not worth it. I wonder how openTX team solved the delay problem. I think they have it on every logical switch? I need to check that as soon as I get home. I think I have seen it but I could be wrong..

Thanks

João
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
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: ERSKY9X Coding

Post by jhsa »

I was right :) OpenTX has the delay on every switch. And one thing I have noticed, it also has a dedicated edit screen for the logical switches. Very nice indeed, didn't know about this.. That makes it easy to edit, powerful, and perhaps also easier to add more functionality if some comes along in the future..
I really didn't know about this when I suggested the features. It only proves that it is a good idea to make it all more powerful and simple to work with. :)

Here is a little video showing it in openTX

João
Attachments
OpenTX_LS_Delay.zip
(360.46 KiB) Downloaded 263 times
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
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: ERSKY9X Coding

Post by jhsa »

With this idea you would have this: (Just an example)

L1 Latch RUD TRN (Delay) 2 AND ---

Instead of for example:

CH9 sRUD Delay (u 2 : d 0)

L1 v>val Ch9 98 AND ---
L2 Latch L1 TRN AND ---

I have just realized that it would be a good idea to have Delay at ON, OFF, and BOTH. With the example above it might be needed to delay the switch turn OFF also.

For the range option, we would have this:

L1 Range Ch3 -15 +94 AND ---

Instead of:

L1 v>val Ch3 -15 AND ---
L1 v<val Ch3 94 AND L1

Use L2.

As we can see, it would make programming logical conditions much simpler than what we currently have.. ;) :)

Thanks

João
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
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: ERSKY9X Coding

Post by MikeB »

Your example with the delay operates differently in the two cases. Without a delay option on the logical switch, you are delaying the RUD switch, then latching it. With the delay option, you are latching it, then applying the delay.
So in the first instance, if you change the RUD switch, then change the TRN switch within 2 seconds, the latch will hold an output of 0, while in the second case, the 2 second delay will start when you change the RUD switch, and the latch will hold a 1 when you change the TRN switch, resulting in a 1, 2 seconds after you changed the RUD switch.

Possible implementation of delay and/or range is not a quick change.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: ERSKY9X Coding

Post by jhsa »

Yeah, I thought it wouldn't be neither a quick change, nor an easy implementation :(

It might work slightly different, of course.. That was just a quick example.
In this case with the delay at switch ON, it would apply the delay AFTER the ON conditions was met. That is, the RUD switch was turned ON. If meanwhile you flicked the TRN sw, of course the LS wouldn't do nothing because it would be waiting for the delay to end and turn the latch ON. The latch also can only turn OFF after the first condition was turned OFF, and the second condition is met anyway..

SO, in my opinion, what should happen in all cases is:
Assuming you implement delay for both switch ON and OFF.

Delay at switch ON:
- Logical condition for the switch to turn ON is met (normally switch should turn immediately ON now), apply delay.

Delay at switch OFF:
- Logical condition for the switch to turn OFF is met (normally switch should turn immediately OFF now), apply delay.

João
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
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: ERSKY9X Coding

Post by jhsa »

By the way, I have been playing with this :) It might be useful for the ones that like the smell of fuel and the roar of the engines :)

https://www.youtube.com/watch?v=TWWXsZ9W0j0

João
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
tsenecal
Posts: 45
Joined: Wed Mar 22, 2017 8:32 pm
Country: United States

Re: ERSKY9X Coding

Post by tsenecal »

jhsa wrote: Thu Apr 06, 2017 3:07 pm By the way, I have been playing with this :) It might be useful for the ones that like the smell of fuel and the roar of the engines :)

https://www.youtube.com/watch?v=TWWXsZ9W0j0

João
Didn't the original frsky D series hub have a "fuel" sensor that acted much like this? i remember stealing that field in the D telemetry for my submarines to give me a quick and dirty o% - 100% depth reading
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: ERSKY9X Coding

Post by jhsa »

It uses the same principle but it works differently. And it is not that accurate, specially not in an airplane where the tank is not always horizontal. I saw a video of it working and I didn't like its performance. I believe we can make much better and cheaper. :)

João
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
tsenecal
Posts: 45
Joined: Wed Mar 22, 2017 8:32 pm
Country: United States

Re: ERSKY9X Coding

Post by tsenecal »

I remember buying one to figure out how it worked, and at the time i had the FLD-02 display connected to a Futaba 9c. i was disappointed that the FLD-02 only showed 4 basic levels: 0%, 25%, 50%, 100%, even though the spec stated that it was 0% - 100%... and later testing revealed the field would let you use a 2 byte integer... (0 - 16000) so in the end i was able to return depth readings in millimeters, and on the taranis used a custom telemetry script to draw a scrolling depth chart, like a fish finder.
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: ERSKY9X Coding

Post by jhsa »

Did you try placing the tank in different positions? :)

João
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
tedbmoss
Posts: 121
Joined: Sun Jul 15, 2012 10:42 pm
Country: -
Location: Peoria, AZ

Re: ERSKY9X Coding

Post by tedbmoss »

This seems to be a good place to put this.
shows the difference between SD card status page 9 on 9Xtreme and 9xrpro- ar9x.
I don't know if you can or want to make them the same. Test versions 3702-Mike 31.03.2017 -pc7r221
Attachments
9extreme difference
9extreme difference
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: ERSKY9X Coding

Post by MikeB »

The 'Pro and AR9X boards have a full SD card interface, the 9Xtreme uses a SPI interface. For various reasons relating to this, the 9Xtreme doesn't read the CID, CSD and SCR values from the SD card.
Something for me to look into sometime.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
tsenecal
Posts: 45
Joined: Wed Mar 22, 2017 8:32 pm
Country: United States

Re: ERSKY9X Coding

Post by tsenecal »

jhsa wrote: Fri Apr 07, 2017 3:17 pm Did you try placing the tank in different positions? :)

João
nope... i didn't. and there was a typo in the comment above.. it showed 0%, 25%, 50%, 75%, 100%, but even with a full tank, it never showed 100%... i was trying to show that i agreed with your statement that it wasn't very accurate. it provided me with the idea that i could steal that field for my own telemetry, since i figured nobody in their right mind would use it for its intended purpose.
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: ERSKY9X Coding

Post by MikeB »

Be aware that if you set a value for "Mah Alarm", and are measuring current with a current source set, then the Fuel telemetry value will be filled in. It will start at 100%, and reduce to 0% as the mAh consumed reaches the limit set.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
tedbmoss
Posts: 121
Joined: Sun Jul 15, 2012 10:42 pm
Country: -
Location: Peoria, AZ

Re: ERSKY9X Coding

Post by tedbmoss »

MikeB wrote: Sat Apr 08, 2017 10:51 pm The 'Pro and AR9X boards have a full SD card interface, the 9Xtreme uses a SPI interface. For various reasons relating to this, the 9Xtreme doesn't read the CID, CSD and SCR values from the SD card.
Something for me to look into sometime.

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

Re: ERSKY9X Coding

Post by jhsa »

Mike, been thinking here, what about if the scalers would adjust automatically to an input? This might be a completely stupid idea but just in case I post it :)
Imagine you have a voltage sensor for example, it could be any other, like a temperature sensor or a fuel tank..
It would be something like a calibration menu.
- Set the sensor to it's minimum for example with a voltage sensor, to 0V
- Now enter the minimum value on the radio menu.
- connect a fully charged battery or a power supply to the input and insert the max voltage on the MAX field. for example for a 3S Lipo, insert 12.6V.
-The radio will calculate the range and offset automatically based on the voltage range provided by the sensor, and the range you have inserted in the radio..

Is something like this possible, or is it too stupid?
I have been playing with capacitive fuel sensing, and something like this would be very useful to calibrate the radio to the sensor..
We are using an arduino outputting PWM. This could even be connected to an A1 /A2 port through a voltage divider (arduino is 5V / 16Mhz).
In my opinion, it would make it much easier to calibrate sensors, even for people that are not used to do it: :)

As I said above, I do apologize if this sounds too stupid

Thanks

João
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
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: ERSKY9X Coding

Post by MikeB »

Something like this may well be possible. I'm a bit busy on other things at present to progress for a while though.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: ERSKY9X Coding

Post by jhsa »

Thanks Mike..

João
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
ozphoenix
Posts: 404
Joined: Fri Oct 28, 2016 11:51 am
Country: Australia

Re: ERSKY9X Coding

Post by ozphoenix »

On two occasions today (out of three flights with a specific model file which reads out telemetry every 30 secs) my voice 'stuttered' halfway through an audio file and went silent - no more audio, no more beeps.

This 'freeze' occurred several times a few weeks ago, so I started the debug methods shown in this thread -- the SD has been re-formatted by the formatter below and reloaded 'clean' from my PC repository and on this model there are only 2 audio files, both short, no long silences before or after - used in several other models also, though I am intermittently having the same (or similar) 'freeze' on those other models on some occasions. All audio files are Mono, 16KHz, one or two words only.

I checked the voice underruns after each of today's failures - 1 underrun per 'freeze'.

A radio restart removed the problem before next flight.

I am running 9XRPro with Ersky9x SVN: pb6r222, VERS: V.3144-Mike, MOD: REVB-XDATE: 06.03.2017

I believe I had noticed similar 'freeze' situations in earlier versions (e.g. r220), but hadn't pursued a solution.

I have not yet completely switched to another SD card (this card came with the radio when I bought it, used, from another club member -- who usually only buys 'the best' of things -- 9 months ago) and I have not checked the cluster size after a freeze - those two steps are next on my list.

Any other suggestions would be welcome.

Regards,
ozphoenix
jhsa wrote: Sat Mar 25, 2017 12:26 pm Use the free "SD Card Formatter " tool to format your cards.. Don't use windows.. Get it here:

https://www.sdcard.org/downloads/formatter_4/

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

Re: ERSKY9X Coding

Post by jhsa »

That is the typical symptom of a not large enough cluster.
Make sure your SD Card is at least 4Gb in size so it is able to have a cluster size of 32.
Format it with the "SD Card Formatter" utility, no Windows..

João

EDIT: If that doesn't solve the problem, please post the audio files here..

Sent from my thor using Tapatalk


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
ozphoenix
Posts: 404
Joined: Fri Oct 28, 2016 11:51 am
Country: Australia

Re: ERSKY9X Coding

Post by ozphoenix »

Thanks for the quick response.

The SD is 4GB, the cluster/allocation unit size is 32kB (note that I already used SD Card Formatter, as recommended).

In collecting the files for posting, I noticed that that I need to listen more carefully to make sure at which point in the audio it is freezing and be sure I have all of the correct files collected - now that I need to be more exact, I recall I was flying four models today and two had audio problems (today or in the past) - I need to be sure which one I collect from.

I'll get back with a later post in a week or so after I've had time to fly again.

Thanks, again.

ozphoenix.
jhsa wrote: Sun Apr 23, 2017 9:28 am That is the typical symptom of a not large enough cluster.
Make sure your SD Card is at least 4Gb in size so it is able to have a cluster size of 32.
Format it with the "SD Card Formatter" utility, no Windows..

João

EDIT: If that doesn't solve the problem, please post the audio files here..

Sent from my thor using Tapatalk
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: ERSKY9X Coding

Post by jhsa »

Mike, would it be possible to implement adding a "Marker" (probably numbered) to the log file when we press for example a momentary switch?
It already happened to me wanting to find a certain moment of the flight that I wanted to check a certain value, but it was very difficult to find. with a numbered marker we could easily find those "moments" we want to have a look at, for example when the aircraft does something strange, or you want to see certain logged values when the model does a looping, or turns, check RSSI when you fly the model away from you, etc..

Also, would it be possible an option to log the sticks and pots??

Thank you

João
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
ozphoenix
Posts: 404
Joined: Fri Oct 28, 2016 11:51 am
Country: Australia

Re: ERSKY9X Coding

Post by ozphoenix »

I second this request! Good thought, João!

Though, I think the switch source needs to be selectable, as I currently have the only momentary switch on the 9XRPro already in use during flight for several models (think: occasional telemetry and/or panic/auto-level mode, etc).
jhsa wrote: Tue Apr 25, 2017 9:08 am Mike, would it be possible to implement adding a "Marker" (probably numbered) to the log file when we press for example a momentary switch?
It already happened to me wanting to find a certain moment of the flight that I wanted to check a certain value, but it was very difficult to find. with a numbered marker we could easily find those "moments" we want to have a look at, for example when the aircraft does something strange, or you want to see certain logged values when the model does a looping, or turns, check RSSI when you fly the model away from you, etc..

Also, would it be possible an option to log the sticks and pots??

Thank you

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

Re: ERSKY9X Coding

Post by ReSt »

How about using a GVAR as the indicator that you increment when you activate the switch ?
You can log the GVars. You can have it spoken when you activate the switch, so you know the value you have to look for in your log file

Reinhard

Post Reply

Return to “erskyTx (was ersky9x)”