background image

PLCopen Motion Control Function Block Reference

-MR-JE-C

Summary of Contents for MELSEC-Q-MR-JE-C

Page 1: ...PLCopen Motion Control Function Block Reference MR JE C ...

Page 2: ......

Page 3: ...22 3 2 Details of the FB Library 23 MC_Power Operation Possible 23 MCv_Home Home Position Return 25 MC_Stop Forced Stop 27 MC_Halt Stop 29 MC_MoveAbsolute Absolute Value Positioning 32 MC_MoveRelative Relative Value Positioning 34 MC_MoveAdditive Commanded Position Change 36 MC_MoveVelocity Velocity Control 38 MC_TorqueControl Torque Control 41 MC_ReadActualPosition Current Position Read 44 MC_Rea...

Page 4: ...2 INSTRUCTION INDEX 63 REVISIONS 65 TRADEMARKS 66 ...

Page 5: ...PLIFIER INSTRUCTION MANUAL SH030257 MR JE _C SERVO AMPLIFIER INSTRUCTION MANUAL CC Link IE Field Network Basic SH030256 MR JE _C SERVO AMPLIFIER INSTRUCTION MANUAL PROFILE MODE SH030254 MELSERVO JE Servo amplifier INSTRUCTION MANUAL TROUBLE SHOOTING SH030166 QCPU User s Manual Hardware Design Maintenance and Inspection SH080483 QnUCPU User s Manual Function Explanation Program Fundamentals SH08080...

Page 6: ...oducts before using them Please note the followings and use the FBs described in this manual When using the FBs in an actual system confirm that the FBs do not cause system control problems Consider the points where interlock conditions are required in the system and insert interlock conditions Mitsubishi Electric Corporation will not compensate any damages caused by the FBs Contents may be delete...

Page 7: ...1 OVERVIEW 1 5 Notes 5 1 MEMO ...

Page 8: ...onControl_JEC_FBs_Q gxw FBD ST program QnUDVCPU MELSOFT GX Works2 Program name Description Execution type Description method Sample PrgAxis1 Each FB execution program axis 1 Scan FBD Sample PrgAxis2 Each FB execution program axis 2 Scan FBD FB name Description Execution type Description method CCIEFBasicStart Start of cyclic communication of the specified axis Scan FBD Program name Description stR...

Page 9: ...rmation Axis1 is set 2 Start the cyclic communication of the servo amplifier When the CPU module is switched from STOP to RUN the communication with the specified axis is started 3 Set the servo amplifier in the servo ON status When the PowerOn label is turned ON the specified axis is set in the servo ON status 4 Execute the home position return When the Homing label is turned ON the home position...

Page 10: ...rolled 6 Stop or forcibly stop the axis When the ExecHalt label is turned ON the specified axis is stopped When the ExecStop label is turned ON the specified axis is forcibly stopped 7 Read the axis error code and reset the error When the ReadError label is turned ON the alarm of the servo amplifiers is read When the ExecReset label is turned ON the error is reset Reset the error after the error c...

Page 11: ...solute value positioning is performed When the ExecInc label is turned ON the relative value positioning is performed When the ExecAdd label is turned ON the commanded position is changed 9 Monitor the current position velocity and torque When the Monitor label is turned ON monitoring the current position velocity and torque is started ...

Page 12: ...10 2 FUNCTION DESCRIPTION 2 2 Program Details Sample PrgAxis1 10 Monitor the axis information and status When the Monitor label is turned ON monitoring the axis information and status is started ...

Page 13: ... refresh setting Defining the contents that the customer sets in the link refresh setting to the global label enables the FBs to access the device specified in the link refresh setting The data is exchanged between the QCPU and the MR JE C in the fixed cycle by using the set device FB reads the data after the global labels related to RX and RWr are set Write area QCPU MR JE C Read area Write area ...

Page 14: ...f the system in which the CC Link IE Field Network Basic compatible CPU module QnUDVCPU and the MR JE C servo amplifier are connected 1 Set the IP address of the CPU module QnUDVCPU Navigation window Parameter PLC Parameter Select the Built in Ethernet Port Setting tab on the Q Parameter Setting window and set the IP address ...

Page 15: ... Ethernet Port Setting tab on the Q Parameter Setting window Select Use the CC Link IEF Basic on the CC Link IEF Basic Setting window Configure the network setting Select Network Configuration Setting on the CC Link IEF Basic Setting window Add the MR JE C Configure the refresh setting In the following example RX and RY are assigned to the device B and RWw and RWr are assigned to the device W ...

Page 16: ...ing the data refreshed in the global label G_stLinkBasic Correctly assign the device used for data refresh Otherwise the FBs do not properly operate 1 Select VAR_GLOBAL in Class 2 Set G_stLinkBasic in Label Name 3 Select the structure stRemoteRegBasic in Data Type 4 Assign the device according to the refresh setting Label name Data type Remark bnRX Bit 0 n n is Number of RX device points 1 In the ...

Page 17: ... project in other programs output the FB library and import it to other project The following shows the procedure Saving the user library 1 Open the project MotionControl_JEC_FBs_Q gxw Select User Library in Navigation 2 Select the library MotionControl_JEC_V100A Right click the library and select Open from the menu ...

Page 18: ...library became editable right click the library and select Save as from the menu 4 Enter the library file name and click the Save button In the following example the library is named MotionControl_JEC After the library has been saved the following dialog box appears ...

Page 19: ...y 1 Create a new project with the following setting Type the model when the library is saved Project Type Structured Project Language Structured Ladder FBD 2 Select User Library in Navigation and select Install from the library menu Select the saved library in the following dialog ...

Page 20: ... installed normally the following message appears and the library appears on the tree 3 Expand the FB FUN tree under User Library and add an FB to the program by dragging and dropping it Add the I O label definition If necessary add the conditions such as the interlock or others ...

Page 21: ...tect an alarm or a warning that has occurred in the servo amplifier Program the processing to monitor alarms and warnings in the servo amplifiers For the alarms and warnings that have occurred in the servo amplifiers refer to the instruction manual of the servo amplifiers in use The FB cannot be used in an interrupt program Please ensure that an execution command Execute or Enable can be turned OF...

Page 22: ...Description Disabled Indicates the initial status of an axis Enable of MC_Power is OFF and no error has occurred in the axis ErrorStop The status transits to this status when an error occurs This status remains while an error has occurred Stopping The status transits to this status when MC_Stop is executed This status remains while Execute of MC_Stop is ON Homing Indicates that the home position r...

Page 23: ...ds the number of significant digits is input in each unit the value is rounded off Example When an input value of an FB is 123 456789 the value after being rounded off is 123 45679 Item Description Control unit degree pulse Positioning range 360000 to 360000 10 3 degree 999999 to 999999 pulse Velocity command 0 00 to 167772 15 r min Set a value within the permissible speed of the servo motor Accel...

Page 24: ... Current position command unit RWwn04 Control input 3 RWrn04 RWwn05 Position command pp RWrn05 Current velocity RWwn06 RWrn06 RWwn07 Velocity command pv RWrn07 Droop pulse RWwn08 RWrn08 RWwn09 Velocity limit value tq RWrn09 Current torque RWwn0A RWrn0A Control output 1 RWwn0B Torque command tq RWrn0B Control output 2 RWwn0C Command velocity pp RWrn0C Control output 3 RWwn0D RWrn0D Alarm No RWwn0E ...

Page 25: ...ata type Setting range Description 1 Axis Axis information AXIS_REF_JEC Page 59 AXIS_REF_JEC Axis information No Variable name Name Data type Import Setting range Description 2 Enable Enable Bit ON OFF While Enable is ON the axis control is valid No Variable name Name Data type Default value Description 3 Status Operable Bit OFF It indicates that the servo amplifier is ready for operation 4 Error ...

Page 26: ...o d and Status turns ON The axis status transits from Disabled to Standstill When the power of the servo amplifier is shut off the axis status transits to ErrorStop For the axis status refer to Page 20 FB status diagram When an error has occurred in the FB this FB turns ON Error and stores an error code in ErrorID For details of error codes refer to Page 61 Troubleshooting Restrictions and precaut...

Page 27: ...EF_JEC Page 59 AXIS_REF_JEC Axis information No Variable name Name Data type Import Setting range Description 2 Execute Execution command Bit ON OFF ON The FB is executed No Variable name Name Data type Default value Description 3 Done Execution completion Bit OFF It indicates that the home position return is completed 4 Busy Executing Bit OFF It indicates that the home position return is in execu...

Page 28: ... the processing is normally completed Done turns ON and Busy turns OFF Axis status When the FB is started with the axis in the Standstill status the status changes to Standstill when the processing is completed When an error has occurred in the FB this FB turns ON Error and stores an error code in ErrorID For details of error codes refer to Page 61 Troubleshooting Restrictions and precautions Set ...

Page 29: ...Page 59 AXIS_REF_JEC Axis information No Variable name Name Data type Import Setting range Description 2 Execute Execution command Bit ON OFF ON The FB is executed No Variable name Name Data type Default value Description 3 Done Execution completion Bit OFF It indicates that the velocity has reached 0 4 Busy Executing Bit OFF It indicates that the velocity is decreasing to 0 5 Error Error Bit OFF ...

Page 30: ... Disable status In the torque control the status immediately changes to the Switch On Disable status and the servo amplifier stops by using a dynamic brake The axis status transits to Stopping While Execute is ON or the velocity has not reached 0 the Stopping status remains The axis status transits to Standstill when Done turns ON and Execute turns OFF When an error has occurred in the FB this FB ...

Page 31: ...s executed 3 Deceleration Deceleration time Double word signed Acceleration deceleration time on Page 21 Unit The time taken for the servo motor to stop from the rated speed is set No Variable name Name Data type Default value Description 4 Done Execution completion Bit OFF It indicates that the velocity has reached 0 5 Busy Executing Bit OFF It indicates that the velocity is decreasing to 0 6 Com...

Page 32: ...dAborted turns ON in this FB and the control is switched to the continuous control FB after a deceleration stop When Execute is turned OFF while this FB is in execution the stop operation continues Another MC_Halt cannot be executed When an error has occurred in the FB this FB turns ON Error and stores an error code in ErrorID For details of error codes refer to Page 61 Troubleshooting Restriction...

Page 33: ...B Library 31 3 Timing chart Normal completion Error completion Item Description Execute Busy Done AxisStatus CommandAborted Error ErrorID 0 DiscreteMotion Standstill Execute Busy Done AxisStatus Error CommandAborted ErrorID Error code ...

Page 34: ...number Velocity command on Page 21 Unit The velocity command value is set 5 Acceleration Acceleration time Double word signed 0 to 20000 ms The time taken for the servo motor to reach the rated speed is set 6 Deceleration Deceleration time Double word signed 0 to 20000 ms The time taken for the servo motor to stop from the rated speed is set 7 Direction Rotation direction Word signed 1 2 3 4 Page ...

Page 35: ...tiveTorqueLimit NegativeTorqueLimit of the AXIS_REF structure When executing this FB while the continuous control FB is in execution AxisStatus is ContinuousMotion execute this FB with the axis stopped When turning OFF an execution command Execute after turning it ON be sure to turn it OFF after Executing Busy is ON When the unit is degree and another MC_MoveAbsolute is executed while this FB is i...

Page 36: ...Velocity Double precision real number Velocity command on Page 21 Unit The velocity command value is set 5 Acceleration Acceleration time Double word signed 0 to 20000 ms The time taken for the servo motor to reach the rated speed is set 6 Deceleration Deceleration time Double word signed 0 to 20000 ms The time taken for the servo motor to stop from the rated speed is set No Variable name Name Dat...

Page 37: ...ructure When executing this FB while the continuous control FB is in execution AxisStatus is ContinuousMotion execute this FB with the axis stopped When turning OFF an execution command Execute after turning it ON be sure to turn it OFF after Executing Busy is ON This FB cannot be executed while a positioning warning alarm number F4 is occurring in the servo amplifier This FB cannot be used to con...

Page 38: ...tive position is set 4 Velocity Commanded velocity Double precision real number Velocity command on Page 21 Unit The velocity command value is set 5 Acceleration Acceleration time Double word signed 0 to 20000 ms The time taken for the servo motor to reach the rated speed is set 6 Deceleration Deceleration time Double word signed 0 to 20000 ms The time taken for the servo motor to stop from the ra...

Page 39: ...ting Restrictions and precautions Before executing this FB set the torque limit value PositiveTorqueLimit NegativeTorqueLimit of the AXIS_REF structure When executing this FB while the continuous control FB is in execution AxisStatus is ContinuousMotion execute this FB with the axis stopped When turning OFF an execution command Execute after turning it ON be sure to turn it OFF after Executing Bus...

Page 40: ...ch the rated speed is set 5 Deceleration Deceleration time Double word signed 0 to 50000 ms The time taken for the servo motor to stop from the rated speed is set 6 Direction Rotation direction Word signed 1 2 The rotation direction is specified MC_DIRECTION defined values can be used Select one of the following two values mcPositiveDirection positive direction 1 mcNegativeDirection negative direc...

Page 41: ...g of the rotation direction Direction The axis status transits to ContinuousMotion Abort the execution of the FB and switch the control by executing another MC_MoveVelocity or MC_TorqueControl To stop the operation use MC_Halt When the control is aborted CommandAborted turns ON When Execute turns OFF CommandAborted turns OFF When an error has occurred in the FB this FB turns ON Error and stores an...

Page 42: ...ls of the FB Library Timing chart Normal completion Error completion Item Description Execute Busy Active InVelocity CommandAborted Error ErrorID Velocity 0 Execute Busy Active InVelocity CommandAborted Error ErrorID Error code ...

Page 43: ...s set in percentage per second 5 Velocity Limit velocity Double precision real number Velocity command on Page 21 Unit The velocity limit value in the torque control mode is set 6 Direction Rotation direction Word signed 1 2 The rotation direction is specified MC_DIRECTION definition can be used Select one of the following two values mcPositiveDirection positive direction 1 mcNegativeDirection neg...

Page 44: ... torque InTorque remains ON until Execute turns OFF or the control is aborted The axis status transits to ContinuousMotion Abort the execution and switch the control by executing another MC_TorqueControl or MC_MoveVelocity To stop the operation use MC_Halt When the control is aborted CommandAborted turns ON When Execute turns OFF CommandAborted turns OFF When an error has occurred in the FB this F...

Page 45: ...s of the FB Library 43 3 Timing chart Normal completion Error completion Item Description Execute Busy Active InTorque CommandAborted Error ErrorID Torque 0 Execute Busy Active InTorque CommandAborted Error ErrorID Error code ...

Page 46: ...EF_JEC Page 59 AXIS_REF_JEC Axis information No Variable name Name Data type Import Setting range Description 2 Enable Enable Bit ON OFF ON The FB is executed No Variable name Name Data type Default value Description 3 Valid Output value valid Bit OFF During ON the output value is valid 4 Error Error Bit OFF When ON it indicates that an error has occurred in the FB 5 ErrorID Error code Word unsign...

Page 47: ... when Enable turns ON and the current position is read Read data is always updated while Valid is ON When an error has occurred in the FB this FB turns ON Error and stores an error code in ErrorID For details of error codes refer to Page 61 Troubleshooting Restrictions and precautions FB operation type Pulsed execution multiple scan execution type Timing chart Normal completion Error completion En...

Page 48: ...n AXIS_REF_JEC Page 59 AXIS_REF_JEC Axis information No Variable name Name Data type Import Setting range Description 2 Enable Enable Bit ON OFF ON The FB is executed No Variable name Name Data type Default value Description 3 Valid Output value valid Bit OFF During ON the output value is valid 4 Error Error Bit OFF When ON it indicates that an error has occurred in the FB 5 ErrorID Error code Wor...

Page 49: ... executed when Enable turns ON and the velocity of the specified axis is read Read data is always updated while Valid is ON When an error has occurred in the FB this FB turns ON Error and stores an error code in ErrorID For details of error codes refer to Page 61 Troubleshooting Restrictions and precautions FB operation type Pulsed execution multiple scan execution type Timing chart Normal complet...

Page 50: ...on AXIS_REF_JEC Page 59 AXIS_REF_JEC Axis information No Variable name Name Data type Import Setting range Description 2 Enable Enable Bit ON OFF ON The FB is executed No Variable name Name Data type Default value Description 3 Valid Output value valid Bit OFF During ON the output value is valid 4 Error Error Bit OFF When ON it indicates that an error has occurred in the FB 5 ErrorID Error code Wo...

Page 51: ... is executed when Enable turns ON and the torque of the specified axis is read Read data is always updated while Valid is ON When an error has occurred in the FB this FB turns ON Error and stores an error code in ErrorID For details of error codes refer to Page 61 Troubleshooting Restrictions and precautions FB operation type Pulsed execution multiple scan execution type Timing chart Normal comple...

Page 52: ... Symbol Structured Ladder Symbol Structured Text MC_ReadStatus_JEC Axis Enable Valid Error ErrorID ErrorStop Disabled Stopping Homing Standstill DiscreteMotion CoutinuousMotion SynchronizedMotion DUT Axis Axis DUT B Enable Valid B Error B ErrorID UW ErrorStop B Disabled B Stopping B Homing B StandStill B DiscreteMotion B ContinuousMotion B SynchronizedMotion B MC_ReadStatus_JEC 5 4 3 1 2 1 9 8 7 6...

Page 53: ... status Refer to Page 20 FB status diagram 7 Disabled Disabled status Bit OFF It indicates that the axis is in the Disabled status Refer to Page 20 FB status diagram 8 Stopping Stopping status Bit OFF It indicates that the axis is in the Stopping status Refer to Page 20 FB status diagram 9 Homing Homing status Bit OFF It indicates that the axis is in the Homing status Refer to Page 20 FB status di...

Page 54: ...normally read one of the output labels turns ON and indicates the status Read data is always updated while Valid is ON When an error has occurred in the FB this FB turns ON Error and stores an error code in ErrorID For details of error codes refer to Page 61 Troubleshooting Restrictions and precautions The output label SyncronizedMotion is always OFF FB operation type Pulsed execution multiple sca...

Page 55: ...or has occurred in the FB 5 ErrorID Error code Word unsigned 0 The error code generated in the FB is returned 6 HomeAbsSwitch Proximity dog signal Bit OFF It indicates the status of the proximity dog signal 7 LimitSwitchPos Positive limit signal Bit OFF It indicates the status of the hardware stroke limit signal in the positive direction 8 LimitSwitchNeg Negative limit signal Bit OFF It indicates ...

Page 56: ...ways updated while Valid is ON When an error has occurred in the FB this FB turns ON Error and stores an error code in ErrorID For details of error codes refer to Page 61 Troubleshooting Restrictions and precautions The status of Control input 5 Control DI5 bit 11 is output to Proximity dog signal HomeAbsSwitch FB operation type Pulsed execution multiple scan execution type Timing chart Normal com...

Page 57: ...formation AXIS_REF_JEC Page 59 AXIS_REF_JEC Axis information No Variable name Name Data type Import Setting range Description 2 Enable Enable Bit ON OFF ON The FB is executed No Variable name Name Data type Default value Description 3 Valid Output value valid Bit OFF During ON the output value is valid 4 Error Error Bit OFF When ON it indicates that an error has occurred in the FB 5 ErrorID Error ...

Page 58: ...umber of the specified axis is read Read data is always updated while Valid is ON When no error has occurred in the specified axis 0 is returned to AxisErrorID When an error has occurred in the FB this FB turns ON Error and stores an error code in ErrorID For details of error codes refer to Page 61 Troubleshooting Restrictions and precautions FB operation type Pulsed execution multiple scan execut...

Page 59: ...AXIS_REF_JEC Page 59 AXIS_REF_JEC Axis information No Variable name Name Data type Import Setting range Description 2 Execute Execution command Bit ON OFF ON The FB is executed No Variable name Name Data type Default value Description 3 Done Execution completion Bit OFF It indicates that the reset is completed 4 Busy Executing Bit OFF It indicates that the FB is in execution 5 Error Error Bit OFF ...

Page 60: ...ute is turned ON while the error cause of the axis still remains the error is not cleared In this case Busy remains ON Turn OFF Execute once and turn ON it after clearing the error cause When an error has occurred in the FB this FB turns ON Error and stores an error code in ErrorID For details of error codes refer to Page 61 Troubleshooting Restrictions and precautions For how to eliminate error c...

Page 61: ...rd signed Read Write The axis number of the control target is specified Setting range 1 to 16 PosTrqLimit Single precision real number Read Write Forward torque limit value is specified Setting range 0 to 1000 0 NegTrqLimit Single precision real number Read Write Reverse torque limit value is specified Setting range 0 to 1000 0 WaitTime Word unsigned Read Write The adjustment value of the transmis...

Page 62: ...veDirection Word signed Read only 2 The axis rotates and moves in the address decreasing direction regardless of the position data sign mcShortestWay Word signed Read only 3 The axis rotates and moves from the current position to the commanded position by taking a shortcut in a direction of shorter distance If the distance from the current position to the commanded position is the same in the CCW ...

Page 63: ...ed position or travel distance 1107 A value out of the range is set to a rotation direction Correct the rotation direction value to a value defined with MC_DIRECTION 110E A value out of the range is set as the forward torque limit value or the reverse torque limit value Review the torque limit value 1202 An error occurred Eliminate the error and execute the FB again 1203 The FB cannot be executed ...

Page 64: ...62 3 FB LIBRARY 3 5 Troubleshooting MEMO ...

Page 65: ... MC_MoveRelative_JEC 34 MC_MoveVelocity_JEC 38 MC_Power_JEC 23 MC_ReadActualPosition_JEC 44 MC_ReadActualTorque_JEC 48 MC_ReadActualVelocity_JEC 46 MC_ReadAxisError_JEC 55 MC_ReadAxisInfo_JEC 53 MC_ReadStatus_JEC 50 MC_Reset_JEC 57 MC_Stop_JEC 27 MC_TorqueControl_JEC 41 MCv_Home_JEC 25 ...

Page 66: ...64 MEMO ...

Page 67: ... May 2017 BCN B62005 824 A First edition June 2018 BCN B62005 824 B Added or modified parts Section 3 2 This manual confers no industrial property rights of any other kind nor does it confer any patent licenses Mitsubishi Electric Corporation cannot be held responsible for any problems involving industrial property rights which may occur as a result of using the contents noted in this manual ...

Page 68: ...Copen and related logos are registered trademarks of PLCopen The company names system names and product names mentioned in this manual are either registered trademarks or trademarks of their respective companies In some cases trademark symbols such as or are not specified in this manual ...

Page 69: ......

Page 70: ... exported from Japan this manual does not require application to the Ministry of Economy Trade and Industry for service transaction permission HEAD OFFICE TOKYO BUILDING 2 7 3 MARUNOUCHI CHIYODA KU TOKYO 100 8310 JAPAN NAGOYA WORKS 1 14 YADA MINAMI 5 CHOME HIGASHI KU NAGOYA JAPAN ...

Reviews: