WH-17 - Alignment error is now latched in the status register even when the correction is skipped. This allows the user to spot situations when the loop cannot lock any more because of the cumulated error

This commit is contained in:
gianmarcogirau 2019-08-14 09:41:06 +01:00
commit 2fd11612b3
4 changed files with 35 additions and 16 deletions

View file

@ -22,6 +22,7 @@ add wave -noupdate -radix decimal /ch_ctrl_cfg_tb/iUUT/wh_tot_err
add wave -noupdate -radix decimal /ch_ctrl_cfg_tb/iUUT/wh_delta_err
add wave -noupdate -radix decimal /ch_ctrl_cfg_tb/iUUT/wh_loop_err
add wave -noupdate /ch_ctrl_cfg_tb/wh_pos_err_r
add wave -noupdate /ch_ctrl_cfg_tb/iUUT/wh_pos_err_curr
add wave -noupdate /ch_ctrl_cfg_tb/init
add wave -noupdate /ch_ctrl_cfg_tb/pd_in
add wave -noupdate /ch_ctrl_cfg_tb/skip_pd
@ -244,7 +245,7 @@ add wave -noupdate /ch_ctrl_cfg_tb/iUUT/iPD_queue/delay_line
add wave -noupdate /ch_ctrl_cfg_tb/iUUT/iPD_queue/local_time_d
add wave -noupdate /ch_ctrl_cfg_tb/iUUT/iPD_queue/event_time
TreeUpdate [SetDefaultTree]
WaveRestoreCursors {{Cursor 1} {187312146 ps} 0} {{Cursor 2} {16802400153 ps} 0}
WaveRestoreCursors {{Cursor 1} {187312146 ps} 0} {{Cursor 2} {14065649173 ps} 0}
quietly wave cursor active 2
configure wave -namecolwidth 293
configure wave -valuecolwidth 216
@ -260,4 +261,4 @@ configure wave -griddelta 40
configure wave -timeline 0
configure wave -timelineunits ps
update
WaveRestoreZoom {0 ps} {6162874368 ps}
WaveRestoreZoom {10984211989 ps} {17147086357 ps}

View file

@ -6,7 +6,7 @@
-- Author : Gianmarco Girau
-- Company : Global Inkjet Systems
-- Created : 2016-10-24
-- Last update: 2019-08-08
-- Last update: 2019-08-13
-- SVN ID : Git
-- Standard : VHDL'93
-------------------------------------------------------------------------------
@ -126,7 +126,7 @@ architecture rtl of pulse_generator_2 is
signal tof_lut_wr_q, tof_lut_comp : std_logic_vector(15 downto 0);
signal tof_lut_comp_i : std_logic_vector(15 downto 0);
signal enc_speed_meas_w_i, enc_vel_i : std_logic_vector(19 downto 0);
signal img_size, pixel_cnt : std_logic_vector(23 downto 0);
signal img_size, pixel_cnt, wh_pos_err_curr : std_logic_vector(23 downto 0);
signal ch_ctrl_vector_out, wh_pos_err_abs : std_logic_vector(23 downto 0);
signal wh_pos_err, wh_skip_corr_thres : std_logic_vector(23 downto 0);
signal wh_pos_err_max, wh_pos_err_min : std_logic_vector(23 downto 0);
@ -474,6 +474,11 @@ begin
else
wh_pos_err_abs <= wh_pos_err;
end if;
if(init_wh = '1') then
wh_pos_err_curr <= (others => '0');
elsif(wh_corr_ready_v(0) = '1') then
wh_pos_err_curr <= wh_pos_err;
end if;
if(unsigned(wh_pos_err_abs) > unsigned(wh_skip_corr_thres) and first_img_started = '1') then
wh_skip_corr <= '1';
elsif(loc_pd = '1') then
@ -977,7 +982,7 @@ begin
when WH_LOOP_FILT_COEFF =>
avs_readdata_i <= wh_loop_filt_tot & wh_loop_filt_delta;
when WH_POS_ERR_CURR_REG =>
avs_readdata_i <= X"00" & wh_pos_err;
avs_readdata_i <= X"00" & wh_pos_err_curr;
when WH_POS_ERR_MAX_REG =>
avs_readdata_i <= X"00" & wh_pos_err_max;
when WH_POS_ERR_MIN_REG =>

View file

@ -6,7 +6,7 @@
-- Author : GMG
-- Company : Global Inkjet Systems
-- Created : 2019-05-17
-- Last update: 2019-08-09
-- Last update: 2019-08-13
-- SVN ID : Git
-- Standard : VHDL'2008
-------------------------------------------------------------------------------
@ -449,7 +449,7 @@ begin -- architecture behav
pGET_WH_ERR : process
alias wh_pos_err is <<signal iUUT.wh_pos_err : std_logic_vector(23 downto 0)>>;
alias wh_pos_err is <<signal iUUT.wh_pos_err_curr : std_logic_vector(23 downto 0)>>;
alias wh_corr_meas_ready is <<signal iUUT.wh_corr_ready_v : std_logic_vector(4 downto 0)>>;
@ -581,7 +581,9 @@ begin -- architecture behav
pSKIP_PD : process
begin
if(pd_in_cnt = 45 or pd_in_cnt = 50 or pd_in_cnt = 57 or pd_in_cnt = 64 or pd_in_cnt = 72) then
if(pd_in_cnt = 47 or pd_in_cnt = 6 or pd_in_cnt = 49 or
pd_in_cnt = 43 or pd_in_cnt = 48 or pd_in_cnt = 55 or
pd_in_cnt = 62 or pd_in_cnt = 71 or pd_in_cnt = 72) then
if(SKIP_PD_EN = true) then
skip_pd <= '1';
end if;

View file

@ -29,14 +29,6 @@ pd_num = []
pd_time = []
pd_pos = []
log_file_name = './hmb_log2.txt'
data_file_name = './pitch_corr.csv'
pd_file_name = './pd_log.csv'
plot_file_name_1 = './pitch_corr_1.html'
plot_file_name_2 = './pitch_corr_2.html'
plot_file_name_3 = './delta_pd.html'
##/////////////////////////////////////////////////////////////////////////////
## Get data from the log file
##/////////////////////////////////////////////////////////////////////////////
@ -109,6 +101,8 @@ def plot_pd_dat(pd_num, pd_time, pd_pos, outfile, flexo_label=''):
pd_var.append(delta_pd[idx-1]-pd_avg)
data_range = max(delta_pd)-min(delta_pd)
if data_range == 0.0:
data_range = 1.0
plot_range = [min(delta_pd)-data_range, max(delta_pd)+data_range]
# PD variation on a cycle-by-cycle basis
@ -134,6 +128,8 @@ def plot_pd_dat(pd_num, pd_time, pd_pos, outfile, flexo_label=''):
s1.circle(pd_num[1:], delta_pd, size=5, color="navy", alpha=0.5)
data_range = max(pd_var)-min(pd_var)
if data_range == 0.0:
data_range = 1.0
plot_range = [min(pd_var)-data_range, max(pd_var)+data_range]
s2 = figure(width=plot_w, height=plot_h, x_range=s1.x_range, y_range=plot_range, title='PD variation from average',
@ -142,6 +138,8 @@ def plot_pd_dat(pd_num, pd_time, pd_pos, outfile, flexo_label=''):
s2.triangle(pd_num[1:], pd_var[1:N], size=10, color="olive", alpha=0.5)
data_range = max(pd_cbc)-min(pd_cbc)
if data_range == 0.0:
data_range = 1.0
plot_range = [min(pd_cbc)-data_range, max(pd_cbc)+data_range]
s3 = figure(width=plot_w, height=plot_h, x_range=s1.x_range, y_range=plot_range,
@ -151,6 +149,8 @@ def plot_pd_dat(pd_num, pd_time, pd_pos, outfile, flexo_label=''):
s3.circle(pd_num[1:], pd_cbc[1:N], size=10, color="firebrick", alpha=0.5)
data_range = max(enc_speed) - min(enc_speed)
if data_range == 0.0:
data_range = 1.0
plot_range = [min(enc_speed) - data_range, max(enc_speed) + data_range]
s4 = figure(width=plot_w, height=plot_h, x_range=s1.x_range, y_range=plot_range, title='Average linear encoder speed over a Flexo wheel rotation',
@ -191,6 +191,17 @@ csv_file = "{0}.csv".format(data_set)
save_raw_data(pd_num, pd_time, pd_pos, csv_file)
plot_pd_dat(pd_num, pd_time, pd_pos, data_set)
'''
data_set = 'smb_log'
data_file = "{0}.txt".format(data_set)
csv_file = "{0}.csv".format(data_set)
[pd_num, pd_time, pd_pos] = get_pd_data(data_file)
save_raw_data(pd_num, pd_time, pd_pos, csv_file)
plot_pd_dat(pd_num, pd_time, pd_pos, data_set)
'''