Results 41 to 50 of 78
Thread: PMDG Offsets
-
02-07-2009, 04:30 PM #41
After the smoothing...
Mr R, have tried out the programme you sent me and its realy difficult to see if the smoothing works successfully or not, because the results numbers are changing all the time its difficult to observe if they are "dampening" down the movement.
If possible could you download the FS2Phidgets programme from the "download" section of this site and also install the Phidgets software from their site.
Once installed the FS2Phidgets interface has an emulation section which immitates and graphically shows a servo, assign it to the throttle and then you will be able to see if the smoothing has a marked effect or not?
If you don't feel like doing that, then please let me know how I interface the "smoothing" results into the FS2Phidgets interface and I will trial the emulated servo myself?
Hope you can help?
Daveanne
-
02-07-2009, 04:52 PM #42
- Join Date
- Feb 2009
- Location
- Preston, UK
- Posts
- 37
Hi,
I will have a play with the software and see if i can get something working, it is likely that, because the throttle output is moving constantly, we will need to add some dampening code, that will not move the servo until a large enough change occurs,
dont worry we will sort it, I dont let software beat me
-
02-07-2009, 05:42 PM #43
- Join Date
- Feb 2009
- Location
- Preston, UK
- Posts
- 37
well thats a fun little app, didnt realise there was a servo emulator
ok so here is the new code
Code:-- "Display Vals" example LUA plug-in, by Pete Dowson, September 2008 thr1Array = {0,0,0,0,0} thr2Array = {0,0,0,0,0} thr1Smooth = 1 thr2Smooth = 1 thr1LastPos = 1 thr2LastPos = 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 --write to the offset if thr1Smooth > thr1LastPos + 600 or thr1Smooth < thr1LastPos - 600 then ipc.writeSW(0x66C0, thr1Smooth) thr1LastPos = thr1Smooth end if thr2Smooth > thr2LastPos + 600 or thr2Smooth < thr2LastPos - 600 then ipc.writeSW(0x66C2, thr2Smooth) thr2LastPos = thr2Smooth end ipc.display("thr1="..thr1.."\nthr1Smooth="..thr1Smooth.."\nthr2="..thr2.."\nthr2Smooth="..thr2Smooth.."\nthr1LastPos ="..thr1LastPos) ipc.sleep(300) end
this is the clever bit
Code:if thr1Smooth > thr1LastPos + 600 or thr1Smooth < thr1LastPos - 600 then ipc.writeSW(0x66C0, thr1Smooth) thr1LastPos = thr1Smooth end if thr2Smooth > thr2LastPos + 600 or thr2Smooth < thr2LastPos - 600 then ipc.writeSW(0x66C2, thr2Smooth) thr2LastPos = thr2Smooth end
66c0 and 66c2
you will need to create a variable in fs2phidgets that points to these offsets and then map the servo to this variable to see the change
if this works you can then just tweak the range we ignore to increase the 'null' zone
hope this makes sense!
-
02-07-2009, 08:08 PM #44
OK so far, but nothing happens....?
OK, have done all that as directed, have assigned the emulated servo to 66C0 and gave it a name of ENGINE_T1_LEVER.
However when mapping the servo in FS2P the servo now doesn't move at all, even the FS numbers in the table do not increase/decrease.
?
Daveanne
-
02-07-2009, 08:09 PM #45
P.S.
P.S. Also the display has gone away and is no loger visible.
Daveanne
-
02-07-2009, 08:13 PM #46
- Join Date
- Feb 2009
- Location
- Preston, UK
- Posts
- 37
i think its a formatting error when you have pasted it into notepad, the display should still appear
the line that reads ipc.display should all be one line and include the ="..thr1LastPos) part.. will paste it in without the code tags
-- "Display Vals" example LUA plug-in, by Pete Dowson, September 2008
thr1Array = {0,0,0,0,0}
thr2Array = {0,0,0,0,0}
thr1Smooth = 1
thr2Smooth = 1
thr1LastPos = 1
thr2LastPos = 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
--write to the offset
if thr1Smooth > thr1LastPos + 600 or thr1Smooth < thr1LastPos - 600 then
ipc.writeSW(0x66C0, thr1Smooth)
thr1LastPos = thr1Smooth
end
if thr2Smooth > thr2LastPos + 600 or thr2Smooth < thr2LastPos - 600 then
ipc.writeSW(0x66C2, thr2Smooth)
thr2LastPos = thr2Smooth
end
ipc.display("thr1="..thr1.."\nthr1Smooth="..thr1Smooth.."\nthr2="..thr2.."\nthr2Smooth="..thr2Smooth.."\nthr1LastPos="..thr1LastPos)
ipc.sleep(300)
end
-
Post Thanks / Like - 1 Thanks, 0 Likes, 0 DislikesDaveanne thanked for this post
-
02-07-2009, 09:55 PM #47
- Join Date
- Jan 2007
- Posts
- 496
-
02-07-2009, 10:00 PM #48
Excellent...!
Well done sir, running very nicely indeed, graphic shows what the "smoother" is doing and the emulated servo shows the, "lack of" jerky movement too..!!
Just need to try it on the real ones now, mind you I don't think I will have any problems with it.
I have tried a few tweeks with the time intervals and I am sure that I can get it down to a fine level that will give smooth lever movements and a realistic setting for the engine N1's ect.
I have set the programme (LUA throttlesmoothing) to start with a key stroke, how do I start that automatically each time I start FS?
Presumeably if I do not want the graphic to pop up I delete that last part of the script?
Once again, many thanks for very excellent help, its nice to know that there someone that is willing to help someone like me, who can build a sim pit, very handy with woodwork, modelling etc, but rather (not now) dumb with programming.
Yet again, many thanks for your very welcome help.
Daveanne
P.S. hope you don't mind if I call on you again if I get more problems with this?
-
02-07-2009, 10:30 PM #49
- Join Date
- Jan 2007
- Posts
- 496
Rename it to "IPCready.lua", as described in the FSUIPC Lua plug-in documentation. You can add anything in that file you want to run all the time. It starts when FS is ready to fly. There's an "IPCinit" facility too, starting earlier, but that doesn't suit anything involving aircraft control as it starts before the aircraft is loaded!
Pete
-
Post Thanks / Like - 1 Thanks, 0 Likes, 0 DislikesDaveanne thanked for this post
-
02-08-2009, 11:28 AM #50
Thanks Peter..
Peter, thanks for that, I had read in your interim manual about having the programme starting automatically when FS is ready to fly, but didn't quite understand that was achieved just by re-naming the file, so thanks for clearing that up.
Now I can see a programme working and where to place it, the whole subject is much clearer to see and indeed its prctical uses also.
The original "fog" in my mind was how to put a programme together, but firstly once I had put one together where to put it within the programme (FS).
Well just need to install all this into my pit now and report back as to how its gone.
Many thanks for both of your help's
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
Looking for fun companions for travels and adventures? Authentic Ladies Premier Сasual Dating
Top-notch Сasual Dating -...