# Resonance Control Firmware

In order to build the Resonance Control firmware (at least in a UNIX environment) you need to first establish some symbolic links:

	$ make links

Then, to build the firmware:

	$ make resonance_control.bit

## Piezo Module

The piezo low-level control module is stored in the piezo folder. The wrapper is piezo_wrapper.v, with its associated testbench available at piezo/ip/Testbench/piezo_wrapper_tb.v. This module consists of several blocks, including:

* Top-level wrapper
* DAC input data sequencer (2 inputs, one output)
* ADC update controller
* Piezo power monitoring and alarms

The data flow is described in a [diagram](../piezo_fw-resonance_control_dsp_v2.png).

## Controllers

Currently the active controller is a filter bank designed by Warren Schappert at Fermilab. An almost drop-in replacement is also available that was designed by Larry Doolittle, but the Python support scripts are not in place for this. Associated management scripts can be found in the root/software/res_ctl/ folder.


## Stepper Module

Stepper code

## JLAB POF and Controller

In order to use the resonance control chassis with legacy JLab LLRF controllers, a plastic optical fiber interface is available
