summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--error_utils.c13
-rw-r--r--flash.c1
-rw-r--r--globals.h4
3 files changed, 17 insertions, 1 deletions
diff --git a/error_utils.c b/error_utils.c
index 713fe0a..9dd45b0 100644
--- a/error_utils.c
+++ b/error_utils.c
@@ -571,6 +571,10 @@ void get_error_text(gchar **response, int error_num)
format_error_text(response,-222,"Burst width can not exceed period.");
break;
+ case Dead_Time_Error:
+ format_error_text(response,-222,"Insufficient time between end of one pulse and start of next.");
+ break;
+
case password_change_error:
format_error_text(response,-222,"Incorrect old password, or new password is too long or short. ");
break;
@@ -979,6 +983,15 @@ int Error_check(ChannelStruct ChannelStateToTest[max_channels])
}
if (ChannelStateToTest[i].trigger_source==source_internal) {
+
+ temp=(1/ChannelStateToTest[i].frequency) - globals.Flash.dead_time[i];
+ if (temp<globals.Constraints.err_max_pw[i]) {
+ globals.Constraints.err_max_pw[i]=temp;
+ if (ChannelStateToTest[i].pw>(1.001*globals.Constraints.err_max_pw[i])) {
+ report_error=Dead_Time_Error;
+ }
+ }
+
temp=1/ChannelStateToTest[i].frequency;
if (temp<globals.Constraints.err_max_pw[i]) {
globals.Constraints.err_max_pw[i]=temp;
diff --git a/flash.c b/flash.c
index bbf1f63..4f16634 100644
--- a/flash.c
+++ b/flash.c
@@ -822,6 +822,7 @@ static void initFlashValues(FlashStruct *mem)
mem->load_type_dac[i]=3;
mem->output_timer[i]=0;
+ mem->dead_time[i]=100e-9;
mem->current_limit_pulse_mode[i]=220.0;
mem->current_limit_dc_mode[i]=120.0;
mem->current_limit_full_scale[i]=501.0;
diff --git a/globals.h b/globals.h
index e8f781b..7a71ee7 100644
--- a/globals.h
+++ b/globals.h
@@ -105,6 +105,7 @@
#define CalibrationMinMaxError_burst 91
#define CalibrationMinMaxError_rise 92
#define CalibrationMinMaxError_slew 93
+#define Dead_Time_Error 94
#define YES 1
#define NO 0
@@ -630,8 +631,9 @@ typedef struct {
float duty_ampl_mid2[max_channels]; /* addr 8102 */
float distort_fully_below_ampl[max_channels]; /* addr 8110 - used with pulse_width_pol_tweak, see S/N 13453 */
- char spare_char[280]; /* 8118 */
+ char spare_char[272]; /* 8118 */
+ float dead_time[max_channels]; /* 8390 */
float current_limit_pulse_mode[max_channels]; /* 8398 */
float current_limit_dc_mode[max_channels]; /* 8406 */
float current_limit_full_scale[max_channels]; /* 8414 */