CONTROL COMPUTER INTERFACE .      updated 11 June 06

 

Some back ground.

There are heaps of pages on the net to describe motion simulation … most are very heavy going, some gloss things over.

The reality for simple motion sims, it is simple.

1/… The pilot only feels the start of the change.

2/… The platform all the time is to “self center” (Called washout) unless directed by the computer, not to.

To explain… your on a motorbike and turn a sharp corner, your body feels the change from the center of gravity moving from between your legs to one side. As soon as the “start” of the corner is completed, the center of gravity moves back to between your legs… your could go around in circles for ever and the center of gravity is still between your legs.. You are sitting straight up on the bike BUT your eyes are telling your brain, your on a hell of a lean and going around a corner.  When you finish going around the corner, you will feel the change in direction of gravity as you straighten the bike up. 

 

The same is true for a pilot (well a good one) When the plane rolls over for a turn, (you could spill coffee here) you feel a change but then it disappears, but your still turning, sitting upright in the seat and the cup of coffee is sitting perfectly flat but meanwhile you are still turning. Then you level up (could spill coffee here) and you feel the change, then your flying level again.  The above on a simulator goes like this…  on the turn, the sim rolls to the (say) left, as soon as the control program see’s the roll isn’t increasing anymore, the roll motor stops going that way and immediately softly starts going the other way slowly to get it back to center…. Meanwhile you eyes are seeing that the horizon is on a hell of an angle… so now the sim it sitting straight up and down, but your eyes and brain say its still turning.  To come out of the turn you move the control to level up and what happens here is the sim rolls to the right and then, when there is no more increase in roll, it will go back to center.  So you get the picture ??  The plane made one turn to the left BUT the sim made 1 roll to the left and 1 roll to the right and was sitting at center between these movements.

 

There are quite a few exceptions to this. The only one I built into the software was “take off”. You take off, the sim leans back because the horizon dropped down, the sim stays back until the horizon less than about 9 degrees. This gives a real sensation of acceleration. (This varies with different types of planes) The software also looked at the rate of change of pitch and roll and smoothed it out.  Enough of this. If you need more, look on the net.  Now to the hardware etc.

 

 

Overview. 

NOTE: I was building a sedate Cessna or 737 type motion platform…. Not a fast moving jet “shoot em up” type of thing.

NOTE: This setup reads the roll and pitch from the sim…. NOT from the joystick.

 

The control computer gets data via the serial port of the main computer and uses (for the platform) 6 outputs of the 8 outputs from a parallel interface board to control 6 relays for motor control.  2 relays for pitch up or down (just reverses the polarity to make the motor go the other way), 2 relays for roll (left or right… same thing.. (reverses the polarity).

There is another relay (the fifth and sixth) that tells the relay box that the control computer is totally taking control of the motor control relays.

In this mode you can program in acceleration, braking, flaps down feeling etc.  Take braking… the horizon is level on the screen so the computer is going to tell the sim to be level, BUT if the brakes get applied, the nose will go down and give you a sensation of braking… This is worked out by the control computer and not by the pitch and roll output from flightsim. (I never incorporated this when I had stopped experimenting, so its not in my software.)

 

In short for each motor there are 3 relays….1 for going “down”, 1 for going “up” and 1 to let the control computer take control of both of the “up” and “down” relays.

You can start with only 4 relays (2 each motor) and add the other 1 or 2  later. 

You will notice there are only 5 wires going to the interface box, I didn’t incorporate any computer generated “cues” for roll so I didn’t wire it up. ..  In fact I cant think of any except hard turning on taxi… but if you go all the way with this, there are flying situations that you will need this.. some types of turbulence, poor flying etc.

 

An explanation of this ‘slow return to center’…..  The control computer is all the time looking at the roll and pitch…  lets follow pitch thru..  if the pilot push’s the stick forward, the horizon goes up, so the sim pitch’s forward at the fast speed and if the horizon stayed roughly at the same figure, the sim will return to center at a slow speed.   However if the stick was pushed forward and then pulled back to climb again, the sim would pitch down and then up again, both at the faster speed.

If your flying thru turbulence, the big bumps on pich or roll will be at the fast speed giving a good sensation.

The ‘slow return to center’ happens if the horizon (or roll) is “stable” at any degree’s  ie no big changes. It is seldom you fell the “return.to center” sensation and that’s probably just because I built the bloody thing and I’m aware of what is happening.

 

 

PARALLEL PORT INTERFACE CARD.

There are many of these things on the market, some crude, some so fancy it gets silly the money they want for them. There is also a hell of a lot of info on the net to build your own.

http://www1.jaycar.com.au/productView.asp?ID=KC5230

http://home.maine.rr.com/randylinscott/dec98.htm        

http://www.thebells.net/Halloween/PLCC/PLCC.html         http://ourworld.compuserve.com/homepages/Bill_Bowden/page6.htm 

http://www.dse.co.nz  (Disk Smith electronics Australia and NZ kit k2805)

 

The easier ULN2803 types (The type I am using at the moment)

A note on the ULN2803, even though there are spike protection diodes in the IC, I still fit a 33 volt zener diode between pin 10 and earth.

http://www.kitsrus.com/kits.html       kit 74   also at www.oceancontrols.com.au as kit kt-5074 or built up kt-5074A (Look under “controllers”) Also at  http://www.ozitronics.com/relay.html as K74 and 74A  also at http://electronickits.com/kit/complete/elec/ck1601.htm

 

I used the Jaycar one purely because I had one, and the other input / output on the board could have also been useful. As it turned out, I only built the part that gave the outputs from the relays.   I have since moved on from this approach, and an electronic whiz kid friend, Gary,  has designed a board that can be extended for up to 128 outputs so I can run LED’s etc etc on the instrument panel and relays for things in the cockpit. I will post all this info and software when I get it done (A few months)

In the meantime, if you really want to get going then have a hard look at the ULN2803 kits and in particular have a really hard look at the latest documentation pdf for the WWW.Kitsrus.com  kit 74 or at http://www.ozitronics.com/relay.html

 

I earlier used the www.DSE.co.nz   kit K2805 but blew it up with my own stupidity. A driver BAS file is included with… www.jimspage.co.nz/files.zip  if you have one of these.

 

SOFTWARE.

Well this is where we all break down and laugh…. I use an old 386 (25 megs) in DOS and run gwbasic to control the board…  The reasons… it was there on the day and coming from DOS, I can sit down and write a program in gwbasic straight out of my head. When I get the new board going, I will revisit this too.

The actual code is not tidy, it was done sitting on a box beside the sim and never rewritten in a more logical and tidy manner…. Sorry.J

You can download the GWbasic code here..  www.jimspage.co.nz/files.zip  (the BAS file and Chcomm3 ini files)

The Gwbasic program runs fine on DOS and windows ME (in a dos window). I haven’t tested it on anything else.

NOTE: It is only good for the simplified Jaycars KC5230 kit, but I suspect it would also work on the Kitsrus kit 74 or any direct fed ULN2803 chip.  Let me know.

If you don’t have gwbasic, have a look on some old DOS disks or search google for GWBASIC DOWNLOAD  Its easy to find. (I used DOS 3.22)

Of course, by the time you have found the bits and made the sim, I will have the updated output board on the net along with a program to run it. (No promises of when though)

 

Another thing…  when the computers are booting up and before they start talking to one another… the parallel port can send out garbage… this will send your sim into an unknown “joy ride” so be prepared for a wee thrill.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


The above 2 pictures show the Jaycar board with the minimum components on it to make it work…

8 relays, 1 ULN2803, 1 socket, 1 capacitor, , 8 diodes and 1 zener diode.  Extra are the 8 LED’s and dropper resisters for easy identification of the relays being activated.

 

In simplicity, these relays control the relays in the relay box.

 

WARNING   re  USB !   (Added June 06)

A big word of warning here though …  If your computer has not got a parallel port them don’t assume getting a USB to printer adaptor cable will get over the problem.

There is every chance it wont work.   There seems to be a difference here with the operation of bi-directional data etc. I haven’t faced this problem so I don’t know about the in’s and out’s of it.  I did try my motion program thru one of these adaptors, just to try,,,  and it didn’t work but that’s not to say it wont work on another type of a adaptor. …  Some are fully compatible,,,  most (as I understand it) are just the bare necessities to run a common printer.

Of course, throwing another PCI card into the computer with a parallel output socket on it will also get over the problem if your computer hasn’t got a parallel port.

 

CONCLUSION.

Again, for a test unit, this worked very well. There was provision in my planning of this interface and the relay box to have a fast and a slow “action” speed but I never installed it as it was fine the way it was. At this stage I should repeat… I am building a more sedate simulator (Cessna or 737) and NOT a “shoot em up” type thing.

 

IF I WERE TO BUILD THIS AGAIN ?

Well I’ve already answered this… I am going to make an output board capable of being extending up to 128 outputs and this will remove the restriction of only having 8 outputs.  I’ll keep you posted….  BUT, the above is simple, cheap and easy to get going. Once things are going, you can move on from there.

 

 

Flowchart: Alternate Process:  Back to the simulator main page.Updated 11 June 06