DCS A10 Support?  Topic is solved solved with post #24909

Re: DCS A10 Support?

Postby asticher » Tue 5. May 2015, 01:02

Puhhaa, i missed this hole new Plugin Story totaly :shock:
I trie out asap. But i have to say that i didn´t note this Bugs, because Pitch and Bank values are pretty perfect with the A10-C brick turnrates :lol:
Another thing: With the old export.lua some extra software like Aries Radio, Tacview and Flighplaner dosn´t work anymore.
I find out that a new, small Entry come along with one of the updates. Here you can download the new lua:
http://www.virtual-jabog32.de/forum/dow ... hp?id=2171
Warning: i use the old Plugin.
"No Brain, No Pain"

3DOF 360° Full Motion Simulator with Valve Index, AMD Ryzen 7, 32GB mem; Gigabyte Board UHD; GTX2080; Samsung M.2 SSD; Thrustmaster Warthog with FFB; Saitek Pro Pedals, Lilliputs & TM MFDs, Body Shaker + 5.1,
User avatar
asticher
 
Posts: 102
Images: 20
Joined: Wed 5. Sep 2012, 20:18
Location: Germany near Munich
Has thanked: 6 times
Been thanked: 1 time

Re: DCS A10 Support?

Postby asticher » Wed 24. Jun 2015, 12:38

I did try the new DCS Plugin and it works like a charme. Thanks Sirnoname and laurivs!
"No Brain, No Pain"

3DOF 360° Full Motion Simulator with Valve Index, AMD Ryzen 7, 32GB mem; Gigabyte Board UHD; GTX2080; Samsung M.2 SSD; Thrustmaster Warthog with FFB; Saitek Pro Pedals, Lilliputs & TM MFDs, Body Shaker + 5.1,
User avatar
asticher
 
Posts: 102
Images: 20
Joined: Wed 5. Sep 2012, 20:18
Location: Germany near Munich
Has thanked: 6 times
Been thanked: 1 time

Re: DCS A10 Support?

Postby asticher » Sun 26. Jul 2015, 23:49

laurivs wrote:Wow, after all this effort I believe I still need to learn to use vectors with dcs and lua script. It's the only way to get proper values for what we need. I don't understand why this wasn't clear to me before, but there's another problem associated with the bank value when used for bank speed. When you fly loops, the bank changes very rapidly from say +10 to -160 (anticlockwise). This is hard to eliminate as it is not a spike but a rapidly but smoothly changing value. In reality, your plane didn't do any movement around the roll axis, but the stupid instrument (ADI) thinks in a different way.

The software Tacview (see in action here https://www.youtube.com/watch?v=rQK0zvl4l3c) obviously gets quality data about the orientation of aircraft. I need to get my hands on how to do it with export.lua.
This is how tacview does it: http://lomac.strasoftware.com/download/ ... ortDCS.lua

Export.lua says the following:
--[[
LUA_PATH = "?;?.lua;./Config/Export/?.lua"
require 'Vector'
-- See the Config/Export/Vector.lua file for Vector class details, please.
--]]

However, I can't get this working, no matter what.

If anyone knows vector math (&DCS, & lua script) now would be a good time to register to this forum and help us out. Would you(Sirnoname) happen to master this? See here the description of vectors in DCS.
http://en.wiki.eagle.ru/wiki/Simulator_ ... 2.1/Part_1


Still testing. There's no more the original bank speed spike problem, that is gone.

Btw, I think we shouldn't add anything extra to user4,5,6 because there is a very good chance that export.lua won't work. For example, you see this in export.lua:

--local angle = LoGetAngleOfAttack()
local angle = 0

Why don't we use the LoGetAngleOfAttack() ? Because this works only with some aircraft, not all of them! So, if you fly a mission where you can select from a list of different aircrafts, you would notice that with some aircraft DCS plugin values read all 0.00 and it says connected. This would confuse the hell out of people. ("This just worked, what the.. Why doesn't this aircraft give values? The other just did?")

-L



Indeed...this is the problem. The old LockOn Values work more or less with every Aircraft, but this values are wrong sometimes. The real DCS vectors like Pos3.x are pending on the aircraft. Also you have to determinate Player ID to get values, like this:

local lACid = LoGetPlayerPlaneId() or 0
if lACid > 0 then
ac = LoGetSelfData(lACid)
--Position im Raum
xpos = ac.Position.x
ypos = ac.Position.y
zpos = ac.Position.z

--Ausrichtung
xdir = ac.Heading
ydir = ac.Pitch
zdir = ac.Bank


daten = string.format("%.1f#%.1f#%.1f#%.1f#%.1f#%.1f", xpos, ypos, zpos, xdir, ydir, zdir)
"No Brain, No Pain"

3DOF 360° Full Motion Simulator with Valve Index, AMD Ryzen 7, 32GB mem; Gigabyte Board UHD; GTX2080; Samsung M.2 SSD; Thrustmaster Warthog with FFB; Saitek Pro Pedals, Lilliputs & TM MFDs, Body Shaker + 5.1,
User avatar
asticher
 
Posts: 102
Images: 20
Joined: Wed 5. Sep 2012, 20:18
Location: Germany near Munich
Has thanked: 6 times
Been thanked: 1 time

Re: DCS A10 Support?

Postby asticher » Mon 27. Jul 2015, 00:04

I have a new problem with the vectors:
Bank is a relative vector, it mesures the position of Aircraft relative to the horizon.
Now image what´s happen if you´re climb with a pitch of 90°...right, the bankangle goas crazy form 0° to 180°.
And this happens in my 360° Pit.
What i need now is a vector of the absolute Roll angle of the Aircraft.
And someone who can add it in the DCS Plugin.
I´m not sure, but pos3.x could be the right vector.
Any suggestions, hints, questions are welcome!
Response time <1 days is promised :-D

Update: Some Thirdparty Developer from DCS explaint the Vector Problem like this (german only sry):

Erklärung:
yaw , pitch, roll ist differenziert zu betrachten. Es handelt sich in DCS um sequentielle Achsendrehungen, die in einer bestimmten, festgelegten Reihenfolge erfolgen.

Das Lageergebnis kann speziell bei extremen Fluglagen zu nicht verwertbaren Ergebnissen führen.
Wenn z.B Pitch = 180 und Roll = 180 dann würde, wenn Roll allein betrachtet wird, das Flugzeug im Rückenflug fliegen.
Da aber Pitch = 180 vorliegt, fliegt das Flugzeug nach allen Achsdrehungen in normaler Fluglage, auf invertiertem Kurs.

Um eine Simulator Plattform zu steuern kann man die die Yaw, Pitch und Roll Werte direkt in die Mechanik übernehmen.
Da bei der Simulationsplattform die Heading nicht simuliert wird, kann auf die Yaw Drehung verzichtet werden.
Auch hier ist die Reihenfolge wichtig.

Stimmt die Reihenfolge der Drehungen nicht, bekommt man ein falsches Ergebnis.

Der Trick an der Geschichte ist, dass die Drehungen immer auf einer vorausgegangenen Drehung beruhen!

Angenommen, die Längsachse des Lfz wird mit ‚W‘ bezeichnet und die Querachse mit ‚U‘.
Bei einer Drehung von 180 ° um ‚U‘ (Pitch) wird die W-Achse verändert.
Das LFz liegt jetzt mit seiner Längsachse (W) auf dem Rücken.
Wird jetzt ein Bank von 180 ° eingegeben, dann erfolgt die Drehung um die neue Lage der ‚W‘ Achse.
Das LFz ist wieder in Normallage, fliegt aber in entgegengesetzter Richtung.
Diese Bewegung wird z.B. bei einem Immelmann durchgeführt.
Wenn z.B.bei einem Simulator die Längsachse (bank) fest verbaut ist und Pitch beweglich in der Längsachse eingebaut ist,
dann funktioniert die oben beschriebene Prozedur nicht.

Bei 90 ° Pitch würde ein Bank eine Yaw Drehung erzeugen.
Bei nur zwei Freiheitsgraden wird die Sache kompliziert, ist aber lösbar.
Bank muss in Abhängigkeit vom Cosinus des Pitch gesetzt werden.
D.H. bei +-90° Pitch ist Bank immer 0.0, bei Pitch 0° oder 180° kommt Bank voll zum tragen.
Bank = Bank * fabs(cos(Pitch)). Mit ‚fabs‘ wird der Cosinus im positiven Bereich gehalten.
Andernfalls banked das LFz bei übeschreiten von +-90° Pitch zur anderen Seite.
"No Brain, No Pain"

3DOF 360° Full Motion Simulator with Valve Index, AMD Ryzen 7, 32GB mem; Gigabyte Board UHD; GTX2080; Samsung M.2 SSD; Thrustmaster Warthog with FFB; Saitek Pro Pedals, Lilliputs & TM MFDs, Body Shaker + 5.1,
User avatar
asticher
 
Posts: 102
Images: 20
Joined: Wed 5. Sep 2012, 20:18
Location: Germany near Munich
Has thanked: 6 times
Been thanked: 1 time

Re: DCS A10 Support?

Postby RiftFlyer » Wed 16. Dec 2015, 23:47

Any further work on migrating from lock-on to a dedicated DCS World plugin?

Is the lua script and instructions on page 2 still the preferred method?

I am currently trying to setup with DCS 1.5 but lock-on is not seeing any data!
RiftFlyer
 
Posts: 29
Images: 22
Joined: Wed 23. Apr 2014, 22:20
Has thanked: 2 times
Been thanked: 0 time

Re: DCS A10 Support?

Postby BrassEm » Thu 17. Dec 2015, 03:41

RiftFlyer wrote:I am currently trying to setup with DCS 1.5 but lock-on is not seeing any data!


I am currently at work but I will post my export.lua tonight and run through the "notepad" method of getting the DCS module (Su-25 screen version) working. (I've not updated to 1.5 yet but the export should be the same. Good to see you back on the project!)

EDIT;

This Export.lua code snippet sets up an export.log file in the main DCSWorld directory - not the saved games directory. The file output code can be removed as it was used for diagnosis. Plus X-Sim has an export feature as well that I found afterwards.

I've left the UDP "C" socket and added another UDP socket "X" for the X-SIM connection. This may be just a duplicate broadcast but I have other apps talking as well that may bind ports. So better to be on the safe side at the moment, and it works for X-Sim.

Code: Select all
-- DCS Export Functions
function LuaExportStart()
-- Works once just before mission start.

   default_output_file = io.open("./Export.log", "w")
   
    -- 2) Setup udp sockets to talk to helios
    package.path  = package.path..";.\\LuaSocket\\?.lua"
    package.cpath = package.cpath..";.\\LuaSocket\\?.dll"
   
    socket = require("socket")
   
    c = socket.udp()
   c:setsockname("*", 0)
   c:setoption('broadcast', true)
    c:settimeout(.001) -- set the timeout for reading the socket
   
   -- Setup sockets to talk to X-SIM (x)
   host = host or "localhost"
   port = port or 8080
   x = socket.try(socket.connect(host, port)) -- connect to the listener socket
   x:setoption("tcp-nodelay",true) -- set immediate transmission mode   
   
   
end

function LuaExportBeforeNextFrame()
   ProcessInput()
end

function LuaExportAfterNextFrame()   
local t = LoGetModelTime()
local altBar = LoGetAltitudeAboveSeaLevel()
local altRad = LoGetAltitudeAboveGroundLevel()
local pitch, bank, yaw = LoGetADIPitchBankYaw()
local vel = LoGetVerticalVelocity() -- Doesn't appear to be used.
local angle = LoGetAngleOfAttack()  -- Okay with... Su-27. Test other aircraft.
local accel = LoGetAccelerationUnits()
local trueairspeed = LoGetTrueAirSpeed()
local slipball = LoGetSlipBallPosition()
-- local flightcontrolPitch - LoGet()
-- local flightcontrolRoll - LoGet()
-- local flightcontrolYaw - LoGet()
-- get engines rpm from cockpit panel:
-- local lDevice = GetDevice(0)
-- local engineRPM = lDevice:get_argument_value(76) + lDevice:get_argument_value(77)
local scaler = 1000.0 -- Change this value to alter the feed into X-Sim. A multiplier of 1.0 = 1.0 G on the helper but the converter values get lower also
local user1 = accel.x*scaler
-- local user2 = (accel.y-1)*1000.0
local user2 = accel.y*scaler
local user3 = accel.z*scaler
local user4 = vel --engineRPM for Bergison Seat Shaker. Tried Vel which is the VSI component. Make Pilot Pitch Stick position
local user5 = 5 -- Make Pilot Roll Stick position
local user6 = 6 -- Make Pilot Rudder Pedal position
local user7 = 7 -- ADDED TO MAKE IT WORK - Variable counting seems off.

-- Output to Export.log file.
default_output_file:write(string.format("t:, %.3f, altBar:, %.2f, altRad:, %.2f, pitch:, %.2f, bank:, %.2f, yaw:, %.2f, ACCEL:, %.2f, AOA:, %.2f, G-LOAD:, %.2f, accel.z:, %.2f, user1:, %.2f, user2:, %.2f, user3:, %.2f, user4:, %.2f, user5:, %.2f, user6:, %.2f\n", t, altBar, altRad, pitch*scaler, bank*scaler, yaw*scaler, accel.x*scaler, angle*scaler, accel.y*scaler, accel.z*scaler, user1, user2, user3, user4, user5, user6, user7))


if x then
-- Output to X-Sim
socket.try(x:send(string.format("%.3f %.2f %.2f %.2f %.2f %.2f %.2f %.2f %.2f %.2f %.2f %.2f %.2f %.2f %.2f %.2f %.2f \n", t,
altRad, altBar, pitch*scaler, bank*scaler, yaw*scaler, accel.x*scaler, angle*scaler, accel.y*scaler, accel.z*scaler,
user1, user2, user3, user4, user5, user6, user7)))

-- socket.try(x:send(string.format("user1 = %.2f, user2 = %.2f, user3 = %.2f \n", user1, user2, user3)))
end

end

function LuaExportStop()
-- Works once just after mission stop.
c:close()

if default_output_file then
default_output_file:close()
default_output_file = nil
end

socket.try(x:send("quit")) -- to close the listener socket
x:close()

end

-- Further down in Export.lua

function FlushData()
   if #gSendStrings > 0 then
      local packet = gSimID .. table.concat(gSendStrings, ":") .. "\n"
      socket.try(c:sendto(packet, gHost, gPort))
      gSendStrings = {}
      gPacketSize = 0
   end
end



Your will need the DCSImport files in "Test3.zip" on page 9 of this thread copied to the plugin X-Sim directory.

Start the extractor and click on "Add your games/wizard".

Click "Open advanced and manual setup" in the new Heuristic game wizard dialog box.
It will then expand out.

Click on the "..." button to "Locate your game executable manually". In this case notepad.exe.

Enter your "Game Name" i.e. DCS WORLD

From the drop down list "Plugin to Use", there should now be a DCSPlugin option. Click it to select it.

Click on "Add this game to the game list in the main dialog" button. And from memory it should now be listed on the left under the Game library in Motion Extractor.

Left click it so it is listed in the Profilename box. You can edit the details on the right to suit the profile.

Click on the "Motion|Driver" button on the bottom right of the Motion Extractor. Then click on the "Telemetry Plugin" on the left of the new Motion Driver Setup dialog.

Make sure the radio button on the left of the DCSPlugin is selected. On the right you will see the effects listing for the plugin. The bottom one is what actually gets sent to X-Sim. (Don't really need to change anything there.)

Close the Extractor and reload it. I believe this time the extractor, the converter, AND the DCS "Helper" will load up. (Check task bar) When the helper is clicked the DCS World "Flight Recorder" should expand with the nice SU-25 pic. I have two monitors so I drag this off so I can see the helper when DCS is running. Make sure the profile is selected and click the "Play Game" button. Notepad should now run. Resize and drag this "placeholder" off to the side. As long as it is running X-SIM will be happy. PLUS this also ESTABLISHES CONNECTION to the CONVERTER if you are running over different PC's :oops: .

All being well, in the Converter you should see the variables displayed that were shown via the "Telemetry Plugin" dialog. The primary effects being;
27 = Longitudinal = Acceleration
29 = Heave = G's
30 = Lateral = Slip

Now start up DCS World. Load up your mission. Only when you are in cockpit will the helper start showing data in the "flight recorder". Click on the "Start" button on the Converter to get data out to the X-PID boards.

I hope this helps.

Then there is the X-PID and Math setups...


.
User avatar
BrassEm
 
Posts: 13
Images: 66
Joined: Mon 16. Mar 2015, 01:28
Location: NE of YMML
Has thanked: 1 time
Been thanked: 3 times

Re: DCS A10 Support?

Postby RiftFlyer » Thu 17. Dec 2015, 09:58

Thanks a million.

I did manage to get lock-on reading data from DCS last night but the 'play game' button failed to launch notepad or open the converter. It displayed a socket error message.

I'll use your lua script and add the DCS plugin tonight and see if I get better results. I have been away from the project for so long I've to reread a lot of the documents. I'm hopeful I can push on and get it working this time. I have to have it working for the rift launch in the new year! :-) thanks again for your help.
RiftFlyer
 
Posts: 29
Images: 22
Joined: Wed 23. Apr 2014, 22:20
Has thanked: 2 times
Been thanked: 0 time

Re: DCS A10 Support?

Postby RiftFlyer » Thu 17. Dec 2015, 23:27

Sucess! Thanks BrassEm.

I had a recurrence of the socket error. I reinstalled X-Sim and now have the DCS profile loaded and running with data displayed in the converter.

Unfortunately my X-sim 3D-simulation crashes on startup so I will have to figure out the math setup in the real world.

Once I have mechanically setup my actuators and have end points set in XPID am I assured that the converter won't try and overdrive past the limits?
If so I should be good to start experimenting with the math setup!
RiftFlyer
 
Posts: 29
Images: 22
Joined: Wed 23. Apr 2014, 22:20
Has thanked: 2 times
Been thanked: 0 time

Re: DCS A10 Support?

Postby BrassEm » Fri 18. Dec 2015, 08:16

Great to hear your up and communicating with DCS WORLD Riftflyer!

I am not sure what you mean by X-SIM crashes? (From your videos it looks like you are set with the XPID.)

I believe all being well, as soon as a feedback voltage limit is seen then the motor will stop and no physical crash should occur. Great when everything is working as it should.

However a break in the pot wiring, the pot coming loose, a wrong connection or an electronic problem will cause the motor to run away and physically crash to the mechanical stop if there is one. If the motor is not fused then the motor or driver can burn out.

For this very reason I am modifying the X-PID software to add a limit switch sense (as non-intrusive as possible) for the motors to stop them before they physically crash and stall (A stalled motor is effectively a short circuit. My motors are fused but I don't know how much damage will be done before the fuse pops.) I will need to verify the publishing requirements before I post the modified XPID online - hopefully over the weekend. Plus I still need to physically mount the limit switches into the mechanism.

I have been using two M8 nuts to pinch tight either side onto the motor crank arm for testing purposes only. On a physical crash the nuts slide off freeing the motor crank arm and not stalling the motor. No load on the actuators of course.

As far as the math is concerned I have reverted to one effect input only, using a throttle pot as a joystick command input via the X-Sim software. (Not worrying about firing up DCS WORLD to test the inputs just yet.) I am not getting smooth transitions of movement as per the throttle command so XPID and math adjustment are needed. That is as far as I've got so far. Once I've got the limits sorted I will continue with the adjustments.

.
User avatar
BrassEm
 
Posts: 13
Images: 66
Joined: Mon 16. Mar 2015, 01:28
Location: NE of YMML
Has thanked: 1 time
Been thanked: 3 times

Re: DCS A10 Support?

Postby leviron0 » Sat 30. Apr 2016, 20:44

Hello,

first of all thank you for all your efforts guys, I do appreciate it all.

I've done exactly what you guys wrote in this thread (with the notepad file and the lua file) but in the lockon telemetrie all values stay on 0 (no connections).

Can you give me some ideas on what can I try in order to make a connection?

BTW the converter seems to work (it connects and the ingame joyaxis are working).

Thanks,
leviron0
 
Posts: 3
Joined: Sun 20. Dec 2015, 20:50
Has thanked: 0 time
Been thanked: 0 time

PreviousNext

Return to Digital Combat Simulator Series

Who is online

Users browsing this forum: No registered users and 1 guest