WH-17 - Improved re-locking mechanism after skipping a correction

This commit is contained in:
gianmarcogirau 2019-09-06 10:05:33 +01:00
commit 4e7514529c
3 changed files with 14 additions and 9 deletions

View file

@ -22,7 +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 -radix decimal /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
@ -64,11 +64,12 @@ add wave -noupdate /ch_ctrl_cfg_tb/iUUT/wh_img_end
add wave -noupdate -radix unsigned /ch_ctrl_cfg_tb/iUUT/wh_img_pixel_cnt
add wave -noupdate -radix unsigned /ch_ctrl_cfg_tb/iUUT/wh_image_pixel_len
add wave -noupdate /ch_ctrl_cfg_tb/iUUT/first_img_started
add wave -noupdate /ch_ctrl_cfg_tb/iUUT/wh_error_meas_avail
add wave -noupdate /ch_ctrl_cfg_tb/iUUT/wh_corr_ready_v
add wave -noupdate -radix decimal /ch_ctrl_cfg_tb/iUUT/start_pos
add wave -noupdate /ch_ctrl_cfg_tb/iUUT/abs_pos_d
add wave -noupdate -radix decimal /ch_ctrl_cfg_tb/iUUT/basic_pos_error
add wave -noupdate /ch_ctrl_cfg_tb/iUUT/wh_pos_err_abs
add wave -noupdate -radix unsigned /ch_ctrl_cfg_tb/iUUT/wh_pos_err_abs
add wave -noupdate /ch_ctrl_cfg_tb/iUUT/wh_skip_corr_thres
add wave -noupdate -radix hexadecimal /ch_ctrl_cfg_tb/iUUT/wh_pos_err
add wave -noupdate /ch_ctrl_cfg_tb/iUUT/wh_pos_err_max
@ -245,7 +246,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} {14065649173 ps} 0}
WaveRestoreCursors {{Cursor 1} {2135755000 ps} 0} {{Cursor 2} {15451360286 ps} 0}
quietly wave cursor active 2
configure wave -namecolwidth 293
configure wave -valuecolwidth 216
@ -261,4 +262,4 @@ configure wave -griddelta 40
configure wave -timeline 0
configure wave -timelineunits ps
update
WaveRestoreZoom {10984211989 ps} {17147086357 ps}
WaveRestoreZoom {14834017562 ps} {16374736154 ps}

View file

@ -6,7 +6,7 @@
-- Author : Gianmarco Girau
-- Company : Global Inkjet Systems
-- Created : 2016-10-24
-- Last update: 2019-08-21
-- Last update: 2019-09-05
-- SVN ID : Git
-- Standard : VHDL'93
-------------------------------------------------------------------------------
@ -105,6 +105,7 @@ architecture rtl of pulse_generator_2 is
signal tof_lut_wr_en, tof_comp_enable : std_logic;
signal tof_saturation, tof_sat_flag : std_logic;
signal wh_apply_corr_en_d, wh_corr_start, wh_skip_corr : std_logic;
signal wh_img_2nd_half, wh_img_2nd_half_d : std_logic;
signal selected_pulse, selected_pulse_d, clr_pd_queue : std_logic;
--
signal abs_pos_msb_old : std_logic_vector( 1 downto 0);
@ -432,14 +433,15 @@ begin
div_ratio_corr <= std_logic_vector(signed(div_ratio_corr)+signed(div_ratio_corr_new));
end if;
div_ratio_i <= std_logic_vector(signed(div_ratio)+signed(div_ratio_corr));
wh_img_2nd_half_d <= wh_img_2nd_half;
if(init_wh = '1' or wh_skip_corr = '1') then
first_img_started <= '0';
elsif(fire_enable = '1' and div_pulse = '1') then
elsif(wh_img_2nd_half = '1' and wh_img_2nd_half_d = '0') then
first_img_started <= '1';
end if;
if(init_wh = '1' or wh_skip_corr = '1') then
wh_error_meas_started <= '0';
elsif(wh_meas_event = '1' and first_img_started = '1') then
elsif(wh_meas_event = '1' and first_img_started = '1') then
wh_error_meas_started <= not wh_error_meas_started;
end if;
if(wh_meas_event = '1' and wh_error_meas_started = '0') then
@ -484,7 +486,7 @@ begin
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 & X"00") and first_img_started = '1') then
if(wh_corr_ready_v(1) = '1' and unsigned(wh_pos_err_abs) > unsigned(wh_skip_corr_thres & X"00") and first_img_started = '1') then
wh_skip_corr <= '1';
elsif(loc_pd = '1') then
wh_skip_corr <= '0';
@ -509,6 +511,8 @@ begin
wh_img_end <= '1' when unsigned(wh_img_pixel_cnt) = unsigned(wh_image_pixel_len) else '0';
wh_img_2nd_half <= '1' when unsigned(wh_img_pixel_cnt) >= unsigned(wh_image_pixel_len(wh_image_pixel_len'left downto 1)) else '0';
wh_corr_start <= wh_apply_corr_en and not wh_apply_corr_en_d;
wh_meas_event <= loc_pd_d xor wh_img_end;

View file

@ -223,7 +223,7 @@ plot_pd_dat(pd_num, pd_time, pd_pos, data_set)
#'''
#data_set = 'data-set'
data_set = 'smb_log_dbpp'
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)