Äîêóìåíò âçÿò èç êýøà ïîèñêîâîé ìàøèíû. Àäðåñ îðèãèíàëüíîãî äîêóìåíòà : http://curl.sai.msu.ru/mass/download/doc/eso_details.pdf
Äàòà èçìåíåíèÿ: Sun Jan 28 17:43:23 2007
Äàòà èíäåêñèðîâàíèÿ: Mon Oct 1 20:15:20 2012
Êîäèðîâêà:

Ïîèñêîâûå ñëîâà: ï ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï ð ï
Optimized MASS device for synchronous measurements with Paranal DIMM Electronics and Device control
Kornilov V., Shatsky N., Shugarov A., Voziakova O. Decemb er 4, 2003


Contents
1 Electronics overview 1.1 Common characteristics of electronics and 1.2 Detectors unit . . . . . . . . . . . . . . . . 1.3 Auxiliary electronics . . . . . . . . . . . . 1.4 Star centering unit . . . . . . . . . . . . . 1.5 Requirements to p ower supply . . . . . . . 1.6 Data exchange proto col (physical level) . 1.7 RS485/LPT converter . . . . . . . . . . . 2 Electronic mo dules 2.1 Detectors unit . . . . . 2.2 Bicounter mo dule . . . 2.3 Auxiliary mo dule . . . 2.4 Stepp er motor mo dule 2.5 Connections . . . . . . 2.6 RS485/LPT converter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 6 6 8 8 9 10 11 12 12 12 19 22 22 24 29 29 30 32 35 36

RS-485 .... .... .... .... .... .... . . . . . . . . . . . . . . . . . . . . . . . .

line ... ... ... ... ... ... . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

3 Microprogramming and Instructions set 3.1 Logical level of interaction b etween computer 3.2 Bicounter mo dule . . . . . . . . . . . . . . . . 3.3 Auxiliary mo dule . . . . . . . . . . . . . . . . 3.4 Stepp er motor controller mo dule . . . . . . . 3.5 Up dating a micro co de . . . . . . . . . . . . .

and .. .. .. ..

mo .. .. .. ..

dules ... ... ... ...

1


List of Figures
1.1 1.2 1.3 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 2.10 2.11 2.12 2.13 2.14 2.15 Schematic view of electronics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Principles of the centering unit function . . . . . . . . . . . . . . . . . . . . . . . Illustration of data exchange b etween host computer and mo dules. . . . . . . . . Circuit diagram of the Detectors unit electronics. . . . . . . . . . . . . . . . . . . Circuit diagram of the analog part of the Bicounter mo dule electronics . . . . . . Circuit diagram of the digital part of the Bicounter mo dule electronics . . . . . . Placement of the comp onents on the PCB of the PMT voltage divider . . . . . . Placement of the comp onents on the PCB of the Pulse amplifier and discriminator Placement of the comp onents on the PCB of the digital part of the Bicounter. . Circuit diagram of the main part of the auxiliary electronics. . . . . . . . . . . . Placement of the comp onents on the PCB02A of the auxiliary electronics. . . . . Circuit diagrams of the separate parts of the auxiliary electronics . . . . . . . . . Placement of the comp onents on the PCB02C and PCB02D of the auxiliary electronics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Circuit diagram of the stepp er motor controller electronics. . . . . . . . . . . . . Placement of the comp onents of the stepp er motor controller electronics. . . . . . Connections b etween the separate b oards of the device . . . . . . . . . . . . . . . Printed circuit b oards for the RS485/LPT . . . . . . . . . . . . . . . . . . . . . . Circuit diagram of the RS485/LPT converter. . . . . . . . . . . . . . . . . . . . 7 9 10 14 15 16 17 18 18 20 21 21 22 23 25 26 27 28

2


List of Tables
2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 3.1 Sp ecification for Sp ecification for Sp ecification for Sp ecification for Sp ecification for Bus colors table Arrangement of Sp ecification for detectors unit electronics. . . . . . . . . an analog part of the Bicounter mo dule. a digital part of the Bicounter mo dule. the Auxiliary electronics. . . . . . . . . the Stepp er motor mo dule. . . . . . . . ....................... line cable . . . . . . . . . . . . . . . . . the RS485/LPT converter (see SCH02). .. . .. .. .. .. .. .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 13 17 19 24 24 25 27 29

Used signal bytes.

...................................

3


Bibliography
[1] Kornilov V., The optimization of MASS device for synchronous measurement with Paranal DIMM. A Prop osal to Europ ean Southern Observatory (ESO). Decemb er 11, 2002 [2] Kornilov V., Potanin S., Shatsky N., Voziakova O., Zaitsev A. Multi-Aperture Scintil lation Sensor (MASS). Final design report. February 2002. [3] Kornilov V., Potanin S., Shatsky N., Voziakova O., Shugarov A. Multi-Aperture Scintil lation Sensor (MASS) Upgrade. Final report. January 2003. [4] Kornilov V., Shatsky N., Voziakova O., The optimization of MASS device for synchronous measurement with Paranal DIMM. First stage project report April 2003. [5] Kornilov V., Tokovinin A., Voziakova O., Zaitsev A., Shatsky N., Potanin S., Sarazin M. MASS: a monitor of the vertical turbulence distribution. Pro c. SPIE, V. 4839, p. 837-845, 2003 [6] A.Tokovinin, V.Kornilov, N.Shatsky, O.Voziakova, Restoration of turbulence profile from scintil lation indices, MNRAS 2003, V. 343, P. 891

4


Intro duction
The do cument presents description of the electronic mo dules of the optimized MASS device. The base of the electronics design is the same as in original MASS: mo dular structure, data exchange via RS-485 interface, PMTs as light detectors. Meanwhile, the real electronics were significantly redesigned: numb er of separate mo dules was reduced from 7 (in original MASS [2]) to 3 in the current design. First Chapter of this do cument contains general description of the electronics as well as overview of data exchange proto col b etween the device and PC. Detailed design of the MASS electronic mo dules (circuit diagrams, printed circuit b oard views, their sp ecifications) is provided in the second Chapter. Although the description of RS485/LPT converter is available in [3], this information is included in the do cument also. Last Chapter contains detailed description of the low level command set, which can b e used during handling of non-standard situations, which can arise in test, adjustment or repair pro cess. The description of the micro co de up date pro cedure is presented, to o. The do cument contains the detailed information on MASS device, which may b e needed in case of device malfunctions or fault. The information will b e useful for exact understanding of the device p ossibilities and p otentials.

5


Chapter 1

Electronics overview
The MASS electronics inherits the mo dular principle of the original MASS device; the photometric mo dules were united in one detectors unit, some functions of other mo dules were redistributed due to partial mo dification of the device construction. In order to promote the device reliability, the numb er of external and inter-PCB connectors was minimized. The basic Atmel AVR micro controller mo del was changed from AT90S2313 to more p owerful and advanced ATMega8, meanwhile the communication proto col of data transfer from MASS to PC was retained unchanged to maintain the software compatibility with the original MASS system.

1.1

Common characteristics of electronics and RS-485 line

As in original design, the architecture of all MASS electronic mo dules is similar. The kernel of any mo dule is an AVR micro-controller ATMega8 from Atmel company running at 14.746 MHz frequency. In principle, such a clo ck frequency provides the standard transmitting rate as large as 1840 Kbit/sec instead of 460.8 Kbit/sec in original MASS. A big merit of these controllers is the p ossibility of their re-programming using the data exchange line. All mo dules are designed to supp ort this p ossibility. Schematic view of the MASS electronics is presented in Fig. 1.1. All information exchange b etween the host computer and the individual mo dules is executed via RS-485 line working in half-duplex mo de. The line connects to LPT p ort of PC via a sp ecial RS485/LPT converter. A pure RS-485 interface is used in the segment "host computer -- MASS". Balanced data lines A and B are prop erly terminated and biased from b oth ends of the long cable to provide safefault data transmission. For inter-communication b etween the electronic mo dules, RS-485 itself and 2 additional lines are used. These additional lines do not have constant sp ecification and are used to transmit sp ecific lo cal signals: SYNCHRO -- for common hardware synchronization of the mo dules, and OVERLIGHT -- for fast hardware protection of PMTs against light overflow.

1.2

Detectors unit

MASS detectors must measure the intensity of light in four channels synchronously with a very short (1 ms) exp osure time and high duty cycle. The numb er of photons detected in an elementary exp osure in each area go es up to tens of thousand dep ending on the channel and star brightness. Preliminary investigation shows that most suitable PMT is bi-alkali Hamamatsu 6


1
High voltage

2
Overlight Synchronization

3

Detectors module 1

Detectors module 2

Auxiliary electronics

Illumination, control light, sensor, centering unit

RS485 serial bus

Computer

Converter RS485/LPT Power +12 DC

Figure 1.1: Schematic view of electronics for MASS device. 1 -- detectors unit, 2 -- electronics b ox, 3 -- electronic elements in main MASS case. Centering mo dule connects with RS-485 line via auxiliary electronics R7400P (see Rep ort [4]). It has a low dark current (< 100 pulse/s), high sensitivity in blue-green sp ectral region, suitable temp oral characteristics and very compact size. Contrary to original MASS, where the detectors were implemented as four separate photometric mo dules (PMs), four MASS device detectors are united in one detector unit, including b oth PMTs and the asso ciated electronics. Detector electronics is sub divided in two indep endent two-channel mo dules (further -- Bicounter mo dule). Nevertheless, these mo dules are placed at one PCB, which p ermits to diminish a numb er of inter-connections. Each bicounter consists of two voltage dividers for PMT, two very fast amplifier- discriminators, two counters driven by a single micro-controller and an interface circuit. Both data from the mo dule to a host computer and commands from a computer to the mo dule are transmitted via RS-485 line. Interaction b etween PM and computer is describ ed in Section 1.6. Besides, an additional line connects the photometric (bicounter) and p ower supply mo dules and immediately shuts down the HV when the PMT flux exceeds the maximum rating. This feature assures the safety of PMTs. The bicounter mo dule executes the following functional commands: set level of the pulse discrimination, run series of micro exp osures with a preset exp osures numb er and integration time, set needed integration time or work by external synchro, set length of series, and so on. Data packet from bicounter contains always counts from b oth PMT. Physically, the detector unit is attached to the electronics b ox and they can b e removed from the MASS device together. Therefore, electrical connections b etween these b oth units are soldered. Whole electronics unit is fixed at the main b ox with help of plug elements and lo cked

7


by screws.

1.3

Auxiliary electronics

Auxiliary electronics is mainly placed in the electronic b ox, although a few elements are placed in the main case of the device. The electronics provides following functions: · · · · · · · Device p owering by DC +5 V PMT p owering by high voltage Measurement of internal temp erature Control of illumination of FOV in viewer Polling of viewer mirror p osition Management of control light Monitoring of RS-485 line status

From the side of external control, the electronics is one multi-functional mo dule connected to RS-485 line. The mo dule executes the following functional commands: set brightness of b oth light sources (control and viewer), mo dulates the control light synchronously with micro exp osures for statistic test, which is used to test the normal op eration of the detectors and to control the parameters of the photometric channels. Position of viewer mirror is checked to prevent measurements when the mirror is o ccasionally left on axis. The high voltage converter TA-1.0N-12LS from WME company pro duces a voltage from 0 to 1000 V for PMT p owering. The converter is p owered by +12 DC and supplies 1 mA current with low ripple. The control of the output voltage is done by software as well. The presence of high voltage is indicated by a sp ecial red LED placed near other indicating LEDs. In an emergency (light overflow) the sp ecial signal from detector unit turns off the high voltage immediately. Additional functions provided by this electronics are the controls of internal temp erature of MASS and of the status of RS-485 line. Line status (data is transmitted or not) is indicated by a yellow LED. The secondary p ower unit (such as DC/DC converter TEM2-1211 from TRACO Power Company) pro duces DC +5 V for device electronics and for RS485/LPT converter (p owered thus via the line).

1.4

Star centering unit

In order to provide effective work of the optimized MASS in situations when DIMM is not used, the star centering unit is included in the design. It also helps to check whether the DIMM and piggy-back MASS devices are coaligned on the same (DIMM's) mounting. Since the new MASS device do es not have an ap erture wheel, the construction of the centering unit differs from the centering mechanism of the original MASS. The basic scanning idea is similar, but scanning of the stellar image is made with help of a triangle knife rather than by a triangle hole. This metho d has an imp ortant advantage: the star p osition can b e measured with resp ect to the real

8


a)

b)

c)

50% x1 x2 x1 x2 x1 x2

Figure 1.2: Principles of the centering unit unction. a) -- scan of uniform ap erture, b) -- scan of the star image in the ap erture enter, c) --- the same for offset star. center of ap erture (see b elow), not to some initial star p osition which needs additional (manual) calibration. The Fig. 1.2 shows the light curves during scanning of uniformly illuminated ap erture, star in the ap erture center, and an offset star. Uniformly illuminated field ap erture (twilight scanning) serves for defining of the exact ap erture center. To move the triangle knife, a little stepp er motor from FDD drive with its native brass worm is used. Bip olar stepp er motor has two 18 ohm windings p owered by maximal current 200 mA. The motor has 20 step p er revolution and can by driven in quarter step mo de only, not finer. Pitch of worm equals to ab out 3 mm. So, the knife shift step as small as 0.04 mm is provided. This value (taking into account the 45 slop e of the knife edge) corresp onds to the angular step 3 , which is less than 0.01 of the field ap erture size. A separate electronic mo dule is used to control the centering unit. The stepp er motor controller shifts of triangle knife with a preset sp eed at the needed distance, checks the left and right motion limits, turns off and on motor p owering b etween centering pro cedures. Stepp er motor is p owered by DC +12 V. The mo dule is connected to RS-485 line as shown in Fig. 1.1.

1.5

Requirements to p ower supply

The p ower supply +12 DC may b e either a battery or a line regulator or a switching converter. The maximal total MASS p ower consumption is 300 mA when the high voltage is on. The main requirements for the characteristics of the p ower supply are following: · · · · Output voltage: +12 V (Min +11.5 V, Max +13 V) Max output current: greater than 0.6 A Max output voltage pulsations: less than 100 mV Op erating temp erature from -10 to +35 .

A 2-wires cable which p owers the MASS device, must have 0.5 mm 2 cross-section (AWG20) and the length not longer than 15 m. Voltage drop at the cable must b e less than 0.2 V p er one wire.

9


1.6

Data exchange proto col (physical level)

Figure 1.3: Illustration of data exchange b etween host computer and mo dules. Light grey -- packet with data or command information, dark grey -- signal which confirms packet reception. Three p ossibilities are shown: 1) computer sends a command to mo dule 1, 2) computer sends a request to mo dule 2 and receives the reply, 3) an active mo dule 3 sends a data blo ck to computer. As describ ed ab ove, all information exchange b etween the host computer and MASS is executed via RS-485 line. MASS op eration needs an informational flow as large as 8 Kb/sec or 110 Kbit/sec on a serial line. So, the line with 0.5 Mbit/sec is sufficient for our purp ose. Although ATMega controller provides more faster exchange rate, the p ossibility of usage of a faultless line of 50­100 m length at lower rates is more preferable. Data transmission through RS-485 line is executed serially. Each serial byte contains 1 start bit, 8 data bits, 1 parity bit (used for sp ecial needs only), 1 stop bit. It is the standard proto col, defined at the hardware level of micro-controllers. The metho d of interaction b etween receiver and transmitter to provide faultless and effective data exchange is called an exchange proto col. The main features of the used proto col of data exchange are following: · Data and commands are transmitted in binary (non-symb olic) form · The bytes of information for transmission are merged in a packet · The inter-mo dule exchange is excluded from proto col, computer always participates in any data exchange · The packet can have a length from 1 to 31 bytes · The packet with length of 1 byte has a sp ecial function ­ signal · Each packet is started with a header byte (except signals). Header byte is marked by 1 in the parity (ninth) bit · Header contains address of the destination or departure mo dule · The last byte of the packet is 8 bits cyclic residual control · Receptor confirms the packet acceptance by sending an acknowledgment signal · A non-confirmed packet is treated as lost and is re-transmitted until reception All MASS mo dules work commonly as passive devices -- they can transmit data only in resp onse to a request from the host computer. The photometric mo dule can work as an active 10


one, i.e. it can activate the packet transmission. This ability p ermits to reach more effective data acquisition than p olling metho d. In Fig. 1.3 the three p ossible variants of data exchange are illustrated. Since the same lines of the interface is used for b oth reception and transmission, a collision of packets is p ossible. To avoid collisions, some mo dification of time windowing metho d is used. For the needed data flow and transmission rate, the used time window is ab out 500 mksec. In general, the collision problem for an exchange rate of 20% of line capacity and for three active devices (two bicounter mo dules and host computer) is severe. It was solved in case of MASS by sp ecial induce pro cedure, when the data transmission from next mo dule is started after passing data packet from the so called inductor mo dule. This way is used in MASS, to o.

1.7

RS485/LPT converter

To solve a data exchange problem with a needed rate (460 Kbit/s) we use standard LPT p ort working in EPP mo de and a sp ecial RS485/LPT converter (see [3]) with a packet pro cessing feature and a large FIFO capacity (512 bytes). Such bufferization p ermits to reduce by more than two orders the PC reaction requirements and to reduce a pro cessor load at the interrupt service by few tens times. In order to send a packet to the MASS device, the driver program writes sequentially all the packet bytes to the LPT data register except the address byte. Then, an address byte is written in the LPT address register which signals that the packet is fully loaded in the converter. Converter computes the CRC byte, adds it to the packet and transmits serially the packet via an RS-485 line. Then it waits for the mo dule resp onse and, if no fault results, asks the computer to read the replied data. When a transmission is activated by a (bi)counter mo dule, the converter receives a full packet, checks its CRC, sends back a signal ACK (or NAK in the fault case) to the mo dule and asks the computer to read received data. If computer is busy and can not read data immediately, the received data are placed into the internal FIFO buffer. The buffer can keep up to 15 full packets and provides thus the bufferization as long as 30 ms. When the computer is finally able to read data, all the data, packet by packet, are input during 1 ms. The converter uses optical coupling that insulates electrically the PC computer from the MASS instrument. The converter is connected to the LPT p ort of the PC directly and do es not require any separate p ower supply. It is p owered from the line voltage +5 DC fed by the MASS device.

11


Chapter 2

Electronic modules
The electronics design is p erformed as the base of the mo dular conception explained in the Main Do cument earlier. In the next sections the circuit diagrams of the mo dules are presented. Generally accepted designations of schematic elements are used, except designation for resistors (we used a russian symb olic for them). The connectors are also marked in a sp ecial way. Connectors to external cable and wires are denoted by a letter "X", internal connectors are divided into four groups: 1) Soldered connectors are marked with a letter "S", 2) Inter-b oard connectors, which link different parts of the same mo dule -- with "I", 3) Connectors to internal bus, which links the different mo dules -- "Y", 4) Sp ecial connectors for In System Programming technique are denoted as "ISP". The nominal values of passive elements are shown on the schemes. The active element features are shown in sp ecification tables which are included, to o. Comp onent manufacturer are not shown in cases of widespread parts. Connectors, which are parts of PCB, don't include in the tables. Also, this chapter contains the schematic views of the mo dule PCBs with the comp onent placement for easy identification of the schematic element with the real comp onent used.

2.1

Detectors unit

As describ ed ab ove, detectors (photometric) unit consists from two identical bicounter mo dules, placed in parallel at the same PCBs. In the Fig. 2.1 a circuit diagram for whole unit is presented. Bicounter mo dules are shown schematically by blo cks. Comp onents which do not b elong to bicounter mo dules are shown explicitly. Further, these comp onents are marked by prefix * at the PCB01C.

2.2

Bicounter mo dule

The circuit diagrams of the analog and digital parts of the bicounter are shown in Fig. 2.2 and Fig. 2.3. PCB views are presented in Fig. 2.4, Fig. 2.5 and Fig. 2.6.

12


Table 2.1: Sp ecification for detectors unit electronics. Item 1 2 3 4 5 6 7 8 9 Part D1 Z1 C1 C2, C3 R1 Y1 PCB01A PCB01B PCB01C Name IC NC7SZ32M5 Quartz 14.746 MHz SMD capacitor 2KV SMD capacitors SMD resistor Line conn. Printed b oard Printed b oard Printed b oard Manufacturer Fairchild -- -- -- -- -- Custom Custom Custom Q-ty 1 1 1 1 2 1 1 1 1 Rem SOT-23, Gate OR HC49S 1208 size 0805 size 0805 size Soldered Fig. 2.4 Fig. 2.5 Fig. 2.6

Table 2.2: Sp ecification for an analog part of the Bicounter mo dule. Item 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Part D1, D2 D3 D4, D5 D6, D7 R1-R4 R5-R22 C1, C2 C3, C4 C5-C8 C9-C19 C20-C22 L1-L4 R23-R33 PMT1,2 I1-I3 I4 Name IC SA5205AD IC AD1580ART IC AD8400AR1 IC AD8611AR SMD resistors SMD resistors SMD capacitors SMD capacitors SMD capacitors SMD capacitors SMD Tantal capac. SMD inductances SMD resistors E678-12 Pins connector Pins connector Manufacturer Philips Analog Dev. Analog Dev. Analog Dev. -- -- -- -- -- -- -- Bourns -- Hamamatsu -- -- Q-ty 2 1 2 2 4 18 2 2 4 10 3 4 11 2 3 1 Rem

0805 size 1208 size 0805 size 1208 size, 250V 0603 size 0805 size A size 1812 size 0805 size PMT so ckets PBS2-2, soldered PLD2-12

13


Dividers A & B

Bicounter 1

I_A ANOD_A GND

Amplifiers A & B
I_B

ANOD_B GND

INP_A VCC CS_B CS_A MOSI SCK INP_B I_B I_A GND

Counters A & B

XTAL1

XTAL2

SCK

SS

MISO

MOSI

Y1
1

*Z1
C2 12p R1 120 C3 12p

HV GND

1 2

C1 1n

S1

2 1

D1
4

2 3 4 5

XTAL1

MISO

SCK

Dividers A & B

Bicounter 2

I_A ANOD_A GND

Amplifiers A & B
I_B ANOD_B GND

INP_A VCC CS_B CS_A MOSI SCK INP_B I_B I_A GND

Counters A & B

Figure 2.1: Circuit diagram of the Detectors unit electronics. See circuit diagram for a bicounter in the further figures.

SS

MOSI

6

VCC GND LINE A OVLIGHT LINE B STROB

14


HV

R5 510K
C9 100n

L1 10mH
C18 100n C20 1.5mF

L3 10mH

1

R6 510K R7 510K

6

R13 270K R1 100K
R3 10K C1 68

R23 7.5K

K DY1 DY2 DY3 DY4 DY5 DY6 DY7 DY8 A

12 11 10 2 9 3 8 4 7 5

R27 * R8 510K R9 510K I1/1 R10 510K R11 510K I1/2 ANOD_A
C5 15p

C7 5.6n
2

D1
5

C16 5.6n
2 3

D6
8 7

R32 10

C11 5.6n
R24 91 R28 91

C12 10n GND R12 510K

R31 1.2K

C22 2.2mF

PMT1

I4
D4
8 A W B SDI CS' CLK 4 3 5 7 1 4 9 5 7 3

C3 100n ANOD_A GND I_A R14 510K

I1/1 I1/2 I3/1 C15 100n

1

D3 D5
8A 7W 1 B SDI 4 3 CS' 5 CLK

11 8 10 2 6 12

PMT2
1

R15 510K R16 510K

K DY1 DY2 DY3 DY4 DY5 DY6 DY7 DY8 A

12 11 10 2

OUT_B MOSI CS_B SCK CS_A VCC OUT_A I_A I_B GND GND GND

C10 100n

3 8 4 7 5 6

R19 510K R20 510K

R25 7.5K

9

R30 *

C19 100n

R18 510K

R21 510K R22 270K I2/1 ANOD_B
C6 15p

C8 5.6n
2

D2
5

C17 5.6n
2 3

D7
8 7

C21 1.5mF

R4 10K

C2 68

C14 10n ANOD_B GND I_B I2/1 I2/2 I3/1 I3/2 I3/2 I_B I_A I2/2 GND

Figure 2.2: Circuit diagram of the analog part of the Bicounter mo dule electronics. PMT divider, pulse amplifier and discriminator with level control.

R29 91

R26 91

15
R17 510K R2 100K C4 100n

L2 10mH

L4 10mH

R33 10

C13 5.6n


C1 100n

VCC
R3 5.6K R4 5.6K C3 10mF C2 100n

I4
INP B VCC CS_A CS_B MOSI SCK INP A I_A I_B GND GND GND
1 3 7 9 4 5 11 8 10 2 6 12 15 9 10 C1 C0 7 1 2 C0 C1

D2:A
Q0 Q1 Q2 MR Q3 3 4 5 6 23 24 25 26 27 PC0 PC1

D3

GND
AVCC 18 20 19 22

PC2 PC3 PC4 PC5 RESET PB0 PB1 PB2/SS OC2/MOSI PB4/MISO PB5/SCK XTAL1 XTAL2

ATMEGA8-AI16

AREF ADC6 ADC7

D2:B
Q0 Q1 Q2 MR Q3 11 12 13 14

28 29 12 13 14 15 16 17 7

PD0/RXD PD1/TXD PD2/INT0 INT1/PD3

30 31 32 1

STROB

T0/PD4 2 PD5/T1 PD6/AIN0 PD7/AIN1 9 10 11

R5 10K

16

R1 2.2M R2 2.2M

8

VCC

OVLIGHT
D4
1

D1:A
3 1 2

ISP/1 ISP/2 ISP/3 RESET MOSI SCK MISO GND

XTAL0 XTAL1 MOSI SCK MISO SS

RO RE DE DI

6

LINE B LINE A

2 3 4

7

D1:B
5 7 6

ISP/4 ISP/5 ISP/6

Figure 2.3: Circuit diagram of the digital part of the Bicounter mo dule electronics. Counters and microcontroller unit.


Table 2.3: Sp ecification for a digital part of the Bicounter mo dule. Item 1 2 3 4 5 6 7 8 Part D1 D2 D3 D4 R1-R5 C1, C2 C3 I4 Name IC 74HC4520D IC LM2903M IC ATMega8-16AI IC ADM1485AR SMD resistors SMD capacitors SMD Tantal capac. Pins connector Manufacturer Philips Nat.Semicond. Atmel Analog Dev. -- -- -- -- Q-ty 1 1 1 1 5 2 1 1 Rem

0805 size 0805 size B size PBD2-12

PMT side

PMT2 (B)

PMT1 (A)

R7 R9 R11

R16 R18 R20

C2 C3

C4

Figure 2.4: Placement of the comp onents on printed circuit b oard of the PMT voltage divider. Designations are the same as in circuit diagrams in Fig. 2.2.

C1

R13

R22

R2

R1
R8 R5

R3

R4

Bicounter 2

Bicounter 1

Opposite side

I2

R12 R10

I1
*C1

R21 R19 R17 R14 R15

I3

R6

*S1

17


Bicounter 2
I1
C5 C7

Bicounter 1
I2
C6 C8

C10

C9

I3

D1
L1

D2
L2

D5

Figure 2.5: Placement of the comp onents on printed circuit b oard of the Pulse amplifier and discriminator with level control. Designations are the same as in circuit diagrams in Fig. 2.2.

C16 C11 C12
R24 R28 R23

R31 +

R26 R29 R25

C17 C13 C14
+

C15

C19

C20 C18

C21

D6
R27 R32

D4

D7
R30 R33

D3

+

L4

Bicounter 2
I4
1

L3

C22

1

I4

Bicounter 1

*C2

+

Figure 2.6: Placement of the comp onents on printed circuit b oard of the digital part of the Bicounter. Designation are the same as in circuit diagrams in Fig. 2.3.

R2

R1
C1

R5

R4

R3

C3

*Y1

D1

*Z1

1

D2
D4
*D1

*C3

C2

D3

ISP
1

*R1

18


2.3

Auxiliary mo dule

The circuit diagrams of this mo dule are shown in Fig. 2.7 and Fig. 2.9. PCB views are presented in Fig. 2.8 and Fig. 2.10. On the PCB2A main part of the auxiliary mo dule is placed. So as this PCB is installed in removable electronics b ox, it is connected with other parts of auxiliary electronics, placed in the main case of the device, with help of connector I5. The connector is mounted on cross-plate PCB02B. Further connections made soldered. Table 2.4: Sp ecification for the Auxiliary electronics. Item 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 Part D1 D2 D3 D4 D5 D6 D7 D8 D9 Z1 R1-R22 C1 C2, C4 C5 C3-C11 V1-V3 V4 V5, V6 ISP X1 X2 Y2 I5(A) I5(B) PCB02A PCB02B PCB02C PCB02D Name Mo d. TEM2-1211 IC LM2904M Mo d. TA-1.0N-12LS IC TMP36 IC LM7101BM5 IC ATMega8-16AI IC AD8402AR10 IC ADM1485AR IC SS441 Quartz 14.746 MHz SMD resistors Alum.capacitor SMD tantal capac. SMD tantal capac. SMD capacitors L513(SV,SG,SY) KPL3015G KPL3015R ISP connector Power conn. DJK-02B Line conn. DB9F Pins conn. (pins) Pins conn.(pins) Pins conn.(so ckets) Printed b oard Printed b oard Printed b oard Printed b oard Manufacturer Traco Power Nat.Semicond. WME Analog Dev. Nat.Semicond. Atmel Analog Dev. Analog Dev. Honeywell -- -- -- -- -- -- Kingbright Kingbright Kingbright Custom -- -- -- -- -- Custom Custom Custom Custom Q-ty 1 1 1 1 1 1 1 1 1 1 22 1 2 1 7 3 1 2 1 1 1 1 1 1 1 1 1 1 Rem DIP-24 size See sp ec. TO-93

HC49S 0805 size 16V, D=8 mm B size A size 0805 size LEDs Green Red PCB holes d=2.5mm PLD2-6 PLD-12 PBD-12

19


X1
C1 100mF

D1
1 2 1 24 11

+12 GND

VCC
C2 10mF C3 100n R2 51K

14

R1 130

D2:A

12 13

10 15

C5 1.5mF

R3 270

I5
12 11

C4 10mF

R4 1K

TEM2

GND VCC IL_K IL_A CL_K CL_A HALL STROB LINE B LINE A +12 GND

R5 10K

D2:B
R6 270

10 9 8 7

L1 100mH

+12L

S2
HV GND
1 2

D3
V2 YELLOW GREEN V3

TA-1.0N-12LS

V1

7

1

6

RED

VCC

R7 1K

5 4

6

2

D6
23 24 25 26 PC0/ADC0 PC1/ADC1 AVCC PC2/ADC2 AREF PC3/ADC3 18 20 19 22

R11 5.6K

C6 100n

R8 1.3K

R10 1K

R9 10K

3 2 1

3

4

5

D4
2

3

ATMEGA8-AI16

LINE_BUSY
R12 2K R13 2K

27 28

ADC6 ADC7


1

PC4/ADC4 PC5/ADC5 RESET PB0/ICP PB1/OC1A PB2/OC1B PB3/MOSI PB4/MISO PB5/SCK XTAL1 XTAL2

R14 1.6K

C8 100n

R15 10K

R16 2K

R17 4.7K

2

B2

AGN

1

DE B DI

XTAL2

LINE_BUSY

7

4

Z1
VCC RESET
XTAL1

R19 1.2K

R18 120

MOSI SCK

MISO

GND

C10 12p

C9 12p

ISP/1

ISP/2

ISP/3

ISP/4

ISP/5

ISP/6

20

D5

29 12 13 14 15 16 17 7 8

C7 100n
30 31 32 1 2 9 10 11 1 2 3 RO A RE 1 2 3 4 5

Y2
VCC GND LINE A
OVLIGHT

PD0/RXD PD1/TXD PD2/INT0 INT1/PD3 T0/PD4 PD5/T1 PD6/AIN0 PD7/AIN1

D7
13 12 14 3 4 A1 W1 B1 A2 W2 SDI CS CLK RS SD 8 7 9 10 6

LINE B STROB

D8
6

6

X2
1

R20 1.2K

2 5 9

LINE A LINE B GND VCC

Figure 2.7: Circuit diagram of the main part of the auxiliary electronics.


R1

Y2

X2
R20 R19

X1
C1
5

D2

R5

R4

1

9

12

R7 C2 D8 R10 D4

R2

I5
C3
1 1

D1

C6 C7

D6

R8
1

C9 C10

C8

S2

L1

D3

R17 R14

R9
Z1 D7

ISP
R12 R13
R16

1

V3 V2 V1

R6 D5

R3

R18

+12

C5

Figure 2.8: Placement of the comp onents on the main printed circuit b oard PCB02A of the auxiliary electronics. Designations are the same as in circuit diagrams in Fig. 2.7.

C4

a)
R21 910K

b)
V6

c)
S6
+5V HALL GND
2 3 1

R15

S4
CL_A CL_K
1

S5
IL_A IL_K
2 1

R22 8.2K

D9 H
C11 100n

2

V4

Figure 2.9: Circuit diagrams of the separate parts of the auxiliary electronics: a) control light LED, b) field of view illumination LEDs, c) Hall sensor of the p osition of viewer mirror.

V5

21


a) Cross-plate

b) Sensor plate

c) Control LED
S4/1

I5
S3/2 S3/1

1

S3/14 S3/13

R22

Figure 2.10: Placement of the comp onents on the separate printed circuit b oards PCB02C and PCB02D of the auxiliary electronics. Additional cross plate PCB02B is shown, to o. Designations are the same as in circuit diagrams in Fig. 2.9.

2.4

Stepp er motor mo dule

The circuit diagram of stepp er motor mo dule for centering unit are shown in Fig. 2.11. PCB3 view are presented in Fig. 2.12a and Fig. 2.12b On the PCB3A main part of the mo dule -- motor controller, is placed. This PCB is installed inside of main case of the device. The PCB3B contains the optosensors limiting the movement of triangle knife. The connections b etween these PCB are made soldered. Table 2.5 shows a sp ecification for the Stepp er motor mo dule.

2.5

Connections

Arrangement of cable connections b etween separate PCBs of the device is shown in Fig. 2.13. Connections b etween cross-plate PCB02B and PCB02C, PCB02D, and LEDs of FOV illumination (no PCB) are made by single-core wire. Length of each wire is defined in place. High voltage cable (Fig. 2.13b) is a multi-cored cable with teflon insulation which shield serves as a common wire. It has an outer diameter 3 mm and length 100 mm. The bus b etween Y1 and Y2 connectors (Fig. 2.13c) consists of 6 multi-core wires placed in a plastic tub e. This cable has a length 100 mm. The conductors are lab eled by color tub e according to Table: Next Table contains information on the line cable b etween the device and the host computer (RS485/LPT converter). Sp ecial RS-485 cable Belden 8132 is used.

S6/1 S6/2 S6/3

S4/2

22

R21

C11

D9

V4


D2
PH1
10 11 8 PH1 DIS1 VR1 VM1 MA1 MB1 E1 C1 5 4 2 3
1 2

S7

D1:A
3 1 2

DIS1

+12 DC GND
S9

C2 33mF

C1 100n

4 3 2 1

R1 3K

9

R2 2

4 3 2 1

C3 820 PH2
6 15 14 17 20 21

MA1 MB1 MA2 MB2
S8

PH2 DIS2 VR2

VM2 MA2 MB2 E2

D1:B
7

DIS2

1

23 22

VCC

12

RC

C2

16

C7 2.2mF

C8 2.2n

R6 5.1K

C6 820

D3
13 12 14 3 A1 W1 B1 A2 W2 B2 SDI CS CLK RS SD AGN 8 7 9 10 6 1 27 28 29 12

R4 2

R5 20K

R3 3K

C5 33mF

C4 100n

5

2

+12 DC GND

VCC

D5
PH1 VCC PH2 DIS1 DIS2
23 24 25 26 PC0/ADC0 PC1/ADC1 AVCC PC2/ADC2 AREF PC3/ADC3 ADC6 PC4/ADC4 ADC7 PC5/ADC5 RESET PB0/ICP PB1/OC1A PB2/SS PB3/MOSI PB4/MISO PB5/SCK XTAL1/PB6 XTAL2/PB7 PD0/RXD PD1/TXD PD2/INT0 INT1/PD3 T0/PD4 PD5/T1 PD6/AIN0 PD7/AIN1 30 31 32 1 2 9 10 11 18 3 20 4 19 22 1 2

D4
RO A RE DE B DI 7 1 6 2 3

S10

C9 62n

4 2

ISP/1 ISP/2 ISP/3 ISP/4 ISP/5 ISP/6

GND RESET MOSI MISO SCK VCC

13 14 15 16 17 7

VCC

VCC S11/4

C10 10mF

4

VCC LINE B LINE A GND

R7 1K

V1

R8 1K

V2

V4 SEN L LED ON SEN R S11/1 S11/2 S11/5 R9 5.1K S11/3

V3

Z1
C11 12p C12 12p

8

R10 5.1K

Figure 2.11: Circuit diagram of the stepp er motor controller electronics.

23


Table 2.5: Sp ecification for the Stepp er motor mo dule. Item 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 Part D1 D2 D3 D4 D5 Z1 R2, R4 R1-R10 C1, C4 C2, C5 C7 C10 C3-C12 V1, V2 V3, V4 ISP S7, S8 S9 S10 S11(A) S11(B) PCB03A PCB03B Name IC LM2904M IC PBL3777SI IC AD8402AR10 IC ADM1485AR IC ATMega8-16AI Quartz 14.746 MHz SMD resistors SMD resistors SMD capacitors Alum.capacitor SMD tantal capac. SMD tantal capac. SMD capacitors SDP8406 SEP8506 ISP connector Power conn. PLS-2 Conn. PLS-4 Line conn. PLS2-4 Pins conn. PLS2-5 Pins conn. PLS2-5 Printed b oard Printed b oard Manufacturer Nat.Semicond. Ericsson Analog Dev. Analog Dev. Atmel -- -- -- -- -- -- -- -- Honeywell Honeywell Custom Custom Custom Custom -- -- Custom Custom Q-ty 1 1 1 1 1 1 2 8 2 2 1 1 6 2 2 1 2 1 1 1 1 1 1 Rem

HC49S 1206 size 0805 size 1206 size 16V, D=5 mm A size B size 0805 size Phototrans. IR LEDs PCB holes Soldered PLS2-4 Soldered PLS2-5 Soldered

Table 2.6: Bus colors table Conn. pin 1 2 3 4 5 6 Signal +5V GND Line A Overlight Line B Synchro Color red black white yellow green black

2.6

RS485/LPT converter

The circuit diagram of the converter is shown in Fig. 2.15. PCB views are presented in Fig. 2.14.

24


a)
C6
1

b)
S8
R3
C4 R4

S11
R6
1

C10

C9

1

1

R1

C3

S7

Figure 2.12: Placement of the comp onents on the printed circuit b oard PCB3A (a) and on the printed circuit b oard PCB3B (b). Designations are the same as in circuit diagrams in Fig. 2.11.

C8

1

D1

D4

Z1

Table 2.7: Arrangement of line cable DB9F pin device side 1 2 5 9 5 Signal Line A Line B GND +5V Shield Wire color blue blue-white orange orange-white DB9M pin PC side 1 2 5 9 -- Rem. pair pair pair pair 1 1 2 2

C12

C2

C1

R5

R2

C11

1

V4

R7

V1

25

R9

D2

D5

S10

+

S9

S11

R10

R8

+

C5

C7

D3

1

V3

V2

+

ISP

+


a)
1 2

S7/S8
+12 V GND

S10 S3
+12 V GND CL_A LINE B LINE A HALL
14 13 12 11 10 9 8 7 6 1 2 1 2 4 3 2 1

GND LINE B LINE A +5V

S4
CL_A CL_K

S5
IL_K IL_A

CL_K IL_K IL_A +5V GND

5 4 3 2 1

S6
3 2 1

HALL +5V GND

b)
S1
HV GND
1 2 1 2

S2
HV GND

c)
Y1
STROB LINE B OVLIGHT LINE A GND +5V
6 5 4 3 2 1 6 5 4 3 2 1

Y2
STROB LINE B OVLIGHT LINE A GND +5V

Figure 2.13: Connections b etween a) cross-plate and separate parts of the auxiliary electronics, b) main PCB and PMT dividers and c) main PCB and bicounters PCB. Designations corresp ond to the circuit diagrams in Fig. 2.1 and Fig. 2.9. 26


Table 2.8: Sp ecification for the RS485/LPT converter (see SCH02). Item 1 2 3 4 5 6 7 8 9 10 11 12 Part D1 D2 D3 D4 R1­R9 C2 C4 C2, C3 C5 X1 X2 PCB Name IC ADM1485AR IC ATMega8-16AI IC HCPL0611 IC HCPL0630 Chip resistors Tantal chip capac. Alum.chip capac. Chip capacitors Chip capacitors DB25M connector DB9M Printed b oard Manufacturer Analog Dev. Atmel HP HP -- -- -- -- -- -- -- Custom Q-ty 1 1 1 1 1 1 3 2 2 1 1 1 Rem

0805 size A size B size 1208 size 1208 size LPT Line

Figure 2.14: Printed circuit b oards for the RS485/LPT. Placement of the comp onents is shown. Designations corresp ond to circuit diagrams in Fig. 2.15

27


28 Figure 2.15: Circuit diagram of the RS485/LPT converter.


Chapter 3

Microprogramming and Instructions set
3.1 Logical level of interaction b etween computer and mo dules

As describ ed in Section 1.6, the command and/or data exchange b etween the computer and the mo dules is implemented by byte packet transmissions. Each full cycle of exchange is started with a header byte and terminated with acknowledgment signal. Header byte contains 5-bits address of the destination or departure mo dule and 2-bits cyclic packet numb er to distinguish a transmission rep eat from a new packet. Both header and signal bytes are marked by the parity bit. For distinction b etween them, the header byte is a p ositive numb er and the signal is a negative. Normally two signals are only used: ACK -- acknowledgment of successful data receiving and NAK -- non acknowledgment, which is equivalent to unsuccessful data receiving message. The used logical proto col includes several additional signals to provide a larger information flow rate. The signals contain a self-checked co de with 8 p ossible values. These signals are listed in Table 3.1. Last two signals are not used in MASS exchange proto col and included for a further extension. Table 3.1: Used signal bytes. Signal ACK NAK NOD ACN ACY ACW SINC DNG Hex. co de 0x87 0x96 0xA5 0xB4 0xC3 0xD2 0xE1 0xF0 Meaning Successful receiving of data Damaged packet was received Required data are not ready Command is successfully received but such a command do es not exist Command is successfully received and executed Command is successfully received but can not b e executed right now Synchronization signal Danger signal

29


Within the packet, the command byte follows after the header byte. This byte contains a command to the mo dule, or b oth a command and op erand, or length of the following data blo ck, dep ending on its co de. The enco ding pro cedure is simple and fast. Most of commands are read/write op erations of working variables with or without execution of asso ciated functions. Rest part only run some functions. Naturally, the same function for different mo dules has the same command. For example, request of the mo dule identification has the command co de 0xA2 for all mo dules. If the command byte is less than 0x20 then following bytes represent a blo ck of data with the length equal to this command byte value. Contrary to the command transmissions (from computer to mo dule only, see an exception b elow), the data transmission can go in b oth directions. The maximal length of the data blo ck is 31 bytes. This p ermits to provide a go o d buffered data transmission leaving the line free during long time. Since a cyclic residual control byte (CRC byte) is app ended during transmission and cut off during receiving by a system driver, in the further description of the commands (instructions), CRC byte is omitted. Also, the first byte of a transmitted packet (header byte) is not shown as a rule. Additionally, fault transmission cases are not considered, correct situations are presented only. The instruction sets for the all the mo dules in use are presented b elow. For each instruction, a name (and its co de in parentheses), arguments used (if exist) are written. Normal reply from a mo dule is shown after a left arrow. The resp onse alternatives are put in brackets.

3.2

Bicounter mo dule

Main problem for photometric mo dules is the synchronization of integration and subsequent transmissions. To solve this, one mo dule (Master) generates a synchronization clo ck. Another mo dule (Slave) uses this signal to organize its work at the same rate. To avoid line collisions, the data transmission pro cedure works in inductive mo de. One mo dule is set in Active mo de of data transmission and starts the transmission as so on as the blo ck of data is ready. Another Bicounter is set in Inductive mo de and starts the transmission of integrated data after the packet from its mo dule-Inductor have passed the line. Current status of the Bicounter mo dule is indicated by its Status word accessible for reading. It has the following format: Bit Bit Bit Bit Bit Bit Bit 0 1 2 3 4 5 7 active mode on inductive mode on short format of data transmission on integration using external clock decremental test on data block is ready for transmission integration in progress.

The instructions set is presented b elow. · Pulse discrimination threshold setting for counter A: SET LEVEL A (0x41) level <- ACY, where level is obtained from threshold T in mV with help of 2 constants programmed in 30


the mo dule: level = low(max(0,min(255,255+const2-T*(255+const2-const1)))) · Pulse discrimination threshold setting for counter B: SET LEVEL B (0x42) level <- ACY · Current threshold request for counter A: GET LEVEL A (0xE1) <- level, then T = (255+const2-level)/(255+const2-const1). · Current threshold request for counter B: GET LEVEL B (0xE2) <- level · Micro-exp osure (integration time) setting: SET EXPOS (0x54) low(exposure) high(exposure) <- ACY where exposure is calculated from micro exp osure t in ms with help of 2 constants programmed in the mo dule: exposure = (t*(const3+const4<<8)-1)/8 · Current micro-exp osure request: GET EXPOS (0xF4) <- low(exposure) high(exposure) then t in ms is equal (8*exposure+1)/(const3+const4<<8) · Series length setting: SET NUMBER (0x36) low(number) high(number) <- ACY where number from 1 to 32767, in the case of number = 0 the infinite series is set. · Current series length request: GET NUMBER (0xF6) <- low(number) high(number). · Mo dule status request (see the meaning of the Status bits ab ove): GET STATUS (0xE0) <- status. · EEPROM CRC check: GET CRC (0xEF) <- crc. There are no errors if crc = 0. · Data blo ck size setting: SET BLSIZE (0x28) size <- ACY, where size can b e from 1 to 16, recommended value is 16. · Data blo ck size request: GET BLSIZE (0xE8) <- size. · Inductor address setting: SET INDUC (0x29) address <- ACY. · Inductor address request: GET INDUC (0xE9) <- address. · Request of a new data blo ck: GET DATA (0xA0) <- data block (NOD). Returns NOD if no new data ready. · Mo dule identification request: GET IDENT (0xA2) <- id1 id2 id3 id4. Returns unique identification of the mo dule. 31


· Mo dule constants request : GET CONST (0xA3) <- const1 const2 const3 const4. Returns four constants for threshold and exp osure calculations. · Start up exp osure series: RUN (0x80) <- ACY (ACW). Returns ACW when integration do es not finish yet. · Halt of exp osure series: STOP (0x81) <- ACY. Used to terminate infinite series or to break current integration. · Generation of synchro clo ck on: MASTER ON (0x83) <- ACY (ACW). · Use an external synchro clo ck on: MASTER OFF (0x82) <- ACY (ACW). · Active mo de on: ACTIVE ON (0x88) <- ACY (ACW). · Active mo de off: ACTIVE OFF (0x89) <- ACY (ACW). · Inductive mo de on: INDUCE ON (0x8A) <- ACY (ACW). · Inductive mo de off: INDUCE OFF (0x8B) <- ACY (ACW). · One byte p er count format on: SHORTER (0x84) <- ACY (ACW). · Two byte p er count format on: LONGER (0x85) <- ACY (ACW). · Start up decremental test: RUN TEST (0x86) <- ACY (ACW). The numbers from number-1 to 0 are generated instead of normal counts to check exchange faultiness. Previous instructions return ACW signal if the integration is in progress. · Software restart: RESET (0x87) <- ACY

3.3

Auxiliary mo dule

A brightness of the ap erture illumination is changed step by step and is describ ed by a following equation: illumination = floor(2^(8*n/15.01)+0.5) if n = 0, illumination = 0 if n = 0. The pro cedure of a rep etitive turning on of the high voltage after the overlight detection is following: HV turn off, Safety turn off, Safety turn on and then HV turn on. This pro cedure is made in such a complex way to protect from o ccasional turning on of the high voltage. 32


Current status of this mo dule is indicated by its Status word accessible for reading. It has the following format: Bit Bit Bit Bit Bit Bit Bit Bit 0 1 2 3 4 5 6 7 high voltage turned on safety on (overlight protection on) overlight indicator high voltage locking control light on illumination on modulation of the control light on viewer mirror of axis

The instructions set is presented b elow. · Illumination brightness setting: SET ILLUM (0x41) illumination <- ACY illumination is calculated from relative brightness IL (from 0 to 1.0): illumination = low(max(0,min(255,255*IL))) · Illumination brightness request: GET ILLUM (0xE1) <- illumination where IL = illumination/256 · Control light brightness setting: SET LIGHT (0x42) light <- ACY light is calculated from relative brightness CL (from 0 to 1.0): light = low(max(0,min(255,255*IL))). The brightness setting instructions do not turn on light. · Control light brightness request: GET LIGHT (0xE2) <- light where CL = light/256 · Mo dule status request (see the meaning of the Status bits ab ove). GET STATUS (0xE0) <- status · EEPROM CRC check GET CRC (0xEF) <- crc. There are no errors if crc = 0. · Control light mo dulation amplitude setting: SET VAMPL (0x23) delta <- ACY where delta = low(max(0,min(255,255*DL*CL))) and DL is a relative amplitude. · Control light mo dulation amplitude request: GET VAMPL (0xE3) <- delta, then DL = (delta/256)/CL. · Illumination turn on: ILLUM ON (0x80) <- ACY (ACW) · Illumination turn off: ILLUM OFF (0x81) <- ACY (ACW). 33


· Control light turn on: LIGHT ON (0x82) <- ACY (ACW). · Control light turn off: LIGHT OFF (0x83) <- ACY (ACW). · Control light mo dulation turn on: VARY ON (0x84) <- ACY (ACW). · Control light mo dulation turn off: VARY OFF (0x85) <- ACY (ACW). · High voltage value setting: SET VOLTAGE (0x44) high <- ACY, where high is calculated from needed voltage in V with help of 2 programmed constants: high = low( max( 0, min(255, 0.001*U*const1 -cons2))). The instruction do es not turn on the high voltage. · High voltage value request: GET VOLTAGE (0xE4) <- high. Then U = 1000*(high+const2)/const1. · High voltage turn on: HIGH ON (0x88) <- ACY (ACW). Returns ACW in a case of lo cking, and do es not turn anything on the high voltage. · High voltage turn off: HIGH OFF (0x89) <- ACY. · Safety turn on: SAFETY ON (0x8A) <- ACY (ACW). Executes only if the HV is turned off. · Safety turn off: SAFETY OFF (0x8B) <- ACY (ACW). Executes only if the HV is turned off. · Device temp erature request: GET TEMPER (0xE5) <- temperature. Temp erature in C is equal to -20+(temperature)/4. · Mo dule identification request: GET IDENT (0xA2) <- id1 id2 id3 id4. Returns unique identification of the mo dule. Also, this instruction switches mo dule from autonomous work to under computer control. · Mo dule constants request: GET CONST (0xA3) <- const1 const2 const3 const4. Returns four constants. · Software restart: RESET (0x87) <- ACY.

34


3.4

Stepp er motor controller mo dule

Current status of this mo dule is indicated by its Status word accessible for reading. It has the following format: Bit Bit Bit Bit Bit Bit 0 1 2 5 6 7 new microstep is done left stop is achieved right stop is achieved disable motor powering forward motion motor is moving

The instructions set is presented b elow. · Mo dule status request (see the meaning of the Status bits ab ove): GET STATUS (0xE0) <- status · EEPROM CRC check GET CRC (0xEF) <- crc. There are no errors if crc = 0. · Current p osition request: GET POSITION (0xF2) <- low(position) high(position). position changes during motion. · Relative shift start up: SHIFT AT (0x54) low(shift) high(shift) <- ACY (ACW), where shift is a signed integer value. · Motion sp eed setting: SET SPEED (0x56) low(speed) high(speed) <- ACY (ACW), where speed is p ositive integer, and can b e calculated from step p erio d T(ms) speed = (T*(const3+const4<<8)-1)/8 · Motion sp eed request: GET SPEED (0xF6) <- low(speed) high(speed), then T in ms is equal (8*speed+1)/(const3+const4<<8) · Turn on stepp er motor p owering: TURN ON (0x80) <- ACY (ACW). ACW when motor is moved, ACY otherwise. · Turn off stepp er motor p owering: TURN OFF (0x81) <- ACY (ACW). ACW when motor is moved, ACY otherwise. · Motor status check: TEST MOTION (0x82) <- ACY (ACW). ACW when motor is moved, ACY otherwise. · Start up motion to left stop: AT LEFT (0x83) <- ACY (ACW). ACW when motor is moved already, ACY otherwise. 35


· Start up motion to right stop: AT RIGHT (0x84) <- ACY (ACW). ACW when motor is moved already, ACY otherwise. · Emergency stop: STOP (0x85) <- ACY (ACW). ACW when motor isn't moved, ACY otherwise. · Sensor LED turn on: LED ON (0x88) <- ACY (ACW). · Sensor LED turn off: LED OFF (0x89) <- ACY (ACW). · Clear absolute p osition: CLEAR ABS (0x8A) <- ACY (ACW). Here and ab ove ACW returned when motor is moved. · Mo dule identification request: GET IDENT (0xA2) <- id1 id2 id3 id4. Returns unique identification of the mo dule. · Mo dule constants request: GET CONST (0xA3) <- const1 const2 const3 const4. Returns four constants. · Software restart: RESET (0x87) <- ACY.

3.5

Up dating a micro co de

The ATMega8 micro controller has a useful feature -- Bo ot Loader Supp ort (BLS), which p ermits to change part of micro co de for application with help of another part of the micro co de - so called b o ot loader. In practice, the micro controller is programmed for the first time only by the b o ot loader software with help of any ISP programmator. This loader program starts each time after p ower on. This co de supp orts a numb er of sp ecial commands which p ermit to load the new version of the needed application software in the flash memory. In order to switch from the micro co de up date state to the working state, the mo dule must receive the RESET command. In the normal work when Turbina software is started, it sends RESET as first command for each mo dule. After that, mo dule go es into application mo de and op erates further in this mo de. There is a p ossibility to return into b o ot loader mo de with a sp ecial command: BOOT (0xC0) <- ACY. Bo ot loader itself can't b e reprogrammed this way, what guarantees the p ossibility to rep eat the application software up date even if a serious problem has o ccurred during the up dating pro cess. Since the up dating pro cedure uses the same RS-485 line for data transfer, no additional cabling or device disassembling are required. MASS software distribution contains an utility avrup in the directory avrup of the RS485 driver package. Before its usage the needed steps for RS-485 driver installation must b e done and MASS device must b e connected and p owered on. To reprogram any mo dule, its application co de Naprimer.hex in Generic format must b e prepared. For example, conversion 36


of the assembler application text into the generic (hex) format may b e done with help of Atmel AVR assembler avrasm32.exe started via wine software under Linux OS directly. The avrup utility has 3 options: · -b bootaddress -- indicates that the mo dule will b e up dated with the b o ot loader address = bootaddress (hex). · -a appladdress -- indicates that mo dule will have address = appladdress (hex) after up dating. · -r baudrate -- indicates that mo dule will have new exchange rate = baudrate (Kbaud) after up dating. We recommend to always save appladdress the same as bootaddress, b oth corresp onding to the mo dule address in device.cfg file. For example, to up date Bicounter1 with new co de, execute: .\avrup -a1 -b1 bicounter.hex Note, that the same micro co de bicounter.hex is used for b oth Bicounters. Being started, the utility detects the state of the mo dule (application or up date) accessing it via the b o ot address. Note that problem may arise if the b o ot and application addresses of this mo dule differ. If needed, the mo dule is switched into up date state. In case the application address or baudrate are given in command options, the resp ective co de words are mo dified b efore uploading. Then avrup loads the application co de page by page from the zero address and checks it by back reading and comparison. This progress of this uploading and checking is shown in console. After end of uploading the mo dule is reset into application state. Note, that for control needs, the utility mo difies the 3rd and 4th bytes of the mo dule identification replacing them with the enco ded current programming date. This new identification is displayed in the end of reprogramming and should b e written in resp ective section of device.cfg. If forgotten, the next start of Turbina will output the warning message ab out the invalid identification of the reprogrammed mo dule.

37