x_output_array = np.zeros(sampleNum) dac_output_array = np.zeros(sampleNum) eom_output_array = np.zeros(sampleNum) microscope_output_array = np.zeros(sampleNum) pmt_output_array = np.zeros(sampleNum) pid_error_array = np.zeros(sampleNum) pid_kp_array = np.zeros(sampleNum) pid_integrator_array = np.zeros(sampleNum) pid_pin_array = np.zeros(sampleNum) # device declaration and initiation eoModulator = analog_device.EOM(0.4, 2, 1, 0.01, 10) eoModulator.deviceIni(np.zeros(200), np.zeros(200)) tpMicroscope = analog_device.Microscopy(0, 125, 0.005) tpMicroscope.deviceIni(np.zeros(200), np.zeros(200)) pmTube = analog_device.PMT(0.2, 50, 10000, 4) pmTube.deviceIni(np.zeros(200), np.zeros(200)) pDidode = analog_device.PhotoDidode(0.2, 20, 4, 2) pDidode.deviceIni(np.zeros(200), np.zeros(200)) outputLP = analog_device.LowPassFilter(0.04, 1, 1) outputLP.deviceIni(np.zeros(200), np.zeros(200)) daConverter = analog_device.DAC(0.04) daConverter.deviceIni(np.zeros(200), np.zeros(200)) adConverter = analog_device.ADC(0.04) adConverter.deviceIni(np.zeros(200), np.zeros(200)) adConverter2 = analog_device.ADC(0.04) adConverter2.deviceIni(np.zeros(200), np.zeros(200)) pidController = FPGA.PID(sp_set, kp_set, ki_set, kd_set, pmax_set, integrator_set) xLog = FPGA.LogComputation() # imaging loop for i in range(0, sampleNum, 1):
desired_out_array = np.zeros(sample_num) dac_output_array = np.zeros(sample_num) eom_output_array = np.ones(sample_num) microscope_output_array = np.zeros(sample_num) pmt_output_array = np.zeros(sample_num) pid_pin_array = np.zeros(sample_num) laserPower = np.ones(sample_num) x_current = np.ones(sample_num) x_origin = np.ones(sample_num) x_ave = np.zeros(line_image.shape[0]) # device declaration and initiation (delayTime, bandWidth, gain) eoModulator = analog_device.EOM(0, 10, 5, 0.01, 3) eoModulator.deviceIni(np.zeros(simulation_span), np.zeros(simulation_span)) tpMicroscope = analog_device.Microscopy(0, 125, 0.005) tpMicroscope.deviceIni(np.zeros(simulation_span), np.zeros(simulation_span)) pmTube = analog_device.PMT(0, 10, 10, 1) pmTube.deviceIni(np.zeros(simulation_span), np.zeros(simulation_span)) pDidode = analog_device.PhotoDidode(0, 10, 1, 2) pDidode.deviceIni(np.zeros(simulation_span), np.zeros(simulation_span)) outputLP = analog_device.LowPassFilter(0.01, 10, 1) outputLP.deviceIni(np.zeros(simulation_span), np.zeros(simulation_span)) daConverter = analog_device.DAC(0) daConverter.deviceIni(np.zeros(simulation_span), np.zeros(simulation_span)) adConverter = analog_device.ADC(0) adConverter.deviceIni(np.zeros(simulation_span), np.zeros(simulation_span)) adConverter2 = analog_device.ADC(0) adConverter2.deviceIni(np.zeros(simulation_span), np.zeros(simulation_span)) fbController = FPGA.PID(sp_set, img_cols * pixel_time * sampling_freq) xLog = FPGA.LogComputation() # imaging loop