Startup notes

From RF Coil Lab
Jump to navigation Jump to search

Below are some notes intended to help if you'd just received an amplifier board kit from MGH and are starting to set up the system.

Hardware setup

You will need a USB to micro-USB cable to communicate with the Teensy 3.5 microcontroller.

You will need 9 of these fiber optic cables:

There are also shorter lengths:

We recommend tying the cables together with heat shrink tubing or cable ties. If you need a longer length, there are connectors/couplers that you can use to connect two fiber cables end-to-end.

Remaining steps for setting up the hardware:

(1) Make Molex cables using connectors and crimp-on pins (ideally with a Molex crimp tool but you can do it with pliers if you’re careful) (2) Obtain 9 fiber optic cables to communicate between microcontroller board and fiber interface board. (3) Populate OPA549 power op amps. This must be done carefully. I recommend fastening the op amps to the heat sink first, and then soldering the pins afterward. This avoids putting mechanical strain on the pins. If you solder them first and then screw them to the heat sink, the pins can be damaged and the op amp becomes unreliable. Make sure you buy the OPA549T part number that matches the board hole layout (not the ‘S’ part number).

Please make sure you have the most recent version of the EAGLE circuit board schematics and the Powerpoint setup slides from this Wiki.

There is a 70 ampere fuse on each amplifier board to protect against short circuits. You can change this fuse or bridge it as needed.

Teensy microcontroller code

Our documentation for the control software is still missing (hopefully to be fixed in 2020...), so here are some guidelines for getting started:

In hardware.h, To address two amplifier boards (16 channels), change this line of code:

    const int boardMap[NUM_B] = {0};//{3,4,5,6};   THESE ARE THE CHANNELS THAT ARE IN USE

so that it addresses boards 0 and 1:

    const int boardMap[NUM_B] = {0,1};//{3,4,5,6};   THESE ARE THE CHANNELS THAT ARE IN USE

Also change the number of boards to two:


You set the current on the channels here:

    const int loopsize = 2  ;
    float output_currents[loopsize][8] =
    {0,2,2,-2,0,-2,0,0}};   // put currents here

If you are using two amplifier boards then the lines would look something like this:

    const int loopsize = 2  ;
    float output_currents[loopsize][8] =
    {0,2,2,-2,0,-2,0,0,0,2,1,0,0,-2,0,0}};   // put currents here

I just put random values for the currents. The loop will repeat if you get more than 2 triggers. Allow approximately 500us settling time after triggering before playing an RF pulse or acquiring readout data.

This will loop through two rows of shim currents when triggers are received via fiber optic input to the blue receiver on the other side of the microcontroller board closest to the Teensy. There is also a way to trigger the board using a BNC connector is you prefer (I can provide instructions for this if you are interested).

If you want to trigger on the fiber optic input to advance the shim setting, you must uncomment this line:

     attachInterrupt(interruptPin, setDACVal, FALLING); // UNCOMMENT ME FOR TRIGGERS

If you do not want to use triggers, then comment out this line or just disconnect the trigger fiber.

Important commands for using the microcontroller. Open the port dialog window. Then use “I” to read the current on all channels. “Z” will zero all channels immediately. “C” will run an autocalibration on each channel to zero out the small offset current (usually 1-10mA per channel). The autocalibration is useful because it will tell you with an “X” if any channel is broken or disconnected from the load (e.g., open-circuited). If all channels pass the autocalibration, then most likely everything is working OK. “M” will advance to the next row of shim currents. After uploading the code to the micro-controller, you can press “M” to load the first row of currents.

There is another version of the Teensy code (available upon request) with a better looping structure for the currents, allowing blocks of shim currents to be played a desired number of times each.

Note that the autocalibration code in the default code is hard-coded to use 32 shim amplifier channels (4 boards). If you are using a different number of boards, you need to manually adjust this code. For example, to use a single 8-channel board, you can comment out the unneeded calibration lines as follows:

          for (int i = 0; i < 8; i++) {
            calibrate_channel(0, i);
       // for (int i = 0; i < 8; i++) {
       //   calibrate_channel(1, i);
       // }
       // for (int i = 0; i < 8; i++) {
       //   calibrate_channel(2, i);
       // }
       // for (int i = 0; i < 8; i++) {
       //   calibrate_channel(3, i);
       // }

Don’t go above 3.5 amps of current with the boards as presently configured. We can go a little higher if you need to, but it will require changing the resistors on the analog input stage of each channel to increase the gain. You can test the system to see how high it will go but at some point the DAC reaches its limit (~2.4 volts). The analog stages uses the difference between a reference voltage (~1.2 V) and the DAC output voltage to set the polarity and amplitude of the output current, with a gain of approximately 3.5 (you can measure the exact gain). Changing the input resistors on the analog stage will adjust the gain. The 1nF capacitor in parallel acts with the 10 kohm resistors as a low pass filter on the DAC output to remove high frequency components which are outside the amplifier’s bandwidth and can only cause bad things (like instability). This slows the output current rise time, but only slightly. This can be good for reducing noise and torques in the shim coil. To reduce the rise time further, you can increase this capacitor value. I’m attaching Matlab simulation software that gives you the approximate transfer function of the amplifier and step response for a specified load impedance.

Note that there is also a 10 kohm resistor on each OPA549 I_lim pin which limits the current to 3.5 amps in the present design. If you'd like to use higher output currents, please replace this resistor with a smaller value (or 0 ohms to use the full output range up to 8 amps).