• No results found

8:1 2–station Lamp Control

Task 8.2 Paging Systems

Task 8.2 Paging Systems

A: Create and simulate an [FBD] and [LAD] for Problem #3 B: Create and simulate an [FBD] and [LAD] for Problem #4 C: Create and simulate an [FBD] and [LAD] for Problem #5

Chapter 8: Digital Control Circuits 81

8.3 Linear motion

Many processes involve back and forth motion over a limited range; the opening and closing of an elevator door, the positioning of a drill bit over a printed circuit board, the windshield wiper on an automobile. The simplest case is linear motion at constant speed. For this two control outputs are needed, Move–Stop and Left-Right. And because the motion range is limited, two feedback inputs are needed, Right–limit and Left-limit. In addition there may be additional inputs for things like Process–start or Emergency–stop. Look back at Section 5.1 for a simpler version of linear motion. In studying such processes software simulation is not quite adequate; we need some physical device controlled by the PLC outputs, which in turn provides meaningful feedback. For this reason, with the packaged LOGO! unit described in this manual a simple hardware module is supplied, as shown in Fig. 8.8.

The linear motion module pictured in Fig. 8.8 contains its own power source, so the relay outputs of the LOGO! unit may be connected directly to RUN STOP or DIR.

The two limit switches are N.O. It is also possible to run the stepper motor in single step mode as will be explained later (connect to C in succession each of the numbered terminals 1, 2, 3, 4)

Problem #6 Create a program to move continuously the movable object (module block) back and forth between the two limit switches.

Our program should have three inputs, I1 to start the process, I2 and I3 connected respectively to the LEFT LIM and RIGHT LIM terminals on the linear motion module. Connect output Q1 to RUN STOP and Q2 to DIR. The linear motion module is designed so that if the DIR terminals are open the motion is toward the left. Each time the moving block briefly touches a limit switch, the block direction should change and continue in this

Fig. 8.8 Linear motion module

Fig 8.9 Circuit for Problem #6

Chapter 8: Digital Control Circuits 82

new direction until the opposite limit switch is touched. Since direction is to be remembered even after a limit switch goes low, this suggests an RS function. Of course the movable block could never touch both left and right limit switches at the same time.

However curious fingers can fool around with these switches, so it is a good idea to stop the motion at once if both limit switches are high at the same time. The circuit shown in Fig. 8.9 is one solution to Problem #6. The creation of an [LAD] solution is left to the reader as an exercise.

Problem #7 Modify Problem #6 to that after touching either limit switch, the module block pauses for five second flashing a warning light before continuing.

The inputs remain the same but now output Q3 is to control the flashing light. Since the new action is to take place when either limit switch goes high, connect an OR gate to these limit inputs. Since the flashing is to run for 5.0 sec, we use an Edge-triggered wiping relay to provide a 5.0 second interval. During this interval RUN STOP Q1 should be low and an Asynchronous pulse

To view the corresponding 9-rung [LAD] click the toolbar icon.

Problem #8 Create a program for the linear motion module that first moves the block to the left end, then flashes a light for 5.0 seconds, next moves the block back and forth twice, and ends with another 5.0 seconds of flashing

There are four basic operations involved: Start, Flash, Move Left and Move Right, but several of these are repeated more than once. Counting repetitions, there are eight steps following initialization. One approach is the use a Shift Register to move through the eight steps. As each step ends, it signals the Shift Register to call the following step.

Initialization begins when I1 goes high to start the process. This produces a brief pulse at both the In and Trig ports which sets S1 high .The Dir port of the Shift Register (not the Dir input on the linear motion module) is un-connected, so all shifting is toward the right or upwards

Fig. 8.10 Circuit for Problem #7

Chapter 8: Digital Control Circuits 83

The Move Left operation occurs in steps #1, #4 and #6. Therefore S1, S4 and S6 must feed an OR gate that starts the action. It must do four things; reset Q2 to low for motion toward the left, set Q1 high to Run the motion, stop the motion when I2, the Left limit, goes high, and finally send a pulse to the Trig port of the Shift Register to advance to the next step.

The Move Right operation occurs in steps #3 and #5, so either S3 or S5 can start the operation which sets the block Dir toward the right, starts the motion and continues it until the Right limit goes high and then sends a pulse to Trig to move to the next step.

The Flash operation occurs in steps #2 and #7. An Edge-triggered wiping relay gives a high output for 5.0 seconds, Enabling an Asynchronous pulse generator, which produce the flashing signal at Q3.

Notice that these three operations end with an output going low. It is therefore convenient to use a negative edge-triggered AND gate,

&

, discussed in Section 4.6, to produce the Trig signal for the Shift Register. The full circuit is shown in Fig. 8.11.

To view the corresponding 25-rung [LAD] click the toolbar icon.

Fig. 8.11 Circuit for Problem #8

Chapter 8: Digital Control Circuits 84

Recall that in a [FBD] two or more block outputs cannot be connected to a single input (if one went high and the other low, what would be the result?) This is the reason for the many OR gates in the circuit shown in Fig, 8.11. The M2 flag at the output of the Shift Register is not needed for simulation, but the LOGO! unit does not like to accept a downloaded program in which any function block is not connected to an output, flag or another function block input. The positive edge-triggered AND,

&

, is placed after I1, just in case the operator happens to hold this input high.

8.4 Stepper motors

Depending on their load conventional electric motors usually do not attain full speed until a short time after power is switched on, and do not stop turning the moment power is switched off. However stepper motors have a number of parallel inputs and the motor advances a fraction of a full turn each time power is briefly applied to one or other input. The motor on the Linear motion module pictured in Fig. 8.8 is actually a stepper motor, which can act as a conventional motor (a source on the module applies a rapid series of pulses whenever the Run Stop terminals are shorted). In Section 8.3 the module was connected as a conventional motor, but in this section we control it as a stepper motor, by briefly shorting to terminal C any of the four terminals.1, 2, 3, 4.