Results 31 to 40 of 78
Thread: PMDG Offsets
-
01-21-2009, 11:21 AM #31
many thanks
Many thanks Peter, I will start my journey as you decribed.
Daveanne
-
02-06-2009, 10:31 AM #32
- Join Date
- Feb 2009
- Location
- Preston, UK
- Posts
- 37
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
-
02-06-2009, 04:10 PM #33
- Join Date
- Feb 2009
- Location
- Preston, UK
- Posts
- 37
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 moveLast edited by MrRoper; 02-06-2009 at 04:12 PM. Reason: found something out
-
Post Thanks / Like - 2 Thanks, 0 Likes, 0 DislikesDaveanne, Trevor Hale thanked for this post
-
02-06-2009, 04:43 PM #34
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
-
02-06-2009, 05:01 PM #35
Thanks for the help, so far
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
-
02-06-2009, 05:36 PM #36
- Join Date
- Feb 2009
- Location
- Preston, UK
- Posts
- 37
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
-
02-06-2009, 05:40 PM #37
- Join Date
- Feb 2009
- Location
- Preston, UK
- Posts
- 37
sorry
Dont use LUA set, just "LUA ThrottleSmooth"
-
02-07-2009, 12:39 PM #38
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
-
02-07-2009, 12:48 PM #39
- Join Date
- Feb 2009
- Location
- Preston, UK
- Posts
- 37
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
-
02-07-2009, 02:44 PM #40
Ah ha!
Arr.... the mud becomes clearer.
Will do that and let you know what happens.
Daveanne
Similar Threads
-
SIOC MCP 737 PMDG with PMDG 747 in fsx displays and leds don't work
By dion73 in forum Computer Hardware SetupReplies: 7Last Post: 04-03-2011, 07:02 AM -
PMDG 737-800 OH lights offsets ???
By Nick1150 in forum I/O Interfacing Hardware and SoftwareReplies: 3Last Post: 11-03-2010, 12:59 PM -
Offsets
By Kristoffer in forum Phidgets & Cockpit Simulator BuilderReplies: 8Last Post: 04-26-2006, 07:35 AM -
MCP Course Set - Offsets
By Rick Taylor in forum PM General Q & AReplies: 3Last Post: 02-02-2005, 08:25 AM
Pretty Womans in your city
Find Sexy Womans from your city...