Minggu, 08 November 2009

SAMPLE PLC LADDER

Input comparison instruction

Input comparison instructions compare two values (constants and/or the contents of specified words) and create an ON execution condition when the comparison condition is true. Input comparison instructions are available to compare signed or unsigned data of one-word or double length data.

The input comparison instruction compares S1 and S2 as signed or unsigned values and creates an ON execution condition when the comparison condition is true. Unlike instructions such as CMP (Compare) and CMPL (Compare Long), the result of an input comparison instruction is reflected directly as an execution condition, so it is not necessary to access the result of the comparison through an Arithmetic Flag and the program is simpler and faster.

The input comparison instructions are treated just like the LD, AND, and OR instructions to control the execution of subsequent instructions.

 

long term timers

Example 1:
Long-term Timers
The following program examples show two ways to create long-term timers with standard TIM and CNT instructions.

Two TIM Instructions
In this example, two TIM instructions are combined to make a 30-minute timer.

 

TIM and CNT Instructions

In this example, a TIM instruction and a CNT instruction are combined to make a 500-second timer.TIM 0001 generates a pulse every 5 s and CNT 0002 counts these pulses. The set value for this combination is the timer interval × counter SV. In this case, the timer SV would be 5 s x 100 = 500 s. With this combination, thelong-term timer's PV is actually the PV of a counter, which is maintained through power interruptions.

                                                    long term timer        

 

PLC to servo driver

i have been asked about the connection from PLC to servo driver. <!--[if gte mso 9]> Normal 0 false false false MicrosoftInternetExplorer4 <![endif]--><!--[if gte mso 9]> <![endif]--> The connection is not as hard as you would have been imagined.
First thing that is important in doing the wiring is that we need to identify the power requirements of our PLC, our inputs and our outputs. Please take note that some PLCs are powered by AC power and transistor output PLCs are powered by DC power. As for the case of PLC that have pulse outputs, it is powered by DC power ( i dont know any of AC).

 

The basic wiring from PLC to servo driver is as the diagram below,

servo motor control

 

it is very easy to do a positioning control using a servo motor with the PLC. all you need to do is to configure the correct settings of the PLC, construct a correct wiring and write the program. if you buy a servo motor with the driver, make sure you hv the correct wiring. what im providing here is purely from the plc side.

i will sum it up into 3 steps,

1: configure the correct settings in your PLC.

make sure your plc has pulse outputs! you need two pulse outputs for a single axis. pulse can be output from the plc either by CW/CCW mode or pulse + direction mode. this mode must be of the same mode you setup in your servo motor amplifier. make sure also u set the built in inputs for encoder feedback. this is a must so that u know how many pulses has the motor moved.

2: correct wiring.

u also need to output the servo RUN signal to on the motor and Reset signal to reset any alarm. just for extra information, not all alarms can be reset from the reset signal, for some alarms, u need to reboot the servo driver.

for the input to the PLC from the servo driver, u need the feedback from the AC servo motor encoder. if you are using open collector, one feedback input is enough. it will count the Z phase from the encoder and pass it back to the plc to do the pulse count.

u also can tap into the PLC the 'pulse output complete' signal from the servo driver. this is important to make sure all pulse have been supplied and the motor is ready for next move.

3. write the program.

this is an example of how you can control a servo motor using ladder logic. this example shows how u can give a continuous supply of pulses in which the pulse will stop when the program instruct it to stop. as in the case of the example, the instruction SPED 0 will make the continuous pulse stop. in the example also it will touch on how u can supply independent pulse in which u instruct the PLC to supply a predetermine amount of pulse so that the motor make the linear system moves a certain distance. you can have a look at the sample program and better explanation HERE!!

Tidak ada komentar:

Posting Komentar