last update: 03-Mar-99

Hugin is a cooperation project between the Swedish Institute for Space Physics (IRF) and the Instrumentation group at the Physics department of KTH. The intention is to use artificial intel ligence in small satellites. This is a nanosatellite for evaluation of magnetic attitude control and neural networks. The satellite is a refinement of Munin, that has been developed at IRF-K (Kiruna Division of IRF) and  is intended for launch in May 1999. The currently available instrumentation details are here.

 In this URL we describe the developments and progress of the programming of the payload computer on board. This is a PC/104 system with the following cards:

 

Measurement with ANDI-DAS data acquisition card

The card has 32 analog inputs, 4 outputs, 8 digital I/O and 3 timer/counters (experiences with i82C54 chip).

The data for controlling the position will be taken from a magnetometer, sunsensor and several diods. Here is a screen capture of ADC_SHOW.C program for testing the magnetometer:

 

Within this program there is a built-in timer to measure the time needed for making an A/D conversion. It can run in measure-only and measure-and-display modes. The average times in msec are shown in the table below:

A/D conversion times with ANDI-DAS card:

i8088 CPU

i8486 CPU

store only

0.682 msec

0.097 msec

store and draw

6.851 msec

1.090 msec

 

Capturing pictures with a greyscale QuickCam videocamera

Pictures will be taken from a QuickCam videocamera through the parallel port. Here is the first picture which was taken by QCAM.C test program:

 

During program development we found that some camera was not working well (each even pixel was darker) with one PC, although it was with another PC. A program QC_CONT.C is starting with a dialog (see below) where one can adjust the parameters to be sent to the camera and then according the settings it continuously scans pictures and displays them on the screen.

                      setting QuickCam initial parameters
   +----------------------------------------------------------------------+
   |                   parameter description                     |  value |
   |-------------------------------------------------------------+--------|
   | contrast (suggested default value is 104)                   |   104  |
   | exposure (integration) time [1,255]     [1/1000,1] sec      |   150  |
   | top line to start capturing ( [1,243] )                     |     1  |
   | leftmost column to start capturing ( [1,324] )              |     1  |
   | number of lines to capture ( [1,243] )                      |   240  |
   | number of pixels/line to capture ( [1,324] )                |   320  |
   | data reduction ([1,2,4] = take every, every 2nd, 4th pixel) |     1  |
   | image depth ( 6 or 4 bit/pixel )                            |     6  |
   | bus mode ( nybble = 4 bit/transfer, byte = 12 bit/transfer) |     4  |
   | test pattern (0 = real picture, 1 = built-in test picture)  |     0  |
   |----------------------------------------------------------------------|
   |              calculated values to send as parameters        -        |
   |----------------------------------------------------------------------|
   |      Left             numV             numH             vpar-        |
   |      7 =  7         240 = f0          80 = 50           2 =  2       |
   +----------------------------------------------------------------------+
        <Esc> = finish editing, <up/down> = move cursor, <+/-> = change 

The average times in sec are shown in the table below, after running QC_CONT in 2 different PC/104 configurations.

QuickCam VC capturing times in seconds (store only):

 

PC/104 i8088

with 9 MHz

4-bit bus

6 bit/pix

4-bit bus

4 bit/pix

12-bit bus

6 bit/pix

12-bit bus

4 bit/pixel

320x240 image

16.425

7.819

5.489

4.131

160x120 image

4.130

2.000

1.417

1.077

80x60 image

1.075

0.540

0.397

0.322

 

PC/104 286 with

16 MHz

4-bit bus

6 bit/pix

4-bit bus

4 bit/pix

12-bit bus

6 bit/pix

12-bit bus

4 bit/pixel

320x240 image

4.387

 

1.516

 

160x120 image

       

80x60 image

       

 

PC/104 i486

with 33 MHz

4-bit bus

6 bit/pix

4-bit bus

4 bit/pix

12-bit bus

6 bit/pix

12-bit bus

4 bit/pixel

320x240 image

1.968

0.946

?

?

160x120 image

0.501

0.246

?

?

80x60 image

0.131

0.067

?

?

 

After speed-optimization (not safe, can loose sync.):

 

PC/104 i8088

with 9 MHz

4-bit bus

6 bit/pix

4-bit bus

4 bit/pix

12-bit bus

6 bit/pix

12-bit bus

4 bit/pixel

320x240 image

14.694

6.590

4.650

3.560

160x120 image

3.700

1.680

1.194

0.925

80x60 image

0.973

0.446

0.329

0.268

 

PC/104 i486

with 33 MHz

4-bit bus

6 bit/pix

4-bit bus

4 bit/pix

12-bit bus

6 bit/pix

12-bit bus

4 bit/pixel

320x240 image

1.816

0.847

?

?

160x120 image

0.464

0.221

?

?

80x60 image

0.122

0.061

?

?

 

 

 Communication with the housekeeping computer

 The base of the protocol was described during the last meeting in Kiruna (http://www.particle.kth.se/~fmi/hugin/huginmeet.html in 12th Aug. 1998. The translation o f the rules written in that agreement is as follows:

Communication between the housekeeping (HK) CPU and the payload (PL) CPU

 Because most probably DOS will be the operating system in PL, it is natural to use RS232 link between the 2 computer like a DOS prompt. The HK computer will work in transparent mode, e.g. it only forwards the commands from earth to PL, and pa sses the data from PL to earth.

 Commands to DOS are preliminarily fixed at 16 characters (bytes) and end with CR (included). The block messages forwarded to earth have 256 words (16-bit), from which the first 4 serves as status and synchronization. The other 252 words can be used by the PL for arbitrary purpose, but it has to be 252 words long.

 The number of data blocks has to be given to the HK computer before the sending starts. In Munin an empty block (filled with FEED(?)) is sent as the last one.

 The RS232 transfer will be used with minimum handshaking up till 115 kbit/sec. HK computer can handle up till 5 times of this speed, so the PL CPU will determine the transfer speed.

 PL will get 6 words from the solar panels and 4 temperatures from HK via ADC ports.

 PL needs a switch for having a reset, for example 2 wires going to HK, which could make a contact between their ends and cause a reset of PL.

 PL also needs an output line showing that it has been booted and is working well (output is high), or it can be low when it is not ready for the communication.

 The communication will use 9-pin contact according to RS232 protocol and a 15-pin plug if more lines were required. All level are TTL.