Amps
[Top] [All Lists]

Re: [Amps] Input relay for QSK amp

To: "'Amps reflector'" <amps@contesting.com>
Subject: Re: [Amps] Input relay for QSK amp
From: "Paul Christensen" <w9ac@arrl.net>
Date: Tue, 18 Dec 2018 21:22:53 -0500
List-post: <mailto:amps@contesting.com>
>Just as important is a "lock-on" provision, which prevents closed relay
contacts from opening if RF is present." 

One of the neat things about microprocessor control is that many timing
fixes require only a few lines of code and no hardware changes.  The "Lock
On" sub-routine in my amp's control circuit is accomplished with the
following lines of code that immediately prevent switching from Tx to Rx,
kill bias and pulse QSK timing error LEDs.  The RF relays can never switch
in either direction if RF is present at the input when the switching routine
is called.  The comment field in C+ begins after //.   

while(digitalRead(rfSample) == LOW){    // sample RF input.  If RF remains
upon activating the T->R sequence, a fault has occurred; repeat do-while
loop
    digitalWrite(fullBias, LOW);                        // deactivate EBS
stage bias upon fault
    digitalWrite(bias, LOW);                            // deactivate normal
bias upon fault
    digitalWrite(postRFled, HIGH);                      // activate
post-switch fault LED
    postRFpreviousMillis = millis();                    // save the current
time to a register for post-switch LED pause duration
    delay(2);                                                   // delay
next event by 2 ms

Microprocessor control of timing requires the saving of time and timed
events into registers.  For example, when my LEDs pulse for 500 ms upon a
timing fault, the code should not stop, then resume processing while waiting
on the LED pulse to end.  The main loop and all sub-routines must
continuously run at the microcontroller's full speed while not ever pausing.


My code uses only structured logic:  structured logic is limited to
sequence, do-while, if-then-else, and in rare instances, "case" fan out.
That means no wild logic lines that jump around the flow-chart.  Otherwise,
debugging can quickly become impossible to sort out.  

Another good code writing practice is to save variable timing parameters
into dedicated registers.  That way, the register value (e.g., duration of
LED pulse) can change without altering the main code.  

The Alpha 77Dx/Sx series samples RF input with common analog circuitry.  It
also goes so far as to ensure that the output vacuum relay's contacts are
actually closed before switching can occur. 

Paul, W9AC

_______________________________________________
Amps mailing list
Amps@contesting.com
http://lists.contesting.com/mailman/listinfo/amps

<Prev in Thread] Current Thread [Next in Thread>