Page 4 of 8 FirstFirst 12345678 LastLast
Results 31 to 40 of 78

Thread: PMDG Offsets

  1. #31
    75+ Posting Member Daveanne's Avatar
    Join Date
    Sep 2007
    Location
    Ellesmere Port, Cheshire
    Posts
    129
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    many thanks

    Many thanks Peter, I will start my journey as you decribed.

    Daveanne

  2. #32
    25+ Posting Member
    Join Date
    Feb 2009
    Location
    Preston, UK
    Posts
    37
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Daveanne,

    I dont really want to get involved in this discussion, suffice to say that I am a developer by trade, so the SW side of things for me, is easy (its the HW side that gets me in a knot!)

    So if you need anyhelp in what Peter was advising, please let me know..as it would be good practice for me, on my impending sim build!

    Thanks

    Chris

  3. #33
    25+ Posting Member
    Join Date
    Feb 2009
    Location
    Preston, UK
    Posts
    37
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    I have just had a quick play for the first time with LUA
    here is a smoothing script that will use a 5point average smoothing on throttle input, only outputs to a window at the moment but you could easily change it to write to the offset of your choice

    Code:
    thr1Array = {0,0,0,0,0}
    thr2Array = {0,0,0,0,0}
    thr1Smooth = 1
    thr2Smooth = 1
    loop = 1
    -- Loop forever: to stop this you'll have to use the LuaKill control on it.
    while 1 do
    
    	thr1 = ipc.readSW(0x088C)
    	thr2 = ipc.readSW(0x0924)
    
    	if loop<5 then
    
    		thr1Array[loop] = thr1
    		thr2Array[loop] = thr2
    		loop = loop + 1
    
    		thr1Smooth = thr1Array[1]
    		thr2Smooth = thr1Array[1]			
    
    	else
    		thr1Smooth = (thr1Array[1] + thr1Array[2] + thr1Array[3] +thr1Array[4] +thr1Array[5]) / 5
    		thr2Smooth = (thr2Array[1] + thr2Array[2] + thr2Array[3] +thr2Array[4] +thr2Array[5]) / 5
    		
    		--shift the array
    		
    		thr1Array[1] = thr1Array[2]
    		thr1Array[2] = thr1Array[3]
    		thr1Array[3] = thr1Array[4]
    		thr1Array[4] = thr1Array[5]
    		thr1Array[5] = thr1
    
    		thr2Array[1] = thr2Array[2]
    		thr2Array[2] = thr2Array[3]
    		thr2Array[3] = thr2Array[4]
    		thr2Array[4] = thr2Array[5]
    		thr2Array[5] = thr2
    
    	end
    
    
    	ipc.display("thr1="..thr1.."\nthr1Smooth="..thr1Smooth.."\nthr2="..thr2.."\nthr2Smooth="..thr2Smooth)
    
    ipc.sleep(50)
    
    end


    if you change the sleep to a larger number the output wont be as "quick" which might help a little, also you might want to put in a buffer so that it doesnt bounce arround the same values, i.e. store the last update, and if its not much bigger, dont bother with the sevo move
    Last edited by MrRoper; 02-06-2009 at 04:12 PM. Reason: found something out

  4. Thanks Daveanne, Trevor Hale thanked for this post
  5. #34
    2000+ Poster - Never Leaves the Sim Trevor Hale's Avatar
    Join Date
    Nov 2005
    Location
    Ontario, Canada
    Posts
    2,223
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    My Gosh, you picked up on that fast... Great stuff..

    I may need to dig into this a bit and see how it works out.

    Thanks for this...
    ________________________
    Trevor Hale

  6. #35
    75+ Posting Member Daveanne's Avatar
    Join Date
    Sep 2007
    Location
    Ellesmere Port, Cheshire
    Posts
    129
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Thanks for the help, so far

    Quote Originally Posted by MrRoper View Post
    I have just had a quick play for the first time with LUA
    here is a smoothing script that will use a 5point average smoothing on throttle input, only outputs to a window at the moment but you could easily change it to write to the offset of your choice

    Code:
    thr1Array = {0,0,0,0,0}
    thr2Array = {0,0,0,0,0}
    thr1Smooth = 1
    thr2Smooth = 1
    loop = 1
    -- Loop forever: to stop this you'll have to use the LuaKill control on it.
    while 1 do
     
        thr1 = ipc.readSW(0x088C)
        thr2 = ipc.readSW(0x0924)
     
        if loop<5 then
     
            thr1Array[loop] = thr1
            thr2Array[loop] = thr2
            loop = loop + 1
     
            thr1Smooth = thr1Array[1]
            thr2Smooth = thr1Array[1]            
     
        else
            thr1Smooth = (thr1Array[1] + thr1Array[2] + thr1Array[3] +thr1Array[4] +thr1Array[5]) / 5
            thr2Smooth = (thr2Array[1] + thr2Array[2] + thr2Array[3] +thr2Array[4] +thr2Array[5]) / 5
     
            --shift the array
     
            thr1Array[1] = thr1Array[2]
            thr1Array[2] = thr1Array[3]
            thr1Array[3] = thr1Array[4]
            thr1Array[4] = thr1Array[5]
            thr1Array[5] = thr1
     
            thr2Array[1] = thr2Array[2]
            thr2Array[2] = thr2Array[3]
            thr2Array[3] = thr2Array[4]
            thr2Array[4] = thr2Array[5]
            thr2Array[5] = thr2
     
        end
     
     
        ipc.display("thr1="..thr1.."\nthr1Smooth="..thr1Smooth.."\nthr2="..thr2.."\nthr2Smooth="..thr2Smooth)
     
    ipc.sleep(50)
     
    end


    if you change the sleep to a larger number the output wont be as "quick" which might help a little, also you might want to put in a buffer so that it doesnt bounce arround the same values, i.e. store the last update, and if its not much bigger, dont bother with the sevo move
    Many thanks for this above, but as yet I am still rather "thick" when it comes to programming as above, try as I may to understand the LUA system, I can't seam to get to grips with it.

    I started the thread off about how to take the "erratic jerking" that the PMDG 737NG 800 sends out when I integrate it with a set of Phidgets servo's, which I have now fitted into my TQ, using the FS2Phigets software.

    This works very well, but if I could only get the jerky movements out of it, then it would be fine?

    So how do I integrate the above programme into my system?

    Any help would be very much appreciated, please bear in mind I am pretty dumb when it comes to this side of the simpit building.

    Daveanne

  7. #36
    25+ Posting Member
    Join Date
    Feb 2009
    Location
    Preston, UK
    Posts
    37
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    ok. its difficult for me to test this as I dont have a motorised TQ,

    but essentially what the code is doing is taking the last 5 throttle positions and averaging them out,

    now after a bit pf playing with the pmdg 737 in autothrottle mode, the values jump about loads, but this does moake the jumps less "jumpy"

    so just to see if it is working, create a file called throttlesmooth.LUA in your modules folder

    and dump the code I wrote into it, then go into fsuipc and select a button or keypress, tick "select for FS control" and scroll down until you see "LUASet throttleSmooth"

    now, when you press this button/key a window should appear showing the raw throttle value, and its "smoothed" value.

    LEts see if that works for now

  8. #37
    25+ Posting Member
    Join Date
    Feb 2009
    Location
    Preston, UK
    Posts
    37
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    sorry

    Dont use LUA set, just "LUA ThrottleSmooth"

  9. #38
    75+ Posting Member Daveanne's Avatar
    Join Date
    Sep 2007
    Location
    Ellesmere Port, Cheshire
    Posts
    129
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Sorry for being so thick, but....

    Sorry for being so thick, but....

    I have created the file "throttlesmooth.lua" in the Modules folder and have highlighted the script you sent on the web site, then copied and tried to paste it into the file.

    However nothing is "paste-able"?

    How do I "dump" the contents of your script in the file I have created?

    Daveanne

  10. #39
    25+ Posting Member
    Join Date
    Feb 2009
    Location
    Preston, UK
    Posts
    37
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    hello mate,

    create a txt file (open up notepad) paste my code into it, select file >> save as

    change saveas type to all files, then in the name type throttlesmooth.lua then click save

    that should save a txt file called throttlesmooth.lua with the code in it

  11. #40
    75+ Posting Member Daveanne's Avatar
    Join Date
    Sep 2007
    Location
    Ellesmere Port, Cheshire
    Posts
    129
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Ah ha!

    Arr.... the mud becomes clearer.

    Will do that and let you know what happens.

    Daveanne

Page 4 of 8 FirstFirst 12345678 LastLast

Similar Threads

  1. SIOC MCP 737 PMDG with PMDG 747 in fsx displays and leds don't work
    By dion73 in forum Computer Hardware Setup
    Replies: 7
    Last Post: 04-03-2011, 07:02 AM
  2. PMDG 737-800 OH lights offsets ???
    By Nick1150 in forum I/O Interfacing Hardware and Software
    Replies: 3
    Last Post: 11-03-2010, 12:59 PM
  3. Offsets
    By Kristoffer in forum Phidgets & Cockpit Simulator Builder
    Replies: 8
    Last Post: 04-26-2006, 07:35 AM
  4. MCP Course Set - Offsets
    By Rick Taylor in forum PM General Q & A
    Replies: 3
    Last Post: 02-02-2005, 08:25 AM