Thread Tools
This thread is privately moderated by jfrickmann, who may elect to delete unwanted replies.
Feb 02, 2017, 03:00 AM
Have Fun and Just Fly!
l shems's Avatar
Quote:
Originally Posted by jfrickmann
Jonathan, for now I will just stay with Taranis. I don't even know the Q7, it is news to me that they have introduced all these new models.

I had another thought about the program - I find it a little inconvenient to reach for the switch to change between launch modes during flight, especially if I am struggling to core a small bubble. Therefore, I have made a version where the flight mode (Speed, Cruise and Float) is set by the throttle stick. It works as follows:

95-100% Speed mode
47-95% Cruise mode
0-47% Float mode
-100-0% Flaps down


I hope to get out and test how it works this weekend. Please let me know what you think of the idea!
Nice. I have a switch for cruise speed and thermal, that is active after launch sequence is finished.

When in speed, left slider forward is extra reflex, when in thermal left slider back is extra camber.
Sign up now
to remove ads between posts
Feb 02, 2017, 05:00 AM
Registered User
Quote:
Originally Posted by jfrickmann
Jonathan, for now I will just stay with Taranis. I don't even know the Q7, it is news to me that they have introduced all these new models.

I had another thought about the program - I find it a little inconvenient to reach for the switch to change between launch modes during flight, especially if I am struggling to core a small bubble. Therefore, I have made a version where the flight mode (Speed, Cruise and Float) is set by the throttle stick. It works as follows:

95-100% Speed mode
47-95% Cruise mode
0-47% Float mode
-100-0% Flaps down


I hope to get out and test how it works this weekend. Please let me know what you think of the idea!
Jesper,
I am ok with the switch method to change flight mode as it is, rather than using throttle . I won't be changing that as it is build in muscle memory. Throttle stick movement is build it for heli pitch flyng for me long time ago.

thanks
Jonathan
Feb 02, 2017, 11:00 AM
Registered User
Sensoar's Avatar
95-100% Speed mode
47-95% Cruise mode
0-47% Float mode
-100-0% Flaps down


Clever, I assume that when using the left stick horizontally for rudder, inadvertent minor vertical movement will be filtered out with the fixed settings for flap position. Will the 0 % to -100 be variable for landing or is there a separate landing flight mode.
Feb 02, 2017, 06:48 PM
Jesper Frickmann
jfrickmann's Avatar
Thread OP
Quote:
Originally Posted by l shems
Nice. I have a switch for cruise speed and thermal, that is active after launch sequence is finished.

When in speed, left slider forward is extra reflex, when in thermal left slider back is extra camber.
That is the same that I have right now, except that left slider just adds camber in Speed, Cruise and Float.

Quote:
Originally Posted by jyzoom
Jesper,
I am ok with the switch method to change flight mode as it is, rather than using throttle . I won't be changing that as it is build in muscle memory. Throttle stick movement is build it for heli pitch flyng for me long time ago.

thanks
Jonathan
OK, I will test it out, and if I like it, then I will add it as an alternative option without removing the existing way of doing it.

Quote:
Originally Posted by Sensoar
95-100% Speed mode
47-95% Cruise mode
0-47% Float mode
-100-0% Flaps down

Clever, I assume that when using the left stick horizontally for rudder, inadvertent minor vertical movement will be filtered out with the fixed settings for flap position. Will the 0 % to -100 be variable for landing or is there a separate landing flight mode.
Yes, exactly - by having flight modes instead of just adding camber with the stick, you have a well-defined amount of camber (that can be adjusted with throttle trim for each flight mode), as well as elevator trim, for each flight mode.
Flaps come down gradually as you pull the stick back from 0. So you land in Float mode with flaps added.
Feb 07, 2017, 09:47 PM
Jesper Frickmann
jfrickmann's Avatar
Thread OP
OK, I tested the flight modes on the throttle stick, and it did not work very well. I moved it from SE to SB; I think that I like that better. Do you have the flight modes on SE, or have you moved it?
Feb 08, 2017, 01:44 AM
Registered User
I am on SE, and launch on SF. The SF toggle switch is not working that well for me as it sometime get stuck.
So I have move to use a switch,
I will probably have to try using SB as the Q X7 don't have SF and SE together , but only one in that position.
Feb 08, 2017, 08:48 AM
Registered User

Q x79


Jesper

I got my Q x7s in..mtrief the scripts and it got error.
I believe it is due to the screen resolution of only 128x64 vs 212 x 64.

Could you advice where in the code should i make change 😆

Jonathan
Last edited by jyzoom; Feb 08, 2017 at 04:47 PM.
Feb 08, 2017, 07:31 PM
Jesper Frickmann
jfrickmann's Avatar
Thread OP
Quote:
Originally Posted by jyzoom
Jesper

I got my Q x7s in..mtrief the scripts and it got error.
I believe it is due to the screen resolution of only 128x64 vs 212 x 64.

Could you advice where in the code should i make change 😆

Jonathan
Hi Jonathan,

You need to change the places where the screen resolution is used for plotting in JF F3K 3.luab:

Code:
027  local X_PIX_OFF = 1 -- Offset for plotting on the X axis
028  local X_PIX_RANGE = 185 -- Max. X value for plotting
029  local Y_PIX_OFF = 61 -- Offset for plotting on the Y axis
030  local Y_PIX_RANGE = 50 -- Max. Y value for plotting
031  local Y_PIX_MARGIN = 4 -- Margin for plotting min./max.

520	lcd.drawText(140, 0, infoStr)
521	lcd.drawRectangle(2, 10, 208, 52)
I cannot guarantee that I found them all; it may take some trial and error.
Feb 09, 2017, 06:13 AM
Registered User

Making Good progress


Hi Jesper,

Thanks for the tips...I am making good progress on the 1st scripts.
Reverse engineering took some painful time...especially I am not familiar with Luna scripts. But I got it there, almost.

Got the graphics portion working....testing on simulator and also on actual Qx7, the scripts run.

Noted a Luna implementation problem between x9d+ and qx7...

The lcd.drawScreenTitle don;t work on Qx7 as it is not getting the correct furthest end of the Qx7 screen and the script dont run as it is trying to draw outside of the screen.

-- lcd.drawScreenTitle(" " .. taskList[task] .. " ", 1, 3)
lcd.drawText( 5, 0, " " .. taskList[task] .. " ", SMLSIZE)
-- replace lce.drawscreenTitle which dont work on Q x7

Now my problem left is to figure out where is the input button as there is no longer the right hand size 3 buttons....replace by rotary switch.
Any tips

It need to be replace by the following :
EVT_ROT_BREAK
EVT_ROT_LONG
EVT_ROT_LEFT
EVT_ROT_RIGHT

else I am having fun...the process of getting it there is

Thanks again for sharing.
Attached is my current scripts that resolve the display portion.

Jonathan

NOTE: There is an error on poker scripts...it could be a 2.2 things..happen even with original scripts.
Feb 09, 2017, 07:13 AM
Registered User
Jesper,

You may not be familiar with this as you dont use rotary switch...

A) why when i replace the scripts - event from x9d+ Plus/Minus/Enter to rotary Left/Right/Break...it didn;t seems to work.
what am I missing ?

B) Can I replace the PLUS and MINUS button press with a quick way using SC position ?

Thanks...just need some tips to get going.
regards,
Jonathan

E.g. 1) RIGHT rotary turn vs Plus button press
-- Plus button was pressed to toggle quick relaunch
-- replace EVT_PLUS_BREAK with EVT_ROT_RIGHT
if event == EVT_ROT_RIGHT then
quickRelaunch = not quickRelaunch
playTone(1760, 100, PLAY_NOW)
end

E.g. 2) Left rotary turn vs MINUS button press
-- Plus button was pressed to change task
-- replace EVT_MINUS_BREAK with EVT_ROT_LEFT
if event == EVT_ROT_LEFT then
saveTask = task
task = task - 1
if task < 1 then task = #taskList end
if #scores == 0 then -- Do not show popup menu to save scores
saveTask = 0
InitializeWindow()
end
end


e.g. 3) Rotary Break vs ENTER button press ( This one whether I change the code or not....it is the same. press rotary enter work.
-- Enter button was pressed. Stop or start the task window
-- replace EVT_ENTER_BREAK with EVT_ROT_BREAK
if event == EVT_ROT_BREAK and not timerRunning then
windowRunning = not windowRunning
playTone(1760, 100, PLAY_NOW)
end
Feb 09, 2017, 06:39 PM
Registered User
Jesper,

As Guido responded on other thread, there is a bug on rotary scripts that limit me form using it for now until next release.

I am trying to use SC switch to replace PLUS and MINUS button.
I know I can getValue(MIXSRC_SC) < 0 or >0 , but I not good with luna scripts as now it is scanning it way to fast.
Need to have it detect switch goes up and return center , as like clicking a PLUS or MINUS button.
Any suggestion ?


-- Minus button was pressed. Go to previous record
-- if event == EVT_MINUS_FIRST then
if getValue(MIXSRC_SC) < 0 then
index = index - 1
if index <= 0 then
index = #indices - 1
playTone(3000, 100, 0, PLAY_NOW)
end

logFile = io.open("/LOGS/JF F3K Scores.csv", "r")
ReadLineData(indices[index])
if logFile ~= nil then io.close(logFile) end
killEvents(event)
end

-- Plus button was pressed. Go to next record
-- if event == EVT_PLUS_FIRST then
if getValue(MIXSRC_SC) > 0 then
index = index + 1
if index >= #indices then
index = 1
playTone(3000, 100, 0, PLAY_NOW)
end

logFile = io.open("/LOGS/JF F3K Scores.csv", "r")
ReadLineData(indices[index])
if logFile ~= nil then io.close(logFile) end
killEvents(event)
end
Feb 09, 2017, 08:06 PM
Jesper Frickmann
jfrickmann's Avatar
Thread OP
Hi Jonathan,

Try getValue("sc").

Jesper
Feb 09, 2017, 08:39 PM
Registered User
Thanks Jesper ...it does the same .
I am not able to do a step through one at a time...somehow need to introduce a delay or detect switch goes up and return to center.

much appreciated
Jonathan

Here is a video.
Video (0 min 30 sec)
Feb 10, 2017, 06:30 AM
Have Fun and Just Fly!
l shems's Avatar
Quote:
Originally Posted by jyzoom
Thanks Jesper ...it does the same .
I am not able to do a step through one at a time...somehow need to introduce a delay or detect switch goes up and return to center.

much appreciated
Jonathan

Here is a video.
https://youtu.be/Xa66Ubvj11Y
Make a variable which loads the value of the SC switch at startup.
then, make a function that checks the actual value versus the variable. If positive or negative, trigger a plus or minus event.
after the check function, update the variable with the value.

If you combine the actual position with the last position, you can determine whatever action you want and have it trigger your LUA actions
Feb 10, 2017, 07:16 AM
Registered User
Thanks Guido.
Let me also figure out how to "trigger a plus or minus event" .

Now I face a very interesting situation where the scrips work perfectly on simulator but not on the actual Qx7.
The score is just showing 00:00 and not the actual score...
I had it working but later part of the days it just not showing up on Qx7 , but companion is ok. Now it is consistently not showing up on Qx7.
I confirmed making sure the same file is use on my HD SDCARD folder use by companion , vs what is on Qx7 actual SDCARD.

Very funny...


UPDATE : Please ignore...I found the problem ...there was a SF that reset the timer when I hit the launch switch. My mistake.

Jonathan
Last edited by jyzoom; Feb 10, 2017 at 09:48 AM.


Quick Reply
Message:

Thread Tools