PDA

View Full Version : Simple DeviceLink autopilot



lindyman
05-21-2004, 08:41 AM
This one's not perfect, but it does reasonably well.

What it does?

It strives to keep the wings level and the ball centered. It also strives to keep vertical airspeed 0. Note that it's not a true altitude hold. If it begins to sink, it will compensate until the vertical speed is 0, but it will not try to regain the lost altitude.

It is also completely unaware of unpleasant things like stall. In fact, if you stall the plane, you're pretty much guaranteed to get a really nasty spin, becuase the autopilot will try to compensate the sink with up-elevator, the sideslip with rudder into the spin, and the tilt with counter aileron; all-in-all textbook spin settings.

It's easy to examine stall speed with it. Stall speed is not where it loses it completely, but when it becomes unable to stop the sinking.

It's also good for testing acceleration and desceleration. It will climb/sink somewhat in these tests, but not more than a few meters, and I don't think that will have a tremendous impact.

It's worth noting that the control numbers (PID)_(roll/slip/alt) are ballpark figures. For a really good one, you'd need to have unique numbers for each and every aircraft. These numbers seem to do a good job with most aircraft though.

Enjoy.
<pre class="ip-ubbcode-code-pre">
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <errno.h>
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#include <sys/poll.h>


#define P_roll +6
#define I_roll +0.01
#define D_roll -3

#define P_slip -20
#define I_slip -0.005
#define D_slip +0.0005

#define P_alt -0.08
#define I_alt -0.0002
#define D_alt +4

enum {
indicated_airspeed = 30,
vertical_airspeed = 32,
sideslip = 34,
altimeter = 40,
azimuth = 42,
roll = 46,
pitch = 48,
aileron = 84,
elevator = 86,
rudder = 88
};
static double v[256];
static double dvdt[256];
static double roll_integral = 0.0;
static double slip_integral = 0.0;
static double alt_integral = 0.0;
static double aileron_divisor = 1.0;
static double desired_alt = 0.0;


int main(void)
{
struct timespec timestamp;
int sock;
struct sockaddr_in other_end;
struct sockaddr_in this_end;
int timeout_count = 0;
int missed_tick = 0;
int n;
for (n=0; n < sizeof(v)/sizeof(v[0]); ++n)
{
v[n]=0.0;
dvdt[n]=0.0;
}
other_end.sin_port = htons(10000);
other_end.sin_addr.s_addr = inet_addr("192.168.1.3");
other_end.sin_family = AF_INET;
memset(&other_end.sin_zero, 0, sizeof(other_end.sin_zero));
sock = socket(AF_INET, SOCK_DGRAM, 0);
if (sock < 0)
{
perror("socket failed");
return errno;
}

this_end.sin_port=htons(0);
this_end.sin_addr.s_addr=htons(INADDR_ANY);
this_end.sin_family=AF_INET;
memset(&this_end.sin_zero, 0, sizeof(this_end.sin_zero));
if (bind(sock, &this_end, sizeof(this_end)) < 0)
{
perror("bind");
errno=0;
goto close_sock;
}
clock_gettime(CLOCK_MONOTONIC, &timestamp);
for (;;)
{
struct timespec now;
struct pollfd fd = { sock, POLLIN|POLLERR|POLLHUP, 0 };
clock_gettime(CLOCK_MONOTONIC, &now);
int timeout = (timestamp.tv_nsec - now.tv_nsec + 1010000000) % 1000000000;
int n = poll(&fd, 1, timeout/1000000);
if (!n)
{
static const char cmd[] = "R/30/32/34/36/38/40/42/46/48/64/";
if (sendto(sock, cmd, sizeof(cmd), 0, &other_end, sizeof(other_end)) < sizeof(cmd))
{
perror("sendto");
errno=0;
break;
}
missed_tick = 1;
if (++timeout_count == 5)
{
timeout_count = 0;
printf("v=%5.2f acc=%5.2f alt=%6.1f heading=%4.1f pitch=%4.2f roll=%4.2f\r",
v[indicated_airspeed],
dvdt[indicated_airspeed]/3.6,
v[altimeter],
v[azimuth],
v[pitch],
v[roll]);
fflush(stdout);
}
}
else
{
static char buff[1024];
size_t len = recvfrom(sock, buff, sizeof(buff), 0, NULL, NULL);
if (len < 0)
{
perror("recvfrom");
errno=0;
break;
}
if (buff[0]='A')
{
struct timespec now;
const char *p = buff+1;
clock_gettime(CLOCK_MONOTONIC, &now);
unsigned nsdelay=(1000000000 + now.tv_nsec - timestamp.tv_nsec) % 1000000000;
timestamp = now;
while (p < buff+len)
{
unsigned long obj;
double val;
if (*p == '/')
{
char *end;
obj=strtoul(p+1, &end, 0);
p=end;
}
if (*p == '\\')
{
char *end;
val=strtod(p+1, &end);
p=end;
}
{
double oldval = v[obj];
switch (obj)
{
case roll:
case sideslip:
val/=360;
break;
}
v[obj]=val;
dvdt[obj]=(val-oldval)*nsdelay/1000000000;
if (obj == vertical_airspeed)
{
double elevator_v;
char str[20];
ssize_t len;
double ai;
ai = alt_integral+val;
if (fabs(ai) < 2000.0) alt_integral=ai;
elevator_v = P_alt*val+I_alt*alt_integral+D_alt*dvdt[vertical_airspeed];
if (fabs(elevator_v) > 1.0)
{
elevator_v/=fabs(elevator_v);
}
len = snprintf(str, sizeof(str), "R/%d\\%2.5f", elevator+1, elevator_v);
if (len > sizeof(str)) len = sizeof(str);
sendto(sock, str, len, 0, &other_end, sizeof(other_end));
}
if (obj == sideslip)
{
double rudder_v;
char str[20];
ssize_t len;
double si = slip_integral+val;
if (fabs(si) < 20.0) slip_integral = si;
rudder_v = P_slip*val+I_slip*slip_integral+D_slip*dvdt[sideslip];
if (fabs(rudder_v) > 1.0)
{
rudder_v/=fabs(rudder_v);
}
len = snprintf(str, sizeof(str), "R/%d\\%2.5f", rudder+1, rudder_v);
if (len > sizeof(str)) len = sizeof(str);
sendto(sock, str, len, 0, &other_end, sizeof(other_end));
}
if (obj == roll)
{
double aileron_v;
char str[20];
ssize_t len;
double ri = roll_integral+val;
if (fabs(ri) < 20.0) roll_integral=ri;
aileron_v = P_roll*val+I_roll*roll_integral+D_roll*dvdt[roll];
if (fabs(aileron_v) > 1.0)
{
aileron_v/=fabs(aileron_v);
}
len = snprintf(str, sizeof(str), "R/%d\\%2.5f", aileron+1, aileron_v);

if (len > sizeof(str)) len = sizeof(str);
sendto(sock, str, len, 0, &other_end, sizeof(other_end));
}
}
}
}
missed_tick = 0;
}
}
close_sock:
if (errno) perror("Leaving");
close(sock);
return errno;
}
</pre>

Hope you can do something useful with it. I'm thinking of trying to make it an absolute altitude hold, but I'm not in a hurry and if someone's tempted to do so, please go ahead. The code is public domain and I couldn't care less what you do with it, as long as you don't blame me if you run into trouble because of it.
_
/Bjorn.

lindyman
05-21-2004, 08:41 AM
This one's not perfect, but it does reasonably well.

What it does?

It strives to keep the wings level and the ball centered. It also strives to keep vertical airspeed 0. Note that it's not a true altitude hold. If it begins to sink, it will compensate until the vertical speed is 0, but it will not try to regain the lost altitude.

It is also completely unaware of unpleasant things like stall. In fact, if you stall the plane, you're pretty much guaranteed to get a really nasty spin, becuase the autopilot will try to compensate the sink with up-elevator, the sideslip with rudder into the spin, and the tilt with counter aileron; all-in-all textbook spin settings.

It's easy to examine stall speed with it. Stall speed is not where it loses it completely, but when it becomes unable to stop the sinking.

It's also good for testing acceleration and desceleration. It will climb/sink somewhat in these tests, but not more than a few meters, and I don't think that will have a tremendous impact.

It's worth noting that the control numbers (PID)_(roll/slip/alt) are ballpark figures. For a really good one, you'd need to have unique numbers for each and every aircraft. These numbers seem to do a good job with most aircraft though.

Enjoy.
<pre class="ip-ubbcode-code-pre">
#include &lt;sys/types.h&gt;
#include &lt;sys/socket.h&gt;
#include &lt;netinet/in.h&gt;
#include &lt;arpa/inet.h&gt;
#include &lt;errno.h&gt;
#include &lt;stdio.h&gt;
#include &lt;time.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;sys/poll.h&gt;


#define P_roll +6
#define I_roll +0.01
#define D_roll -3

#define P_slip -20
#define I_slip -0.005
#define D_slip +0.0005

#define P_alt -0.08
#define I_alt -0.0002
#define D_alt +4

enum {
indicated_airspeed = 30,
vertical_airspeed = 32,
sideslip = 34,
altimeter = 40,
azimuth = 42,
roll = 46,
pitch = 48,
aileron = 84,
elevator = 86,
rudder = 88
};
static double v[256];
static double dvdt[256];
static double roll_integral = 0.0;
static double slip_integral = 0.0;
static double alt_integral = 0.0;
static double aileron_divisor = 1.0;
static double desired_alt = 0.0;


int main(void)
{
struct timespec timestamp;
int sock;
struct sockaddr_in other_end;
struct sockaddr_in this_end;
int timeout_count = 0;
int missed_tick = 0;
int n;
for (n=0; n &lt; sizeof(v)/sizeof(v[0]); ++n)
{
v[n]=0.0;
dvdt[n]=0.0;
}
other_end.sin_port = htons(10000);
other_end.sin_addr.s_addr = inet_addr("192.168.1.3");
other_end.sin_family = AF_INET;
memset(&other_end.sin_zero, 0, sizeof(other_end.sin_zero));
sock = socket(AF_INET, SOCK_DGRAM, 0);
if (sock &lt; 0)
{
perror("socket failed");
return errno;
}

this_end.sin_port=htons(0);
this_end.sin_addr.s_addr=htons(INADDR_ANY);
this_end.sin_family=AF_INET;
memset(&this_end.sin_zero, 0, sizeof(this_end.sin_zero));
if (bind(sock, &this_end, sizeof(this_end)) &lt; 0)
{
perror("bind");
errno=0;
goto close_sock;
}
clock_gettime(CLOCK_MONOTONIC, &timestamp);
for (;;)
{
struct timespec now;
struct pollfd fd = { sock, POLLIN|POLLERR|POLLHUP, 0 };
clock_gettime(CLOCK_MONOTONIC, &now);
int timeout = (timestamp.tv_nsec - now.tv_nsec + 1010000000) % 1000000000;
int n = poll(&fd, 1, timeout/1000000);
if (!n)
{
static const char cmd[] = "R/30/32/34/36/38/40/42/46/48/64/";
if (sendto(sock, cmd, sizeof(cmd), 0, &other_end, sizeof(other_end)) &lt; sizeof(cmd))
{
perror("sendto");
errno=0;
break;
}
missed_tick = 1;
if (++timeout_count == 5)
{
timeout_count = 0;
printf("v=%5.2f acc=%5.2f alt=%6.1f heading=%4.1f pitch=%4.2f roll=%4.2f\r",
v[indicated_airspeed],
dvdt[indicated_airspeed]/3.6,
v[altimeter],
v[azimuth],
v[pitch],
v[roll]);
fflush(stdout);
}
}
else
{
static char buff[1024];
size_t len = recvfrom(sock, buff, sizeof(buff), 0, NULL, NULL);
if (len &lt; 0)
{
perror("recvfrom");
errno=0;
break;
}
if (buff[0]='A')
{
struct timespec now;
const char *p = buff+1;
clock_gettime(CLOCK_MONOTONIC, &now);
unsigned nsdelay=(1000000000 + now.tv_nsec - timestamp.tv_nsec) % 1000000000;
timestamp = now;
while (p &lt; buff+len)
{
unsigned long obj;
double val;
if (*p == '/')
{
char *end;
obj=strtoul(p+1, &end, 0);
p=end;
}
if (*p == '\\')
{
char *end;
val=strtod(p+1, &end);
p=end;
}
{
double oldval = v[obj];
switch (obj)
{
case roll:
case sideslip:
val/=360;
break;
}
v[obj]=val;
dvdt[obj]=(val-oldval)*nsdelay/1000000000;
if (obj == vertical_airspeed)
{
double elevator_v;
char str[20];
ssize_t len;
double ai;
ai = alt_integral+val;
if (fabs(ai) &lt; 2000.0) alt_integral=ai;
elevator_v = P_alt*val+I_alt*alt_integral+D_alt*dvdt[vertical_airspeed];
if (fabs(elevator_v) &gt; 1.0)
{
elevator_v/=fabs(elevator_v);
}
len = snprintf(str, sizeof(str), "R/%d\\%2.5f", elevator+1, elevator_v);
if (len &gt; sizeof(str)) len = sizeof(str);
sendto(sock, str, len, 0, &other_end, sizeof(other_end));
}
if (obj == sideslip)
{
double rudder_v;
char str[20];
ssize_t len;
double si = slip_integral+val;
if (fabs(si) &lt; 20.0) slip_integral = si;
rudder_v = P_slip*val+I_slip*slip_integral+D_slip*dvdt[sideslip];
if (fabs(rudder_v) &gt; 1.0)
{
rudder_v/=fabs(rudder_v);
}
len = snprintf(str, sizeof(str), "R/%d\\%2.5f", rudder+1, rudder_v);
if (len &gt; sizeof(str)) len = sizeof(str);
sendto(sock, str, len, 0, &other_end, sizeof(other_end));
}
if (obj == roll)
{
double aileron_v;
char str[20];
ssize_t len;
double ri = roll_integral+val;
if (fabs(ri) &lt; 20.0) roll_integral=ri;
aileron_v = P_roll*val+I_roll*roll_integral+D_roll*dvdt[roll];
if (fabs(aileron_v) &gt; 1.0)
{
aileron_v/=fabs(aileron_v);
}
len = snprintf(str, sizeof(str), "R/%d\\%2.5f", aileron+1, aileron_v);

if (len &gt; sizeof(str)) len = sizeof(str);
sendto(sock, str, len, 0, &other_end, sizeof(other_end));
}
}
}
}
missed_tick = 0;
}
}
close_sock:
if (errno) perror("Leaving");
close(sock);
return errno;
}
</pre>

Hope you can do something useful with it. I'm thinking of trying to make it an absolute altitude hold, but I'm not in a hurry and if someone's tempted to do so, please go ahead. The code is public domain and I couldn't care less what you do with it, as long as you don't blame me if you run into trouble because of it.
_
/Bjorn.

GBOF
05-21-2004, 09:37 AM
It sounds very interesting.... but I don't have a clear idea of what this system should do, I mean the link in general.

How should I set up my PC to have this working? and what it is advantage?

I'm trying to figure out how I can improve my flight sim experience.

First I need a main PC with IL2FB AEP installed, then I need a second PC connected via LAN (I suppose). On the second PC I launch the program you mentioned (I guess I should be able to compile it, BTW which is the language I shall use?) After that, I should be able to controll the sim remotelly by the second PC. I could also retrieve some data from the sim.

Am I correct?

Please, explain this, because I'm interested but as usual there's no enough info about expecially for noob like me http://ubbxforums.ubi.com/infopop/emoticons/icon_smile.gif

Can someone post a block diagram about it should work?

I really thanks anyone who can give me some info

Regards,
GBOF

Fillmore
05-21-2004, 09:46 AM
http://ubbxforums.ubi.com/images/smiley/11.gif

I am afraid I am not the sort to be inclined to be using this, but I applaud those who are, I think this is a great leap forward for testing of FMs.

and a big http://ubbxforums.ubi.com/images/smiley/11.gif to Oleg, who put this in here for us.

lindyman
05-21-2004, 09:46 AM
<BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>Originally posted by GBOF:
How should I set up my PC to have this working? and what it is advantage?
<HR></BLOCKQUOTE>

It has no advantage at all, unless you consider help with flying straight and level to be helpful. The reason I wrote it is for aircraft performance tests. It's not easy to keep track of everything manually. So, here's a tool that can hold the thing straight and level at whatever altitude you activate it at, and then you can do your tests and fiddle with throttle, mixture, prop-pitch, flaps, whatever...

I'm sorry to say, that unless you're reasonably familiar with software development, the program is of little use, since you'll have to compile it to run it. I run it on a separate computer.


<BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>Originally posted by GBOF:
I'm trying to figure out how I can improve my flight sim experience.
<HR></BLOCKQUOTE>

Then this is is probably not the program you want, unless you mean that you want to know exactly what AoA is the critical one for a certain aircraft.

_
/Bjorn.

BaldieJr
05-21-2004, 12:19 PM
Nice work lindyman.

Can you assist me in a few things I don't know?

angular_speed
azimuth
beacon_azimuth
temp_oilin/temp_oilout

I am not sure i understand these. Angular_speed is roll speed, i think. Azimuth/beacon_a*, I think, deal with heading?
oiltemp: in and out of what?

Any help appreciated.

<pre class="ip-ubbcode-code-pre">
My Specs (read 'em and weep):
* Automatically grinds whole beans before brewing
* Fully programmable 24 hours in advance
* Brew Pause feature lets you enjoy a cup before brewing has finished
* Automatically shuts off when brewing is complete
* Grind-off feature for brewing ground coffee
* 1-4 cup feature to accommodate coffee for one
* 10-cup double-wall insulated thermal carafe to keep your coffee hot long after brewing
* Gold tone commercial-style permanent filter eliminates the need to buy coffee filters
* Charcoal water filter removes impurities from the water
* Separate grinder chamber and filter area allow for easy cleanup
* Limited 3-year warranty
</pre>

GCMC_Soron
05-21-2004, 12:26 PM
Thanks you to share this to us. Can we use it as we want? (I'll continue to share all prog realized with this and with sources code)

here a
French Post on DeviceLink discussions (http://www.checksix-forums.com/forums/index.php?showtopic=36510&st=0) where I include a reference to your post. It's in french sorry

We are talking about a project to create a full virtual cockpit like this one :
Project Magenta (http://www.projectmagenta.com/products/i/c.jpg)

but for IL2, Free and open source, with pannel (gauges etc...) easely custom-izable to put Historic ones.

My first Idea is to use sources code from the 2D cockpit of this project :http://flightgear.org/

There 2D cockpit use XML configs for customize the pannel like Fligth simulator. So later it will be easy for who want to make wath he want.

in this post also, are sources code for a simple Visual Basic application getting data from device link. It's simple etc but can be used as a begining :
IL2Panel.zip (http://home.tiscali.be/mstilmant/divers/il2/IL2Panel/IL2Panel1.zip)
note: I perhaps badly use the winsock object. If there are some visual basic experts who can correct me, thanks.

[This message was edited by GCMC_Soron on Fri May 21 2004 at 11:46 AM.]

lindyman
05-21-2004, 12:47 PM
azimuth is heading (the direction the nose points, not necessarily the direction you're travelling, with respect to wind, sideslip, etc.)

beacon_azimuth probably that thing you see in the 109s that points to something undefined. I think it's the nearest airfield or something such.

angular_speed I think is in a turn, how many degrees per sec you change your heading.


temp_oilin/temp_oilout Not sure, but a wild guess is that oilin is the temp of the oil when it enters the engine, and oilout when it leaves the engine.

BTW, I've added a true altitude hold mode that usually compensates power and flap changes within less than 1.5m altitude. With that I can now verify that ground effect is absolutely modeled in AEP. At 3m altitude over sea, the CR50 needs about -.3 degrees nose down attitude at max power. At 20m altitude, it stays level at max power with -.08 or so degrees nose down attitude. Stall speed also goes down at 3m, but it's not easy to tell exactly since there's very little margin for error there.
_
/Bjorn.

GCMC_Soron
05-21-2004, 12:54 PM
On this picture
http://home.tiscali.be/mstilmant/divers/il2/IL2Panel/IL2Panel04.jpg ]
I use ActiveX gauges from Global Majic Software Aircraft Gauges (http://www.globalmajic.com/products.asp?PTID=4)
It's easy to add them to the visual basic application, but there are not free, and version downloadable from their site are limited in time.

BaldieJr
05-21-2004, 01:35 PM
Ah, thanks.

Nice work by all! I like the VB app: cool stuff.

Also check out opengc ( www.opengc.org (http://www.opengc.org) ) for glass guages... its free http://ubbxforums.ubi.com/infopop/emoticons/icon_smile.gif

Exciting stuff, be sure.

<pre class="ip-ubbcode-code-pre">
My Specs (read 'em and weep):
* Automatically grinds whole beans before brewing
* Fully programmable 24 hours in advance
* Brew Pause feature lets you enjoy a cup before brewing has finished
* Automatically shuts off when brewing is complete
* Grind-off feature for brewing ground coffee
* 1-4 cup feature to accommodate coffee for one
* 10-cup double-wall insulated thermal carafe to keep your coffee hot long after brewing
* Gold tone commercial-style permanent filter eliminates the need to buy coffee filters
* Charcoal water filter removes impurities from the water
* Separate grinder chamber and filter area allow for easy cleanup
* Limited 3-year warranty
</pre>

lindyman
05-21-2004, 01:42 PM
<BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>Originally posted by GCMC_Soron:
Thanks you to share this to us. Can we use it as we want? (I'll continue to share all prog realized with this and with sources code)
<HR></BLOCKQUOTE>

As mentioned earlier, you're free to do whatever you please with it, as long as you don't blame me if anything happens that disagrees with your wishes.

I'll clean up the current one a bit, it's getting messy, and see if I can get apache up on my machine so that I can share it as a download link instead.

I'm thinking of how I can expand it further to automate tests. Having it auto sense best AoA for lift and best prop RPM for acceleration/climb/speed, would be wonderful for creating performance graphs.
_
/Bjorn.

BaldieJr
05-21-2004, 02:24 PM
I'll be happy to host that lindyman. Send me a private topic and i'll get you the details.

I've got the space/bandwith: I may toss up a site-in-a-can for this new aspect of FB.

<pre class="ip-ubbcode-code-pre">
My Specs (read 'em and weep):
* Automatically grinds whole beans before brewing
* Fully programmable 24 hours in advance
* Brew Pause feature lets you enjoy a cup before brewing has finished
* Automatically shuts off when brewing is complete
* Grind-off feature for brewing ground coffee
* 1-4 cup feature to accommodate coffee for one
* 10-cup double-wall insulated thermal carafe to keep your coffee hot long after brewing
* Gold tone commercial-style permanent filter eliminates the need to buy coffee filters
* Charcoal water filter removes impurities from the water
* Separate grinder chamber and filter area allow for easy cleanup
* Limited 3-year warranty
</pre>

lindyman
05-21-2004, 03:01 PM
<BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>Originally posted by BaldieJr:
I'll be happy to host that lindyman. Send me a private topic and i'll get you the details.
<HR></BLOCKQUOTE>

Done. Thanks.
_
/Bjorn.

GCMC_Soron
05-21-2004, 04:21 PM
<BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>
Also check out opengc ( http://www.opengc.org ) <HR></BLOCKQUOTE>

ha great, just what I was looking for...

So it seem IL2 will go inside the opengc project... look there, I'll contact thos developeurs to inform them about the opening of IL2.
Thanks BaldieJr
Thanks Maddox

609IAP_Recon
05-22-2004, 10:27 PM
great stuff.

when you guys get some cockpits done, be sure to send some photos.

I could see a market in this for sure http://ubbxforums.ubi.com/infopop/emoticons/icon_smile.gif

Salute!

IV/JG51_Recon

http://www.forgottenskies.com/jg51sig2.jpg

flat-eric
05-25-2004, 02:07 PM
I could not get either of these to work. The VB one just gave me 0's no matter what I did. And I could not figure out what to do with the nix one. If I just chmod +x it, and try to run it, I get a bunch of errors. I guess I will have to mess around more when it is not 1am in the morning, but any advice would be great, as I have been waiting for this to come to IL2

Flat-Eric

[This message was edited by flat-eric on Tue May 25 2004 at 01:27 PM.]

flat-eric
05-25-2004, 02:08 PM
Oops double post

[This message was edited by flat-eric on Tue May 25 2004 at 01:27 PM.]

kater_karlo
05-26-2004, 02:08 PM
Hi guys,

I am refering to a thread in the german forum at
http://ubbxforums-de.ubi.com/6/ubb.x?a=tpc&s=59010161&f=388104122&m=630105914

hugo04 who speaks some russian has found a incredible tool at http://www.sh.zp.ua/il2/UDPSpeed.zip

Unfortunately there is no description supplied
but it basicaly shows gauges on a second PC!
This is the first step to a real cockpit !!!

Assume your game PC has IP=192.168.0.10, your cockpit PC IPS=192.168.0.11.


You simply change the setting in UDPSpeed.ini to the IP of you game computer

[UDP]
IP=192.168.0.10
Port=10000

the conf.ini need to be updated like

[DeviceLink]
port=10000
IPS=192.168.0.11

If you play with the tool on the cockpit computer you can either show gauges or a digital values of some basic flight instruments.
The thread talks about adding other gauges, which I didn't manage yet. Keep you posted

Btw. The honour for finding the tool goes to hugo04 who also speaks russian. Some applause would be nice http://ubbxforums.ubi.com/infopop/emoticons/icon_cool.gif

flat-eric
05-26-2004, 04:17 PM
Woohoo I got the VB one working, I am not sure what I did different, I also got the German one working. I can't wait to mess around with this more, when I get home from work!! http://ubbxforums.ubi.com/infopop/emoticons/icon_smile.gif

Flat-Eric

GCMC_Soron
05-27-2004, 02:14 PM
Excellent tool, thanks for the link kater_karlo and hugo04 .
And thnaks to Hruks and Alezz for making this tool.
I've just tested it:
http://home.tiscali.be/mstilmant/divers/il2/IL2Panel/GaugesS.jpg
bigger : Zoom (http://home.tiscali.be/mstilmant/divers/il2/IL2Panel/Gauges.jpg)

Simply cool,

So guys we need now designers to draw cute gauges, for each type of planes :-) yep, this tool can be easly configurable, look into subfolders to see pics easy to change ...

kater_karlo
05-28-2004, 12:08 PM
....

Or go to a flightsimulator page like www.flightsim.com (http://www.flightsim.com) get the tool GauBmp for conferting Microsoft fs gauges to bmp format and benefit of the 1000 of fine cockpit panel ready to be converted.

Take a look yourself, everthing is available ......
Whatever plane you are looking for, whatever cockpit you are working on

Keep the momentum!

WWMaxGunz
05-29-2004, 03:38 AM
Soron, S!

Are you using devicelink to a code thread on the same PC running FB in a window?
It looks like that to me.

Bjorn, what you have is all of or a great start to what level bomber players have
been asking for over a year now! When playing as bombardier the planes do not hold
straight and level well at all! So I am guessing strongly your program will become
very popular for in-game use as long as it can be toggled on and off.
For your use in tests may I reccomend outputting time, position and speed data to a log?


Neal

GCMC_Soron
05-29-2004, 10:39 AM
Salutations,

yes Maxgunz on same computer just for the screen capture, but I plan to use an other computer for pannel, but perhaps they are no big impact on perf if used on same computer.

kater_karlo yp, you've rigth...

Some poeple on french forum now whant to make a device for receiving G-Effects. like somethink in back pumping or inflatting with plane mouvments... some other talk about Anti-G combi to use it for the opposit goal...
well anyway DeviceLink don't provide actually G values.

Oleg'team, do you think is it possible ?

Thanks.

WWMaxGunz
05-29-2004, 03:13 PM
Ivank posts in 109K turn thread about having a devicelink G-meter already.
Really, G's are outcome of information given; speed, turnrate and vertical
parameters of pitch and position? Is there more? How to get G's in a barrel
roll, maybe those above are enough.

I ask about threads on the same PC as not all users run more than one and
simple programs run on PC's with power to spare may become very popular.

G-meters with onscreen graphic for instance. I had seen screenshots posted
where one player had graphics of his trim in the lower left corner. Many
have asked for that. That person proved a possibility to overlay IL2/FB
with graphics from an external program. Does it refresh? How does it stay?

The straight and level autopilot is really fast and simple enough to run good
as a low priority task. Hardest part I think is getting input to it, no?


Neal

Ivank
06-01-2004, 04:50 PM
WWWMaxGunz. you can run udpspd over the top of FB full screen. First start UDPspd, drag your data block to the screen position you want it to be. Start up FB. You will find the udpspd data block sitting over the top of FB. The digital values are far more space effcient than the guages. Also try right clicking on the data block you can do all sorts of things, change it to horizontal strip, bring the guages up for instance. We have found a horizontal data block the most effcient running across the bottom of the screen.

Azimuth = Heading, though in UDPSPD it only seems correct on Due east and due West, any other heading gives an eroneous return. I just think the returned data needs to be manipulated to correct it. Somthing to do with using 090 and 270 as the base line. However if the author of this utility reads this can you look into this.

G=OVERLOAD parameter 52
In udp terms this is "Overload" if you make another subfolder in the udpspd folder and call say GMETER, then copy an ini file from another folder into it. Next edit your ini file to give you the overload data, save it and there it is.
Here is my ini file to display G. The important bits are the Prefix in my case "G" , the Request string /52, and the data index 52. (Only using digital value so ref to the Bmp is irrelevant)

[Main]
Prefix="G":
ArrowCounter=1
Bitmap=bg_spd.bmp
PosX=869
PosY=20
Mode=0
AddPanel=0
Visible=1
RequestString=/52

[Arrow1]
//ª?²ü
Bitmap=arrow_spd1.bmp
PosX=77
PosY=80
CenterX=70
CenterY=50
DataIndex=52
Data1=0
Angle1=85
Data2=100
Angle2=110
Data3=150
Angle3=140
Data4=190
Angle4=175
Data5=290
Angle5=260
Data6=550
Angle6=360
Data7=800
Angle7=420


TURN RATE= Angular_speed
Angular_speed is Turn rate but in radians per sec not deg per sec as the Devicelink documentation states. Be nice if UDP spd could do the magic internally and display this as degrees per sec.

It would be nice if the data block background could be transparent rather than black.

Finally thankyou to the author of this tool, a great gift to the FB community. It would be great to see this develop further.

WWSensei
06-02-2004, 05:52 PM
Writing a program to support the GoFlight modules. In the course of doing that I'm creating a C_DeviceLink class that abstracts the various get and set functions into public functions. Also providing a generic SendMsg(char* cmd) to send your own query strings and generic ReadMsg(char* buff, int buff_len) function to retrieve the response.

The Init() function initializes the socket based on port and IP settings in a corresponding ini file. I've only coded a handful of functions so far but my GF_LGT module is working beutifully.

When I finish the other functions done I'll post a link of where to get the cpp and h files.

Basically, it will allow a programmer to simply instantiate a C_Devicelink object and then initialize it via my Init() function and then they are up and running.

WWMaxGunz
06-03-2004, 12:29 AM
Thank You Ivank!

Now I will look for this UDPSpd program.
Hopefully the source is also given.

Only 2 W's before MaxGunz, 2 W's for WingWalkers. http://ubbxforums.ubi.com/images/smiley/16x16_smiley-happy.gif

Be cool!

WWMG

Ivank
06-03-2004, 12:32 AM
http://www.sh.zp.ua/il2/UDPSpeed.zip

JRH147
06-05-2004, 12:18 AM
Sensei -

I thank you for doing all this work - I wanted to do something like what you are referring to, but I'm afraid my programming skills aren't up to par with yours.

This UDPSpeed program - the gauges update every second or so - is this just a function of the UDPSpeed program or just how slow DeviceLink is?

lindyman
06-05-2004, 01:50 AM
<BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>Originally posted by WWMaxGunz:
Bjorn, what you have is all of or a great start to what level bomber players have
been asking for over a year now! When playing as bombardier the planes do not hold
straight and level well at all! So I am guessing strongly your program will become
very popular for in-game use as long as it can be toggled on and off.
<HR></BLOCKQUOTE>

I realise this, and I have very mixed feelings about it.

My intention is to automate tests, and nothing more. I don't like the thought of it being used in on-line games to gain an advantage over those who do not use it.

<BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>Originally posted by WWMaxGunz:
For your use in tests may I reccomend outputting time, position and speed data to a log?

Neal<HR></BLOCKQUOTE>

The idea is indeed to put a large number of things in a log. Unfortunately position is not possible, other than through dead reckonning, which may easily become quite a bit off with time.

My current throughs are to make a small lib, with all the functionality required, and then a bunch of different test programs using the lib. The different programs are for different tests.

For example, one program that is pretty much written now, is a climb/glide tester. The only thing I need to add to the program is a limit on RPM and on manifold pressure, since with some planes the tester currently fries the engine. That program will log (with timestamps) altitude, IAS, manifold pressure, and RPM, all through a large number of constant IAS, and in the beginning of the log, the plane identification. It usually holds IAS with the elevator within .3km/h of the desired speed, which is far better than I am able to do.

Another tester I think will be fairly easy to write, is a cruise tester, that will try to find the optimum mixture/rpm for best speed/fuel-economy given a throttle setting and altitude.

Another, probably fairly easy tester, is to find speed for 1G stall with engine running. With engine off, it's more difficult, but doable.

A trickier one that I'd like to make, but I'm not yet sure of how to make it, is a tester for best turn rate at different speeds at a given altitude.
_
/Bjorn.

WWMaxGunz
06-06-2004, 12:16 AM
I really wish that 1C would include position data capability.
So many things could be well determined that we get no answers to now.
Is that against the wishes of 1C?


Neal

GCMC_Soron
06-06-2004, 03:40 AM
Position is not the goal of a device link.
A dive link is to link devices...

http://ubbxforums.ubi.com/images/smiley/icon_twisted.gif

But Yep, device Link could be extended, but then need many Activations toggle feature to desactivate, for example, position in on-line game, when I think we can offer access to cockpit data in on-line game. (what is not the case actually)

WWMaxGunz
06-06-2004, 10:35 AM
I'd be just as happy with not having such work online at all
since online is subject to greater lag than offline (when your
frame rate drops offline, you have some lag but maybe so does
everything else get the same).

For a toggle online, if the map and map icon are on then such
information would not be giving the store away would it?

Yes, as it is now we can make something comparable to chart
recorders that test pilots flew with, and that is a device, LOL!

Absolute position... it could make claims and tests into more
precise matters and end a lot of questions and innuendo that I
for one think that other sim makers only benefit by.


Neal