CPM2A_PROGRAMMING MANUAL (W353-E1-2) (986750), страница 20
Текст из файла (страница 20)
When the execution condition (00005) turns OFF,the output is stopped. Switching between output 01000 (pulse output 0) and output 01001 (pulse output 1) is performed by means of the direction designator(00006).Frequency(direction)TimeExecution condition(00005)Direction designator(00006)WiringWire the CPM2A to the motor driver as shown in the following illustration.Motor Driver101SectionCPM2A/CPM2C Pulse Output Functions2-5Wire the CPM2C to the motor driver as shown in the following illustration. In thiscase, a CPU Unit with sinking transistor outputs is used.Output connectorMotorDriver24 VDCNote Refer to page operation manual for details on wiring outputs.PC Setup150DM 6629DM 66420000Sets the coordinate system for pulse outputs 0 and 1 as relative.Set for other than synchronized pulse control.(Set to 01 when using the high-speed counter.)Programming00005 (Execution condition)(13)Detects turning ON of execution condition.(14)Detects turning OFF of execution condition.(Direction designator)SPED(64)SPED(64)Output in CW directionPulse output 0Continuous modeOutput frequency: 100 HzOutput in CCW directionPulse output 1Continuous modeOutput frequency: 100 HzINI(61)Stops pulse outputs 0 and 1.INI(61)010102SectionCPM2A/CPM2C Pulse Output Functions2-52-5-2 Using Pulse Outputs With Variable Duty RatioSelect the pulse output number.Wire the outputs.Pulse output number 0 or 1Output numbers: 01000 and 01001PWM(––): For setting the frequency and duty ratio.Create a ladder diagram program.INI(61): For stopping pulse outputs.PRV(62): For reading the pulse output status.Pulse Outputs With Variable Duty RatioPWM(––)PULSE WITHVARIABLE DUTYRATIO instructionPulse output 0Pulse output 1(Either 01000 or 01001can be used.)Target frequency: 0.1 to 999.9 HzDuty ratio: 0 to 100%Start pulse outputsINI(61)(Note: The duty ratio is the ratioof ON time to pulse frequency.)Every scanMODE CONTROLinstructionStop pulse outputsSelecting the PulseOutput NumberWiring the OutputsEvery scanPulse output statusAR 11ImmediatelyHIGH-SPEEDCOUNTER PVPRV(62) READ instructionAR 12Read pulseoutput status.Select either pulse output 0 or 1.Output numberPulse output number010000010011Wire the CPM2A outputs as shown in the following illustration.
(Pulses can beoutput independently from pulse outputs 0 and 1.)Output 01000: Pulse output 0 (single-phase output)Output 01001: Pulse output 1 (single-phase output)103SectionCPM2A/CPM2C Pulse Output Functions2-5Wire the CPM2C outputs as shown in the following illustration. (Pulses can beoutput independently from pulse outputs 0 and 1.)Output connector01000: Pulse output 0 (single-phase output)01001: Pulse output 1 (single-phase output)Make the following settings in the PC Setup.PC SetupWordBitsDM 664208 to 15FunctionHigh-speedcountersettingSetting00: Do not use.01: Use as high-speed counterEither 00 or0102: Use as synchronized pulsecontrol (10 to 500 Hz).03: Use as synchronized pulsecontrol (20 Hz to 1 kHz).04: Use as synchronized pulsecontrol (300 Hz to 20 kHz).Synchronized pulse control cannot be used simultaneously.The settings will go into effect when the mode is changed (from PROGRAM toMONITOR/RUN) or when the power supply is turned ON to the PC.Ladder DiagramProgrammingThe following table shows the instruction operations related to pulse outputswith variable duty ratio.Instruction(@)PWM(––)ControlOperationPulse output withvariable duty ratioChange duty ratioSets the frequency and duty ratio andstarts the pulse outputs.Changes the duty ratio during pulsewhile pulse outputs with variable dutyratio are already in progress.(@)INI(61)Stop pulse outputsStops the pulse outputs.(@)PRV(62)Read pulse output status Reads the pulse output status (duringpulse outputs).The following table shows which instructions can be executed during pulse outputs without acceleration and deceleration.PULS(65) SPED(64)NoNote104NoINI(61)PRV(62) ACC(––)Yes (See note 1.) YesNoPWM(––)Yes (See note 2.)1.
This instruction can be used only for stopping pulse outputs.2. This instruction can be used only for changing the duty ratio. The frequencycannot be changed while pulses are being output. If the frequency needs tobe changed, be sure to stop the pulse output first.SectionCPM2A/CPM2C Pulse Output Functions2-5The following table shows the words and bits related to pulse outputs with variable duty ratio.WordBitNameContentsAR 1115Pulse output in progressfor pulse output 0ON: In progress (by SPED(64),ACC(––), or PWM(––))OFF: StoppedAR 1215Pulse output in progressfor pulse output 1ON: In progress (by SPED(64),ACC(––), or PWM(––))OFF: StoppedPulse Output With Variable Duty RatioChange Duty RatioThese functions set the position for outputting pulses (01000, 01001), the frequency, and the duty ratio, and start the pulse outputs.
By changing the duty ratiosetting and executing PWM(––) again, it is also possible to change the duty ratiowhile pulse outputs with variable duty ratio are already in progress.(@PWM(––)PFPort specifier (000: Pulse output 0; 010: Pulse output 1)Target frequency data wordDDuty ratio data wordFTarget frequencyRegister the target frequency to be set.#0001 to #9999 (4 digits BCD): 0.1 Hz to 999.9 HzDDuty ratioRegister the duty ratio to be set.#0000 to #0100 (4 digits BCD): 0% to 100%The pulse frequency cannot be changed while pulses are being output.Stop Pulse OutputsThis function stops pulse outputs.(@)INI(61)P003000Port specifier (000: Pulse output 0; 010: Pulse output 1)Control designation (003: Stop pulse outputs)Fixed: 000Note The pulse outputs can also be stopped by switching the PC to PROGRAMmode.Read Pulse Output StatusThis function reads the pulse output status.Using an Instruction(@)PRV(62)P001DPort specifier (000: Pulse output 0; 010: Pulse output 1)Control designation (001: Read pulse output status)Beginning word for storing pulse output statusPulse output in progress0: Stopped1: Output in progress105SectionCPM2A/CPM2C Pulse Output Functions2-5Using Data AreasAs shown in the following illustration, the pulse output status for pulse output 0 isstored in AR 1115, and the pulse output status for pulse output 1 is stored in AR1215.AR 11: Pulse output 0AR 12: Pulse output 1Pulse output in progress0: Stopped1: Output in progressNote AR 1115 and AR 1215 are refreshed once each cycle, so the values in thesewords may not reflect the actual status during each cycle, but AR 1115 andAR 1215 are refreshed when the status is read with PRV(62).Relationship Between Status and OperationContinuous Mode (Pulse Output With Variable Duty Ratio)FrequencyTimePWM(––) executionINI(61) executionOutput in progressOutput completionSet number of pulsesApplication ExampleExplanationIn this example, when the execution condition (00005) turns ON, variable dutypulses are output from output 01000 (pulse output 0) at a frequency of 100 Hz.The duty ratio at this time can be changed with the thumbwheel switch 0.WiringWire the CPM2A to the motor driver and thumbwheel switch as shown in the following illustration.Motor Driver106SectionCPM2A/CPM2C Pulse Output Functions2-5Wire the CPM2C to the motor driver and thumbwheel switch as shown in the following illustration.
In this case, a CPU Unit with sinking transistor outputs isused.Input connectorOutput connectorMotor DriverThumbwheel switch24 VDCNote Refer to the operation manual for details on wiring.PC Setup15DM 6642000High-speed counter not used.(Set for other than synchronized pulse control.)Programming (CPM2A Example)00005 (Execution condition)(14)Detects turning OFF of execution condition.DIV(33) Changes analog control 0 value to a value from 0 to 100.Value in SR 250 (Analog control 0 in CPM2A PCs) (see note)Divide value by 2.Duty ratio settingPWM(––) Pulse outputs with variable dutyPulse output 0Output frequency: 100 HzDuty ratio settingINI(61)Stops pulse output 0.Note The CPM2C is not provided withan analog control. For externalsettings, specify the input wordconnected to the thumbwheelswitch.107SectionCPM2A/CPM2C Pulse Output Functions2-52-5-3 Using Pulse Outputs With Trapezoidal Acceleration andDecelerationSelect the direction control method.Select the pulse output number.Wire the outputs.Pulse + direction output or up/down pulse outputPulse output number 0Output numbers: 01000 and 01001PC Setup (DM 6629)PV coordinate system for pulse output number 0PULS(65): For setting the number of output pulses.Create a ladder diagram program.ACC(––): For controlling pulse outputs with trapezoidal acceleration anddecelerationINI(61): For stopping pulse outputs and changing the pulse output PV.PRV(62): For reading the pulse output PV and status.Pulse Outputs With Trapezoidal Acceleration and DecelerationPULS(65)SETPULSESinstructionACC(––)Specify relative or absolute pulses.Number of output pulsesset value (8 digits BCD)ACCELERATIONCONTROLinstructionPulse, CWDirection, CCWMode designationStarting frequency: 0 Hz to 10 kHzTarget frequency: 10 Hz to 10 kHzINI(61) MODECONTROLinstructionAcceleration/deceleration rate:10 ms increase/decrease10 Hz to 10 kHzStart pulse outputs.Stop pulse outputs.Every scanEvery scanPulse output statusPulse output PVChange pulse output PV.PC SetupDM 6629, bits00 to 03108AR 11SR 228SR 229ImmediatelyHIGH-SPEEDPRV(62) COUNTER PVREAD instructionRead pulse output PV.Read pulse outputstatus.SectionCPM2A/CPM2C Pulse Output FunctionsSelecting the DirectionControl Method2-5Select the pulse output direction control method according to the type of signalused.Pulse + Direction OutputsUp/down Pulse OutputsSelect pulse output 0.Selecting the PulseOutput NumberOutput number0100001001Pulse output number0Wire the CPM2A outputs as shown in the following illustration.Wiring the OutputsPulse + Direction OutputsUp/down Pulse OutputsOutput 01000: Pulse outputOutput 01000: CW outputOutput 01001: Direction outputOutput 01001: CCW outputWire the CPM2C outputs as shown in the following illustration.Pulse + Direction OutputsOutput connector01000: Pulse output01001: Direction outputUp/down Pulse OutputsOutput connector01000: CW output01001: CCW output109SectionCPM2A/CPM2C Pulse Output Functions2-5Make the following settings in the PC Setup.PC SetupWordBitsDM 662900 to 03DM 664208 to 15FunctionSettingPulse 0 PVcoordinatesystem0: Relative coordinate systemHigh-speedcountersetting00: Do not use.Either 0 or 11: Absolute coordinate system01: Use as high-speed counterEither 00 or0102: Use as synchronized pulsecontrol (10 to 500 Hz).03: Use as synchronized pulsecontrol (20 Hz to 1 kHz).04: Use as synchronized pulsecontrol (300 Hz to 20 kHz).If absolute pulses are specified with PULS(65), be sure to set the absolute coordinate system (1).Synchronized pulse control cannot be used simultaneously.The settings will go into effect when the mode is changed (from PROGRAM toMONITOR/RUN) or when the power supply is turned ON to the PC.The following table shows the instruction operations related to pulse outputswith trapezoidal acceleration and deceleration (fixed duty ratio).Ladder DiagramProgrammingInstructionControlOperation(@)PULS(65)Set number of pulses(@)ACC(––)Set frequency and startpulse outputs(@)INI(61)(@)PRV(62)Sets the number of pulses to be outputin independent mode.Sets the target frequency, startingfrequency, and acceleration/decelerationrate for outputs in independent mode orcontinuous mode, and starts the pulseoutputs.Change frequencyChanges the frequency during pulseoutput in continuous mode byaccelerating or decelerating accordingto the specifiedacceleration/deceleration rate.Stop pulse outputsDecelerates pulse outputs to a stopaccording to the specifiedacceleration/deceleration rate.Stop (decelerate stop)pulse outputsChange pulse output PVRead pulse output PVRead pulse output statusStops the pulse outputs.Changes the pulse output PV.Reads the pulse output PV.Reads the pulse output status.The following table shows which instructions can be executed during pulse outputs with trapezoidal acceleration and deceleration.PULS(65)SPED(64)INI(61)PRV(62)ACC(––)PWM(––)Continuous modeNoNoYes (See note 1.)YesNoNoIndependent modeNoNoYes (See note 1.)YesYes (See note 2.)NoNote1.