%% Clear Workspace and Close figures clear; close all; clc; %% Intialize Laplace variable s = zpk('s'); %% Path for functions, data and scripts addpath('./src/'); % Path for scripts addpath('./mat/'); % Path for data addpath('./STEPS/'); % Path for Simscape Model addpath('./subsystems/'); % Path for Subsystems Simulink files %% Colors for the figures colors = colororder; freqs = logspace(1,4,1000); % Frequency vector [Hz] %% Load computed requirements load('instrumentation_requirements.mat') Cp = 8.8e-6; % Capacitive load of the two piezoelectric actuators f0 = 5e3; % Wanted low signal bandwidth [Hz] Ro_max = 1/(2*pi*f0 * Cp); % Maximum wanted output impedance [Ohm] %% Slew-rate specifications - Triangular scan Vpp = 170; % Full voltage scan [V] f0 = 100; % Repetition rate of the triangular scan [Hz] slew_rate = 1e-3*2*Vpp*f0 % Required slew rate [V/ms] %% Maximum Output Current - Triangular scan max_current = 2*Vpp*f0*Cp % [A] delta_V = 20; % +/-10 V Fs = 10e3; % Sampling Frequency [Hz] max_adc_asd = 11e-6; % V/sqrt(Hz) min_n = log2(delta_V/(sqrt(12*Fs)*max_adc_asd)) %% Estimate quantization noise of the ADC delta_V = 20; % +/-10 V n = 16; % number of bits Fs = 10e3; % [Hz] q = delta_V/2^n; % Quantization in [V] q_psd = q^2/12/Fs; % Quantization noise Power Spectral Density [V^2/Hz] q_asd = sqrt(q_psd) % Quantization noise Amplitude Spectral Density [V/sqrt(Hz)]