summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike <mjc@avtechpulse.com>2000-01-01 00:33:52 +0900
committerMike <mjc@avtechpulse.com>2000-01-01 00:33:52 +0900
commitc42275085f4256ff608421f098c7b806d1f8c55c (patch)
treeed75fd7a442ab1f5536f102ef4724738fad7bb65
parent264c6aa00dd50c83cb2f4be0849a0f7a4911b6a4 (diff)
Do not account for invertedness when calculating duty cycle. Units with invert functionINSTRUMENT_6_2_27b
are limited by time base circuit, not by average power.
-rw-r--r--error_utils.c56
1 files changed, 10 insertions, 46 deletions
diff --git a/error_utils.c b/error_utils.c
index c036556..4026b76 100644
--- a/error_utils.c
+++ b/error_utils.c
@@ -821,18 +821,6 @@ int Error_check(ChannelStruct ChannelStateToTest[max_channels])
if (ChannelStateToTest[i].frequency<(0.999*globals.Constraints.err_min_freq[i])) {
report_error=freq_lower_limit;
}
-
- if ((ChannelStateToTest[i].inverted==YES) && (globals.Flash.min_pw[i]>0.0)) {
- temp=(1/ChannelStateToTest[i].pw)*( 1.0- ampl_fixed_max_duty/duty_scale );
- if (temp>globals.Constraints.err_min_freq[i]) {
- globals.Constraints.err_min_freq[i]=temp;
- if (ChannelStateToTest[i].frequency<(0.999*globals.Constraints.err_min_freq[i])) {
- report_error=duty_cycle_upper_limit;
- }
- }
- }
-
-
/* ------------------------------- */
/* --- check maximum frequency --- */
@@ -886,13 +874,11 @@ int Error_check(ChannelStruct ChannelStateToTest[max_channels])
}
}
- if (ChannelStateToTest[i].inverted==NO) {
- temp=(1/ChannelStateToTest[i].pw)*(ampl_fixed_max_duty/duty_scale);
- if (temp<globals.Constraints.err_max_freq[i]) {
- globals.Constraints.err_max_freq[i]=temp;
- if (ChannelStateToTest[i].frequency>(1.001*globals.Constraints.err_max_freq[i])) {
- report_error=duty_cycle_upper_limit;
- }
+ temp=(1/ChannelStateToTest[i].pw)*(ampl_fixed_max_duty/duty_scale);
+ if (temp<globals.Constraints.err_max_freq[i]) {
+ globals.Constraints.err_max_freq[i]=temp;
+ if (ChannelStateToTest[i].frequency>(1.001*globals.Constraints.err_max_freq[i])) {
+ report_error=duty_cycle_upper_limit;
}
}
@@ -939,22 +925,6 @@ int Error_check(ChannelStruct ChannelStateToTest[max_channels])
|| (globals.Constraints.err_min_pw[i]<0.0 && ChannelStateToTest[i].pw<(1.001*globals.Constraints.err_min_pw[i])) ) {
report_error=pw_lower_limit;
}
-
- /* negative-pw units are special, ignore PRF / duty cycle / PW conflicts */
- if (globals.Constraints.err_min_pw[i]>=0.0) {
- if (ChannelStateToTest[i].trigger_source==source_internal) {
- if (ChannelStateToTest[i].inverted==YES) {
- temp=(1/ChannelStateToTest[i].frequency)*( 1.0 - ampl_fixed_max_duty/duty_scale );
- if (temp>globals.Constraints.err_min_pw[i]) {
- globals.Constraints.err_min_pw[i]=temp;
- if (ChannelStateToTest[i].pw<(0.999*globals.Constraints.err_min_pw[i])) {
- report_error=duty_cycle_upper_limit;
- }
- }
- }
- }
- }
-
/* ------------------------------- */
@@ -1012,13 +982,11 @@ int Error_check(ChannelStruct ChannelStateToTest[max_channels])
}
}
- if (ChannelStateToTest[i].inverted==NO) {
- temp=(1/ChannelStateToTest[i].frequency)*(ampl_fixed_max_duty/duty_scale);
- 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=duty_cycle_upper_limit;
- }
+ temp=(1/ChannelStateToTest[i].frequency)*(ampl_fixed_max_duty/duty_scale);
+ 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=duty_cycle_upper_limit;
}
}
@@ -1250,10 +1218,6 @@ int Error_check(ChannelStruct ChannelStateToTest[max_channels])
}
duty_cycle=ChannelStateToTest[i].pw*ChannelStateToTest[i].frequency*100; /* calculate duty cycle */
- if (ChannelStateToTest[i].inverted==YES) {
- duty_cycle=100-duty_cycle; /* account for inversion */
- }
-
if (duty_cycle>(100.0*ampl_fixed_max_duty/duty_scale))
/* set at crossover voltage */
{