---+ Implementation

The main purpose of this page is to plan the path forward (outline TODO items) on implementing digital active feedback (DAF).

Firmware

Tijmen wrote a first attempt at DAF firmware. Initial tests show that if some combination of the inputs are within a certain dynamic range, the output carrier voltage amplitude is correct.

Adam set up a git tree for the firmware, and Graeme has integrated it into the existing DfMUX firmware.

Usage

You can write to DAF registers via a telnet session as follows:

# devmem2 <register> w <value>
...where <register> is taken from the following table and <value> is the register value to be written (specified in 0xhexnumber or decimal notation).

Address Register
0x77a06000 V_bolo_target
0x77a06004 Xs
0x77a06008 Rs
0x77a0600c Control Coefficient
0x77a06010 Lower Rail
0x77a06014 Upper Rail
0x77a06018 Status Word (low 32 bits)
0x77a0601c Status Word (high 32 bits)
0x77a06020 Current I measurement
0x77a06024 Current Q measurement
0x77a06028 Voltage measurement
Table 1: Register Locations; DAF block

Comments:

  • All registers specify the upper 32 bits of the underlying DAF register (which is 36 bits long.) The lower 4 bits are all zero.

In addition to DAF registers, the July 9, 2010 release adds DAF-specific registers to the DMFS. There is one new register (with one meaningful bit) per DMFS channel, which controls whether that DMFS channel accepts data from DAF or not. It makes sense only to enable a single DMFS channel at a time.

Address Register
0x77a03000 Wire 1, Channel 1 DAF enable
0x77a03010 Wire 1, Channel 2 DAF enable
0x77a03020 Wire 1, Channel 3 DAF enable
...
0x77a030f0 Wire 1, Channel 16 DAF enable
0x77a03100 Wire 2, Channel 1 DAF enable
...
0x77a031f0 Wire 2, Channel 16 DAF enable
0x77a03200 Wire 3, Channel 1 DAF enable
...
0x77a032f0 Wire 3, Channel 16 DAF enable
0x77a03300 Wire 4, Channel 1 DAF enable
...
0x77a033f0 Wire 4, Channel 16 DAF enable
Table 2: Register Locations; DMFS block

Writing a '1' (to this register closes the DAF feedback loop by automatically updating carrier amplitudes; writing 0 breaks feedback.

July 9, 2010 Release

This release hasn't been kick-tested yet.

fsboot.ace LX160 Bitstream

Nov. 7, 2009 Release

There are several new features:

  • The input is calculated from the complex magnitude of DMFD channels 0,1. (These must be synchronized for sane results!)
  • The sqrt block only updates its results if the argument is positive
  • Streamer channel 2 (zero-indexed!) now reflects the v_carrier output
  • (This is commit fdce6ce57b29f85ce2c2065b4c83e6ebb4a74138 of the DAF hardware tree)

File Comment
fsboot.ace LX160 Bitstream
Release Files

Oct. 29, 2009 Release

Adds readback registers for current and voltage signals. The high 32 (of 36) bits are returned; see the register map above.

  • (This is commit e29684f466026102894aae4f1a8a18a92c200d69 of the DAF hardware tree)

File Comment
fsboot.ace LX160 Bitstream
Release Files

Oct. 13, 2009 Release

This integrates Tijmen's "DAF 2.0" code.

  • (This is commit 57e281027f64df7ac1c2c40131235cd770c71dc0 of the DAF hardware tree)
  • General code cleanup, name change to control_coeff
  • Implements upper and lower rails for v_carrier

File Comment
fsboot.ace LX160 Bitstream
Release Files

Oct. 1, 2009 Release

This version has been updated as follows:

  • There are now two status registers that latch the "invalid" and "overflow" bits from FP blocks. The register table above has been updated.
  • I-term accumulator is zero'd when a new I coefficient is supplied to the firmware
  • (This is commit 39c326332cd894c078acb48c74f7d881ecb1c1d6 of the DAF hardware tree)

File Comment
fsboot.ace LX160 Bitstream
Release Files

Sept. 28, 2009 Release

This version has been updated as follows:

  • NaN results for both the I-term accumulator and amplitude output should not persist
  • I-term accumulator is zero'd when a new I coefficient is supplied to the firmware
  • (This is commit 99bb0e577b6ab4004beba072ef4315f8edd6d60c of the DAF hardware tree)

File Comment
fsboot.ace LX160 Bitstream
Release Files

Sept. 9, 2009 Release

Please use the most recent uboot.ace and image.ub files from the usual place.

File Comment
fsboot.ace LX160 Bitstream
Release Files

Firmware Summary

The following illustration shows the flowchart equivalent of the DAF Firmware. Note that the dotted line closes the loop and makes DAF a feedback process.

Testing

Before interacting with the DAF module, I configured the DfMUX as follows:

  1. power on mezz
  2. set channel 0 (carrier, demod) frequency to 650 kHz
  3. set carrier, demod gains to 1
  4. launch streamer
  5. launch parser
  6. view real-time streamed data via KST

For most of these steps, modify the following script:

from wtl_package import *

m = wtl_FpgaMotherboard('192.168.0.72')
s = wtl_DataStreamer(m,'dfmux_udps://224.168.1.1:8888')

m.set_frequency(650000, 'Ch1', ['carrier','demod'],'Mux1')
m.set_gain(1,['carrier','demod'])
m.set_mezz_power('on','mezz1')

s.launch(mapfile="bolo_68")

Then, I used the following test sequence to see signs of life:

# devmem2 0x77a0600c w 0x07ffffff
# devmem2 0x77a06000 w 0x07ffffff

As the carrier and demodulator modules are tuned to the same frequency, this produces a step-like response in KST.

ALERT! It seems easy to "lock up" the module with other parameter writes: this needs investigation.

Initial Tests

The initial test of the DAF firmware will probably involve connecting a potentiometer in place of a bolometer and reading a current or voltage response manually. Placing a resistor in series with the potentiometer could act exactly as the type of load the DAF is trying to correct.

Note that choosing the resistance values of the potentiometer and resistor at room will require some careful thinking and will not completely test the unit conversion mentioned above.

I'm designing such a test at TestingDafFirmware.

Units (30Oct09)

The inputs and outputs of DAF firmware are two's complement 36 bit numbers. Since the inputs are current, resistance and voltage and the output is a voltage amplitude, some units for those quantities need to be defined. Let's explain these definitions in devmem2's units. These are 8 hexadecimals and hence log_2(8*16)=32 bit numbers. The actual fixed point units used inside the DAF firmware are 36 bits long, so the 4 least significant bits are set to 0 when communicating to the registers. Hence the conversion from hex to physical units is as follows:

  • 0x10000000 = 1

Measuring R_s

By shorting out the bolometer, the ratio of voltage to current can be measured. In one case (carrier_gain=3, demod_gain=0) I found the following:

Voltage Current Inferred Resistance
0.682 0.092 7.41
1.023 0.137 7.47
1.364 0.183 7.45

Physically, my circuit consists of R_bolo=1kOhm, Rs~1.08kOhm, so I expect to tell the firmware that R_s=3.86. However, by trial and error I find that DAF functions correctly when told that R_s=0.75.

-- TijmenDeHaan - 01 Sep 2009

Topic attachments
I Attachment Action Size Date Who Comment
PNGpng demod_compression.png manage 27.6 K 2010-12-02 - 15:17 TijmenDeHaan  
JPEGjpg firmware_flowchart.jpg manage 238.0 K 2009-09-08 - 14:42 TijmenDeHaan  
Unknown file format2010 fsboot.ace.july9.2010 manage 5032.4 K 2010-07-12 - 20:31 GraemeSmecher  
Unknown file format2009 fsboot.ace.nov7.2009 manage 5035.9 K 2009-11-09 - 15:43 GraemeSmecher  
Unknown file format2009 fsboot.ace.oct1.2009 manage 5035.9 K 2009-10-01 - 15:46 GraemeSmecher  
Unknown file format2009 fsboot.ace.oct13.2009 manage 5035.9 K 2009-10-13 - 21:06 GraemeSmecher  
Unknown file format2009 fsboot.ace.oct29.2009 manage 5035.9 K 2009-10-29 - 14:01 GraemeSmecher  
Unknown file format2009 fsboot.ace.sept28.2009 manage 5035.9 K 2009-09-28 - 23:39 GraemeSmecher  
Unknown file format2009 fsboot.ace.sept9.2009 manage 5035.5 K 2009-09-09 - 16:56 GraemeSmecher  

This topic: ColdFeedback > WebHome > DigitalActiveFeedbackImplementation Topic revision: r23 - 2010-12-02 - TijmenDeHaan
© 2020 Winterland Cosmology Lab, McGill University, Montréal, Québec, Canada