Home

User`s Manual - Automation Modules, Inc.

image

Contents

1. in this bit position indicates that the servo is currently operating in current torque mode E Limit Mode Abort Used by Limit Mode LM to determine what action to take upon the occurrence of a limit switch event Limit Mode Stop Used by Limit Mode LM to determine what action to take upon the occurrence of a limit switch event 4 Limit Tripped A 1 in this bit position indicates that a Limit input event has occurred and has been acted upon as set by the Limit Mode LM command BE Limit Enabled A 1 in this bit position indicates that the Limit input has been enabled for action via the Limit Mode LM command m Limit Active A 1 in this bit position indicates that the Limit input is currently active ul Limit Tripped A 1 in this bit position indicates that a Limit input event has occurred and has been acted upon as set by the Limit Mode LM command GNE Limit Enabled A 1 in this bit position indicates that the Limit input has been enabled for action via the Limit Mode LM command Limit Active A 1 in this bit position indicates that the Limit input is currently active Command TT Tell Target Position This command reports the current target position of the servo This is the absolute position to which the servo was last commanded to move It may have been specified directly with the Move to Position MP or Move Absolute MA commands or indirectly with the Move Relativ
2. Argument 0 gt n gt 63 This command will cause command execution to continue if I O channel n is On otherwise the rest of the command line or the macro will be skipped Related Commands CF CN DF Command EP End Program This command will cause program execution to cease and return the lt prompt Related Commands RC Command IBn If Accumulator is Below n Signed Argument 2 147 483 647 lt n lt 2 147 483 647 If the contents of the accumulator is less than signed comparison the value n command execution will continue otherwise the next two commands in the command line or the macro will be skipped 49 Automation Modules Incorporated 120 Technical Reference Manual Command ICn If Bit n of Accumulator is Clear 0 Argument 0 lt lt 31 If bit n of the accumulator is clear equals 0 command execution will continue otherwise the next two commands in the command line or the macro will be skipped Command lEn If Accumulator Equal to n Argument 2 147 483 647 lt n lt 2 147 483 647 If the accumulator is equal to the value n command execution will continue otherwise the next two commands in the command line or the macro will be skipped Related Commands IU Command IFn If I O Channel is Off Argument 0 gt n gt 63 If the I O channel specified by n is in the off state command execution will continue otherwise the next two
3. Related Commands JP Command LVn Load Interrupt Vector n Argument 0 gt n gt 31 This command loads interrupt vector table entry n with the contents of the low 8 bits of the accumulator The following program fragment will cause execution of macro 10 upon the activation of digital input 0 while a macro program is running MD1 AL10 Load accumulator with number for macro 10 MD2 LVO Load that number to interrupt vector 0 MD3 EVO Enable interrupt vector 0 MD10 MG Input 0 was just activated RC When input 0 is activated the line Input 0 was just activated will be displayed Related Commands DV EV 56 Automation Modules Incorporated 120 Technical Reference Manual Command MCn Macro Call Argument 0 lt lt 255 This command allows previously defined macro specified by n to be called like subroutine When this command is used the current macro being executed is pushed to the macro stack and execution of macro n begins If macro n has not been defined then an error will be reported After execution of the defined macro command execution will continue immediately after the Macro Call MC command The Macro Call MC command can be used any place in a macro Macro calls may be nested up to 25 times however it is NOT advisable for a macro to call itself Related Commands RC UM Command MDn Macro Definition Argument 0 lt lt 255 This command is u
4. 131 072 K 1 Rev Sec 2000 Counts Rev 1000 Hz 65536 9830 4 75 Rev Sec 6 Please note that if the Set Acceleration SA command is used with an argument of 0 then you have commanded the velocity to change in steps of zero which means if the servo is stopped it will not be able to move and if the servo is moving it will not be able to change velocity Related Commands SS SV Command SCn Set Current Mode Gain Argument 0 lt n lt 32 767 Default 0 This command sets the current mode gain used by Torque Mode QM1 only see QM command This allows the response of the current error integrator to be adjusted to suit a given application A low SC value will provide slow response to load changes while a high SC value will provide quick response to load changes If SC is set is too low then inadequate control may occur If the SC setting is too high then the system may be unstable A good general value for SC is about 8000 Related Commands QM SQ 24 Automation Modules Incorporated 120 Technical Reference Manual Command SDn SetDerivative Gain Argument 0 lt n lt 32 767 Default 0 This command sets the derivative gain term of the PID digital filter loop for the servo Related Commands SG SI IL Command SGn Set Proportional Gain Argument 0 lt n lt 32 767 Default 0 This command sets the proportional gain term of the PID digital filter loop for the servo Related Co
5. Axis Fault Reserved Reserved Reserved Reserved Reserved Reserved Reserved Axis Limit Digital Input 7 Reserved Digital Input 6 Reserved Digital Input 5 Reserved Digital Input 4 Axis IP IR Digital Input 3 Reserved Digital Input 2 Reserved Digital Input 1 Reserved Digital Input 0 N BR O1 O D Table 5 Macro Interrupt Sources The Axis Error interrupt indicates that the position following error for the axis has exceeded the limit set by the Set Error SE command Normally when this limit is exceeded the servo is disabled and the Error bit in the status word is set If the interrupt for this condition is enabled the Error bit will still be set but the servo will not be disabled The Axis Fault interrupt indicates that a fault condition usually an over temperature condition has arisen Normally when this condition is detected the servo is disabled and the Fault bit in the status word is set If the interrupt for this condition is enabled the Fault bit will still be set but the servo will not be disabled The Axis Limit interrupt indicates that either a Limit or Limit condition for the axis has been detected Whether or not a limit input will be recognized is determined by the Limit On LN and Limit Off LF commands The action taken is determined by the Limit Mode LM command Digital Inputs 00 07 provide 8 levels of undedicated user definable interrupts The interrupt for a given input will be acti
6. IR Command TCn Tell State of 1 0 Channel n Argument 0 lt lt 63 Default Off This command reports the current state of the I O channel specified by n and what type of logic the channel is either active on or active off The display is formatted as follows xx The presence of the character indicates that a channel is active in the state A lack of the character indicates that the channel is active in the on state The xx indicates the channel number and the aaa indicates the channel s current state either ON or OFF The following examples show all the possible combinations 01 Channel 1 is ON in the active ON state 01 Channel 1 is ON in the active OFF state 01 OFF Channel 1 is OFF in the active ON state 01 OFF Channel 1 is OFF in the active OFF state Related Commands CF CH CL CN 29 Automation Modules Incorporated 120 Technical Reference Manual Command TD Tell Derivative Gain This command reports the derivative gain value of the PID digital filter for the servo Related Commands TG TI TL Command TE Tell Error This command reports the last error code caused by any command or macro If no error has occurred then a O will be reported Once the TE command has been issued then the error code will be reset to zero The TE command is useful for determining what error occurred in the case
7. Return RO 0 MD59 S032767 RC Set output limit to maximum and return Subroutine to initialize position counter 1 Find Retract Switch 60 505000 Limit output to a safe value in case hard Stop is hit MD61 VM DI1 GO Switch to velocity mode and move negative MD62 RL448 1828 MJ65 NO Jump if Limit is active MD63 RL538 1G 100 MJ62 NO Loop is following error is 100 MD64 AB S032767 PM AL 3 RC else stop motion and return 3 MD65 ST WS AB SQ32767 Stop motion and allow for hard stop hit 2 Find encoder index pulse and set position counter to O0 MD66 DH DIO FI0 GO Reset position count and travel in dir MD67 RL448 1C10 MJ70 NO Jump if LFI bit clear MD68 RL494 1B2100 MJ67 NO If motor goes more then 1 rev with no MD69 ST WS PM AL 4 RC index then error and return RO 4 MD70 ST WS MAO GO WS50 Go back to position O0 MD71 AL0 RC Good home Return RO 0 Listing 1 Programming Example 72 Automation Modules Incorporated 7 Appendix C Summary of 5120 Commands Parameter Commands DB Set Dead Band FA Feed forward Acceleration FF Fail Input Off FN Fail Input On FR Derivative Sampling Frequency FV Feed forward Velocity IL Integration Limit LF Limit Off LM Limit Mode LN Limit On OO Output Offset PH Phase RI Sampling Rate of Integral SA Set Acceleration SC Set Current
8. is determined by the Set Acceleration SA command The acceleration can also be changed at any time Related Commands EG QM PM 40 Automation Modules Incorporated 120 Technical Reference Manual 4 4 Register Commands The 5120 uses part of its nonvolatile RAM NVRAM to create a 512 by 32 bit general purpose register space with Register 0 being referred to as the Accumulator The registers have many uses including storing data and parameters performing mathematical operations and controlling command execution The registers can be manipulated by several commands and can also be used to replace the argument in most commands For example if register 6 contains the value 12000 and the following command is used MAQ6 GO it would use the contents of register 6 as the argument thus giving the same result as if the following command was issued MA 12000 Note that the use of the character is what caused the command to assume a register argument or indirect argument instead of a direct argument If the value following the 69 is not in the range of the 512 registers 0 to 511 an error will be reported If the value contained by the register of the indirect argument is out of range an error will also be reported As stated earlier because the registers are within the NVRAM they are non volatile and can be used as such For example if a register is incremented once every user program cycle it can be used as an
9. it will wait for the Home input to go inactive If n is 1 it will wait for the Home input to go active Note Please note that this command works differently as compared to that of the IMCSA controller Related Commands FE Command WFn Waitfor I O Channel Off Argument 0 gt n gt 63 Default Off This command waits until I O channel n is in the state before continuing command execution Related Commands CF CN WN Command WI Wait for Index This command will wait for the occurrence of an Index input signal before continuing to the next command If a Find Index Fl command has not been issued prior to this command no waiting will occur Related Commands CI FI Command WNn Wait for I O Channel On Argument 0 gt n gt 63 Default Off This command waits until I O channel n is in the on state before continuing command execution Related Commands CF CN WF 52 Automation Modules Incorporated 120 Technical Reference Manual Command WPn Wait for Absolute Position n Argument 1 073 741 824 lt n lt 1 073 741 824 This command is used to determine when the servo has achieved the specified real position n referenced by the home position or zero Until that position has been reached command execution will be suspended This command can be issued before or after the servo has been commanded to move however if the servo is not moving then command
10. made det ee 14 2 5 INTERRUPT COMPLETION cate e eti Dvd rt dete 15 2 0 INTERR BAIEATENGY itd ad ende rade d 15 3 ENTERING COMMANDS 17 3 1 DOWNLOADING 18 4 INTRODUCTION TO COMMANDS 19 41 PARAMETER COMMANDS 19 4 2 REPORTING COMMANDS ape ala oie bein eet dust uicti hall loan hide 29 24 5 MOTION COMMANDS ERE 36 ATA REGISTER 41 4 4 T Internal Variables 41 4 5 SEQUENCE COMMANDS 49 4 6 LEARNED POSITION STORAGE LPS 5 54 4 7 55 4 8 INPUT OUTPUT IO COMMANDS he ine uM tres LER nada annia 59 4 9 EUT RE EXPANSION INTEBREAGE repite o ente gets udi eate ROSE 61 4 10 SERIAL COMMUNICATIONS AND MISCELLANEOUS COMMANDS eee 62 5 APPENDIX A S120 ERROR CODE DEFINITIONS ie 69 6 APPENDIX B PROGRAMMING 5 71 7 APPENDIX C SUMMARY OF 5120 COMMANDS suisses 73 8 APPENDIX D 8120 1 CONNECTOR PIN DEFINITIONS ie 74 BI Ic EU 75 Automati
11. 2 72 MD 57 WF 52 15720 38 WI 52 MG 66 WL 48 oies MJ 57 WN 52 pire MN 38 WP 53 54 WR 53 2725 MR 38 WS 3 MS 57 WW 48 NO 66 XF 67 00 22 68 d PH 23 ZF 68 38 77 68 CL 60 QM 9 Command summary 3 d RA 46 a 46 5 RC 58 D DF 49 B c Dedicated digital inputs 8 DH 36 Digital I O states 9 DI 37 58 Digital I O interface 8 DM 64 ES 2 Downloading commands 18 DN 49 RW 47 55 SA 24 E SC 24 EN 65 SD 25 Enable output 11 E 23 SE 39 eri and disabling interrupts 5 SG 25 FE 37 SI 25 Encoder interface 11 FF 20 SL 7 Entering commands 17 Fl 37 SQ 26 External fault input 8 FV 19 21 75 Automation Modules Incorporated F Fault condition 8 Firmware revision level 35 G General purpose digital inputs General purpose digital outputs 9 Commands 59 1 0 Expansion interface 61 1 0 technical specifications 10 Index 75 Indirect Argument 1 Internal variables 41 Interrupt completion 15 Interrupt latency 15 Interrupt priority 14 Interrupt sources 14 Interrupt Sources 13 Interrupt vector table 13 Introduction 7 Invalid Command 17 L Learned Position Storage Commands 54 Loading Vector Table 13 Macro 0 55 Macro commands 55 Macro interrupt system 13 Mathematical Oper
12. Gain SD Set Derivative Gain SG Set Proportional Gain SI Set Integral Gain SQ Set Torque SS Set Servo Speed SV Set Velocity Reporting Commands TA Tell A D Channel TB Tell Breakpoint TC Tell Channel TD Tell Derivative Gain TE Tell Last Command Error TF Tell Following Error TG Tell Position Gain Tell Integral Gain TK Tell K Constants TL Tell Integration Limit TM Tell Macros TO Tell Optimal Position TP Tell Real Position TQ Tell Torque TR Tell Register TS Tell Status TT Tell Target Position TV Tell Current Velocity VE Tell Version Motion Commands AB Abort Motion Capture Index DH Define Home DI Set Direction FE Find Edge Home FI Find Edge Index GH Go Home GO Go start motion MA Move Absolute MF Motor Off MN Motor On MR Move Relative PM Position Mode QM Torque Mode SE Set Maximum Following Error ST Stop Motion VM Velocity Mode Sequence Commands DF Do if Channel Off DN Do if Channel On EP End Program IB If Accumulator Below IC If Accumulator Bit is Clear IE If Accumulator Equal to n IF If Channel Off If Accumulator is gt n IN If Channel is On IP Interrupt on Absolute Position IR Interrupt on Relative Position 15 If Accumulator Bit is Set IU If Accumulator Unequal to RP Rep
13. Integral Sample Rat Derivative Sample Rate Phase and Sense Settings Maximum Velocity Acceleration Desired Direction Torque output Limit Axis Typ 6383 2007 3 0 0 U SIOH 3 gt 0 gt 0 Il 0 0 0 0 0 OUO Example display for the command TK1 gt TK1 System Parameter Settings group 1 Axis 1 Enabled EA Base 16 Input amp Output Character Echo Handshak Fail Servo Loop Rat SS Yes Off On Off Off ll Input Debounce Delay ID Phase and Sense Settings CV Intr Vector Enable HIGH EV DV Intr Vector Enable LOW EV DV Firmware Revision VE Il 0 0 31 Automation Modules Incorporated 120 Technical Reference Manual Command TL Tell Integration Limit This command reports the integration limit value of the PID digital filter for the servo Related Commands TG TI TD Command TMn Tell Macros Argument 2 lt lt 255 The Tell Macro TM command will display the commands which make up any macros that have been defined If n lt 0 and n gt 255 then the macro specified by n be displayed If n 1 then all the macros will be displayed preceded by the individual
14. MG or VI command no closing quote was encountered 14 MACRO STRING ERROR When using a MG or VI command in defining a macro no closing quote was encountered 15 SYNTAX ERROR Indicates the improper usage of the MG or VI commands 16 MACRO SYNTAX ERROR Indicates the improper usage of the MG or VI commands while defining a macro 17 AXIS RANGE ERROR The axis specified is out the possible numerical range 18 INTERRUPT MACRO NOT DEFINED During the course of interrupt processing at attempt was made to go to an undefined macro 19 INTERRUPT MACRO STACK ERROR Indicates that the macro stack has run out of space during interrupt processing 20 MACRO STACK OVERFLOW The macro stack has run out of space 21 MACRO STACK UNDERFLOW An attempt was made to pop a macro off of the macro stack when there was no macro to pop 70 Automation Modules Incorporated 120 Technical Reference Manual 6 Appendix B Programming Examples It should go without saying but the first thing to do when learning to program the S Series of servo controllers is to read the technical reference manual Even if a person just quickly reviews this manual it will at least give the user a basic understanding as to the scope of the command set thereby allowing him to be more creative and efficient when developing initial applications Figure 4 illustrates a rudimentary mechanical system which the S Series controller could operate and to which the programming exampl
15. Register to Accum RB Read Byte RL Read Long RW Read Word SL Accumulator Shift Left SR Accumulator Shift Right TR Tell Register WB Write Byte WL Write Long WW Write Word Input Output Commands Bulk I O Input BO Bulk I O Output CF Turn Channel Off Make Channel Active On CL Make Channel Active Off CN Turn Channel On ID Input Debounce Delay Automation Modules Incorporated 120 Technical Reference Manual 8 Appendix D 5120 1 Connector Pin Definitions USER 1 0 1 0 EXP POWER SERVO INTERFACE J1 Servo Interface 15 Pin Female D Sub Mating Connector NorComp ET15P Digi Key 215M ND Encoder A Encoder Index Encoder B 5 VDC 5 VDC Analog output Home Input Limit input Encoder A 10 Encoder Index 11 Encoder B 12 Common 13 Enable output 14 Fault input 15 Limit Input J2 User I O Interface 26 Pin H D Female D Sub Mating Connector NorComp HDT26P Digi Key T826M ND Input 6 Input 4 Input 2 Input 0 Common Output 6 Output 4 Output 2 Output 0 10 Input 7 11 Input 5 12 Input 3 13 Input 1 14 Common 15 Output 7 16 Output 5 O1 N 74 17 Output 3 18 Output 1 19 5 VDC 20 5 VDC 21 5 VDC 22 5 VDC 23 Common 24 Analog Input 7 25 Analog Input 8 26 Analog Input 9 J3 l O Expansion Interfa
16. allows for the display of an optional text string an optional carriage return linefeed CRLF and the entry of integer numeric operator input to a register variable The text string must be enclosed by quotes and may be up to 127 characters long Additional parameters must be separated by a colon Entered numbers will be interpreted as decimal or hexadecimal as determined by the current mode set by the DM or HM commands If the value entered by the operator is in error indeterminate then the Bad Input bit bit 15 of the variable SYSSTAT is set otherwise it is cleared If no operator input is entered only a carriage return is received then no register will be altered If no argument is given and operator input is received then register O will be the default recipient of the input value The following are all the valid examples Note that the N option causes a CRLF Parameters must be given in specific order gt VI Wait for operator input if any to register 0 gt VI ENTER NUMBER Display ENTER NUMBER and wait for Operator input if any to register 0 gt 5 Wait for operator input if any to register 5 gt VIN Display a CRLF and wait for operator input if any to register O0 2VI ENTER NUMBER 5 Display ENTER NUMBER and wait for Operator input if any to register 5 2VI ENTER NUMBER N Display ENTER NUMBER fo
17. commands in the command line or the macro will be skipped Related Commands CF CN IN Command IGn If Accumulator is gt n Signed Argument 2 147 483 647 gt n 2 147 483 647 If the contents of the accumulator is greater than signed comparison the value n command execution will continue otherwise the next two commands in the command line or the macro will be skipped Command INn If 1 0 Channel is On Argument 0 gt n gt 63 If the I O channel specified by n is in the on state command execution will continue otherwise the next two commands in the command line or the macro will be skipped Related Commands CF CN IF 50 Automation Modules Incorporated 120 Technical Reference Manual Command IPn Interrupt on Absolute Position n Argument 1 073 741 824 lt n lt 1 073 741 824 This command is used to determine when the servo has achieved the specified real position n referenced by the home position or zero When that position has been reached the breakpoint reached flag in the status register will be set This command can be issued before or after the servo has been commanded to move Related Commands IR TB Command IRn Interrupt on Relative Position n Argument 1 073 741 824 lt n lt 1 073 741 824 This command is used to determine when the servo has achieved the specified real position n referenced by the current position when this command is exec
18. execution may be suspended indefinitely Related Commands WR Command WRn Wait for Relative Position n Argument 1 073 741 824 lt n lt 1 073 741 824 This command is used to determine when the servo has achieved the specified real position n referenced by the current position when this command is executed Until that position has been reached command execution will be suspended This command can be issued before or after the servo has been commanded to move however if the servo is not moving then command execution might be suspended indefinitely Related Commands WP Command WSn Wait for Stop Argument 0 lt n lt 65535 This command will wait until the servo trajectory has stopped moving for n milliseconds before continuing to the next command Related Commands ST 53 Automation Modules Incorporated 120 Technical Reference Manual 4 6 Learned Position Storage LPS Commands The 5120 uses part of its nonvolatile RAM NVRAM to create a 256 item table for storing positions The LPS table is accessed by three commands Learn Position LP Learn Target LT and Move to Position MP The purpose for the LPS table is to allow the user to store pre determined positions for later use such as in contouring as the NVRAM will retain data even when powered down The LPS table overlaps registers 256 512 in the general purpose register space so that LPS entry O is the same as register 256 This allo
19. is equal to 1 then 8 bit data samples are recorded If bit 1 of RecSize is equal to 1 then 16 bit data samples are recorded If bits 0 and 1 of RecSize are both 0 then 32 data samples are recorded The last thing that needs to be specified is the sample rate at which the data is captured This is set by writing the appropriate value to the 16 bit variable RecRate The data sample frequency will be whatever the servo sample frequency is see SS command divided by RecRate After using the CD command the Dump Data DD command can be used to display the data that was captured Example To make 2000 records of the actual position you would issue the following commands CS1200 Reserve space for 2000 samples AL4 WW422 Servo rate 15 so Data rate 4mS AL494 WW424 Set address of Curp ALO WW426 Set for 32 bit variable size The CS command should be used only once After that the CD and DD commands can be used repeatedly Related Commands CS DD 63 Automation Modules Incorporated 120 Technical Reference Manual Command CSn Capture Storage Argument 0 lt n lt 16383 This command is used to allocate storage space for the data recorder commands The argument determines the maximum number of samples that can be recorded The number of samples that can be recorded depends on the amount of macro memory available at the time that the Capture Storage CS command is issued If an arg
20. loop stability and operation The Integral Limit IL and Set Integral Gain SI must both be set to a non zero value in order for the integral term to have any effect Related Commands SI Command LFn Limit Switch Input Off Argument 0 lt lt 3 Default 0 This command disables one or more of the limit switch inputs The valid arguments to this command determine which inputs will be disabled and are as follows Limit Switch Inputs Disabled 0 3 or no argument Limit and Limit 1 Limit 2 Limit Related Commands LM LN 21 Automation Modules Incorporated 120 Technical Reference Manual Command LMn Limit Switch Input Mode Argument 0 lt lt 3 Default 0 This command is used to select how the 5120 will react when a limit switch is activated The valid arguments for this command are as follows nf Action 10 1 Turn servo off continue commands Stop abruptly continue commands Decelerate smoothly continue commands Interrupt only In all cases the Error flag in the status word will be set This will prevent the S120 from moving the servo until the flag is cleared by issuing the Motor On MN command Before this command will have any effect the limit switch must be enabled with the Limit Switch On command LN Related Commands LF LN Command LNn Limit Switch Input On Argument 0 lt n lt 3 This command is used to enable one or both of the limit switch inpu
21. macro number If n 7 2 then all macros will be displayed and will be preceded by the letters MD and the individual macro number This is useful when downloading programs from the 5120 to a computer in that you need not re enter the Macro Define MD command and number at the beginning of each macro Related Commands MD RM Command TO Tell Optimal Position This command reports the desired position for the servo This value may be different from the position reported by the TP command if the servo is moving or the controller is unable to drive the servo Related Commands TT TP Command TP Tell Real Position This command reports the absolute position of the servo It may be used to monitor motion during both the Motor On MN and the Motor Off MF states Related Commands TT TO Command TQ Tell Torque This command reports the current output torque being commanded by the servo axis This value will be either that which is generated by the PID output or which is set by the user via the Torque Mode QM Command TRn Tell Contents of Register n Argument 0 lt lt 1 This command reports the value contained by Register n Related Commands Register Commands 32 Automation Modules Incorporated 120 Technical Reference Manual Command TS Tell Status Word This command reports the operating status word of the servo The response is coded into a single 32 bit value The meaning of ea
22. ongoing cycle counter for maintenance purposes production accounting and etc 4 4 1 Internal Variables In certain applications the user may find it necessary to use data pertinent to the internal operation of the 5120 This may be accomplished via the use of the Read Byte RB the Read Word RW and the Read Long RL commands which copy the S120 s internal RAM memory to the accumulator and the Write Byte WB the Write Word WW and the Write Long WL commands which the accumulator to the S120 s internal RAM memory The listings below tell the location of and describe the internal variables that may be of use to the user WARNING Randomly modifying these variables or other internal RAM not listed will most likely affect the operation of the S120 resulting in unpredictable behavior or possible damage 41 Automation Modules Incorporated 120 Technical Reference Manual Axis Variable Descriptions Status MPV V Carp Curp HREG IPPOS PGAIN IGAIN DGAIN IL CGAIN FVGAIN BIAS THRO QCMD TLMTPL FAGAIN PERR OERR MAXERR DERIV IMON INTRVL SMPCNT IINTRVL ISMPCNT TYPE PHASE DBAND FCMP TLMTMI Status gt Desp Cap Curp HREG LIPPOS PGAIN IGAN DGANN FN CGAN FVGAIN BIAS THRO QCMD TLMTPL PERR OERR MAXERR pcc 2 3 DERIV _IMON _INTRVL SMPCNT IINTRVL ISMPCNT PHASE
23. proportional gain Good starting value MD2 SD250 Set derivative gain 5 10 times SG as rule of thumb MD3 SV104857 Set max velocity to 1 inch sec MD4 SA209 Set accel for 500 servo cycles SV 500 MD5 MN Enable servo output The servo is now ready for motion MD6 MC50 IEO MJ10 Test encoder operation 7 2 9 Errors MD8 MG Encoder error JRO MD9 MG Friction error JRO MD10 MC50 1IE0 MJ14 Home position counter MD11 MF IE 4 MJ13 NO Errors MD12 MG Retract switch error JRO MD13 MG Encoder index error JRO 71 Automation Modules Incorporated 120 Technical Reference Manual Homed and ready for normal motion MD14 MA96000 GO WS100 Move 12 inches MD15 MA0 GO WS100 Return to 0 MD16 MJ14 Loop indefinitely Subroutine to test for proper encoder operation 50 505000 Limit output to a safe value in case a hard Stop is hit MD51 MR 100 GO WS50 Attempt to move backward 100 counts MD52 AB Set ideal position real position in case hard stop was hit MD53 DH Set position counter to 0 MD54 MR100 GO WS50 Move forward 100 counts MD55 RL494 Read position counter MD56 1B2 AL 1 MJ59 If position is 2 then encoder is probably not working Return RO 1 MD57 1B50 AL 2 MJ59 If position is 50 then system is frictionally challenged Return RO 2 MD58 AL0 Test passed
24. that an input must remain in a given state for n samples before it is considered valid If the argument n is 0 then no input debouncing in performed This debouncing applies to the following commands BI DF DN IF IN WF WN 60 Automation Modules Incorporated 120 Technical Reference Manual 4 9 Future Expansion Interface For future expansion the 5120 provides a proprietary high speed serial data bus Such uses might include various external devices such as thumb wheel switches LED or LCD displays switch panels and additional number or types of input and output This provides custom expansion flexibility in certain qualified OEM applications 61 Automation Modules Incorporated 120 Technical Reference Manual 4 10 Serial Communications and Miscellaneous Commands These commands control operation of the serial communication s interface and cover the balance of the 5120 functions not fitting in the other categories Command BK Break This command will cause the rest of the command line or macro to be skipped This command is used along with the Sequence Commands for conditional command execution Command BRn Set Baud Rate Argument 300 600 1200 2400 4800 9600 or 19 200 Default 9600 This command allows the user to change the baud rate at which the serial communication s interface operates Once this command has been issued with a valid argument the communication s interface will then immediatel
25. to determine whether a channel is ON in the HIGH state CH or ON in the LOW state CL This is analogous to a switch and to whether it is normally open or normally closed The Channel On CN and Channel Off CF commands do exactly as they imply in that they will turn a given output either ON or OFF which will make that output either HIGH or LOW depending on the CH and CL commands as stated previously Automation Modules Incorporated 120 Technical Reference Manual The CH command causes the following interpretation of the inputs and outputs A HIGH output is considered to be ON e g Channel On A LOW output is considered to be OFF e g Channel Off command A HIGH input is considered to be ON e g Do If On command A LOW input is considered to be OFF e g Do If Off DF command The CL command causes the following interpretation of the inputs and outputs A HIGH output is considered to be OFF e g Channel Off CF command A LOW output is considered to be ON e g Channel On CN command A HIGH input is considered to be OFF e g Do If Off DF command A LOW input is considered to be ON e g Do If On DN command Input Voltage Output Voltage Table 2 I O States Another feature of the digital input system is the ability for software input debouncing All of the general purpose digital inputs are automatically sampled once every millisecon
26. value n to the accumulator Command AC Accumulator Complement This command causes a bit wise 1 s complement of the accumulator Command ADn Accumulator Divide by n Signed Argument 2 147 483 647 gt n 2 147 483 647 This command performs a 64 bit by 32 bit signed division with a 64 bit quotient and a 32 bit remainder The low order 32 bits of the numerator must be in the accumulator and the high order 32 bits must be in Register 1 The divisor is specified by n The lower 32 bits of the quotient will be stored in the accumulator and the upper 32 bits will be stored in Register 1 The remainder will be in Register 2 Related Commands AM Command AEn Exclusive Or Accumulator with n Argument 2 147 483 647 lt n lt 2 147 483 647 This command causes the result of an exclusive OR of the accumulator with n to reside in the accumulator Command ALn Load Accumulator with n Signed Argument 2 147 483 647 lt n lt 2 147 483 647 This command causes the accumulator to be loaded with the value n Command AMn Multiply Accumulator by n Signed Argument 2 147 483 647 lt n lt 2 147 483 647 This command does a signed multiply of the 32 bit contents of the accumulator and n leaving the lower 32 bits of the 64 bit product in the accumulator and the upper 32 bits in Register 1 Related Commands AD 45 Automation Modules Incorporated 120 Technical Reference Manua
27. will begin station keeping in PM Command AB Abort Motion This command causes an emergency stop The servo stops abruptly but leaves the servo control loop enabled The target position is changed to be equal to the present position The command is used for stopping an undesired motion Related Commands ST Command CI Capture on Index This command causes the position counter for the servo to be stored in the internal variable HREG upon receipt of an index pulse For more information on HREG see the Register Commands and the listing of the internal variables Related Commands FI WI Command DHn Define Home Argument 1 073 741 824 lt n gt 1 073 741 824 This command causes the current position of the servo to be defined as n From then on all positions used and reported for the servo axis will be relative to that physical position Related Commands FE FI 36 Automation Modules Incorporated 120 Technical Reference Manual Command Din Set Direction Argument n 0 for positive n 1 for negative Default 0 This command sets the move direction for the servo when in velocity mode Issuing this command with an argument of O will cause the servo to move in a positive direction while an argument of 1 will cause it to move in a negative direction Related Commands SA SV VM Command FEn _ Find Edge of Coarse Home Input Argument 1 073 741 824 lt n lt 1 073 741 824 This c
28. AUTOMATION MODULES INC 5 20 TECHNICAL REFERENCE MANUAL Revision 1 0 November 1998 AUTOMATION MODULES INC FOX ISLAND WA 98333 PHONE 1 253 549 4868 FAX 1 253 549 4866 FOR TECHNICAL ASSISTANCE CALL COPYRIGHT 1993 1998 AUTOMATION MODULES INC Automation Modules Incorporated 120 Technical Reference Manual Table of Contents T INTRODUCTION teet ect ebd et eee e a uec nd pee ae par ae eee 7 T T29PECIFIGATIONS 0 7 1 2 DIGITAL INTEREAGE 8 1 2 1 Dedicated Digital MPU 8 1 2 2 General Purpose Digital 9 1 2 3 General Purpose Digital Outputs sise 9 12 4 Digital Oe States sr A se RS 9 1 2 5 Technical Specifications ses 10 T S ENCGOBER 00 11 1 4 OUTPUT INTERFACE scat 222 ir mt HERR TERRA ESTHER IARE TRANSIRE RODEO Me tane hee 11 1 5 ANALOG TO DIGITAL CONVERSION A D INTERFACE 11 1G SERIAL INTERFACES rin anse 12 2 MACROINTERRUPT SYSTEM 3s iit ue edere eden rte a HA o fen EAR 13 2 1 THE INTERRUPT VECTOR TABLE etu tun lem etis etn eue 13 2 2 ENABLING AND DISABLING INTERRUPTS 13 2 3 INTERRUPT SOURCES ai iore se ette ctetu tecti en e ie desde utu nn in tn 14 2 4 INTERRUPT PRIORITY
29. DBAND FCMP 42 Automation Modules Incorporated 120 Technical Reference Manual System Variable Descriptions Analog Input 3 After TA3 GA3 command Analog Input 4 After TA4 GA4 command Analog Input 5 After TA5 GA5 command Analog Input 6 After TA6 GA6 command Analog Input 7 After TA7 GA7 command SYSSTAT Variable Bit Definitions oO Axis 0 Enabled This bit is set to 1 when axis 0 is enabled 6 HexMod This bit is set to 1 by the HM command and set to 0 by the DM command Echo This bit is set to 1 by the EN command and set to 0 by the EF command 8 9 HandSh This bit is set to 1 by the HN command and set to 0 by the HF command Fail This bit is set to 1 by the FN command and set to 0 by the FF command Badlnp This bit is set to 1 by the VI command to indicate an error in user input 43 Automation Modules Incorporated 120 Technical Reference Manual Axis Variable Locations Variable Name Axis 1 Address Variable Name Axis 1 Address ISMPCNT AXIS ATYPE PHASE DBAND DERR FCNT FCMP TLMTMI RecRate RecAddr RecSize USRSEMA DELAY 44 Automation Modules Incorporated 120 Technical Reference Manual Command AAn Add n to Accumulator Signed Argument 2 147 483 647 gt n 2 147 483 647 This command adds the
30. L command to set the number of the macro for a vector The LV command is then used to transfer the low 8 bits of the accumulator to the vector table entry specified by the LV command If an interrupt is generated and that vector table entry has not been defined equal to 0 then the interrupt will not be executed Note that this implies that macro O cannot be used as an interrupt macro If an interrupt is generated and it s vector table entry has been defined but the macro it specifies has not then an error will be reported 2 2 Enabling and Disabling Interrupts Loading a vector table entry will not enable an interrupt for operation The Enable Vector EV command must be used for this purpose When the EV command is used it will enable the interrupt source specified with the command to function In the event that it is necessary to disable an interrupt source there is a Disable Vector DV command that functions in a similar manner as the EV command In order to prevent multiple or continuous interrupts as an interrupt is taken it is automatically disabled This means that the user must re enable that interrupt using the EV command before it will occur again Automation Modules Incorporated 120 Technical Reference Manual 2 3 Interrupt Sources The following table lists all the possible interrupt sources Interrupt Source Level vector Interrupt Source RCE Axis Error Reserved Reserved Reserved Reserved Reserved Reserved Reserved
31. VRAM and can be executed automatically Macros are created by stringing together one or more commands with arguments separated by commas and indicating where they are to be stored It should be noted that macros can use indirect as well as direct arguments The S120 allows for the creation of 256 macros consisting of a total of approximately 938 command instructions Macro calls via the Macro Call MC command or the interrupt system may be nested up to 25 calls deep An example of a macro might be gt 5 SV1000000 SA10000 MA25000 GO WS120 lt CR gt Once this command line is entered it will become the definition for macro 5 When macro 5 is used via the Macro Call MC Macro Sequence MS or Macro Jump MJ commands the commands contained within the macro will be executed automatically There are a few necessary restrictions when creating macros When using the Macro Define MD command it must be placed first in the command line and it may be used only once This also implies that it cannot be used as part of a macro The Reset Macro RM command is similar in that it too cannot be used as part of a macro Another feature of the S120 is the ability to automatically execute macro 0 on power up or after a Reset RT command If macro 0 is not defined the user will receive the gt prompt and the 5120 will wait for manual input If macro 0 is defined the S120 will automatically generate a MSO command thereby executing m
32. achieve output of 10000 due to previous command Note The command 1 is not valid for the 120 Related Commands PM QM SC VM 26 Automation Modules Incorporated 120 Technical Reference Manual Command SSn Set Servo Speed Argument 2 lt lt 255 Default 2 This command sets the servo loop interval The period of this interval can be calculated by the following T n 0 000100 where T is the period in seconds and n is the SS command argument For example if the value set by the SS command is 10 then the servo loop period will be 10 0 000100 001000 S or 1 mS Although this command will accept a parameter of O or 1 it will be clamped to a minimum servo loop rate of 200 uS Using the SS command affects the Set Velocity SV and Set Acceleration SA commands in that they both are specified in terms of servo loop intervals For example if the servo loop rate is doubled the velocity and acceleration would appear to have been halved It should also be noted that the SS command will most likely affect the required settings of the PID digital filter Related Commands SA SV 27 Automation Modules Incorporated 120 Technical Reference Manual Command SVn Set Maximum Velocity Argument 0 lt lt 1 073 741 823 Default 0 This command sets the desired velocity in quadrature counts per servo loop interval for the servo The 32 bit argument to this command c
33. acro 0 Command DVn Disable Interrupt Vector n Argument 0 gt n gt 1 This command disables interrupt vector n This prevents any possibility of an interrupt being caused by that source Related Commands EV LV Command EVn Enable Interrupt Vector n Argument 0 gt n gt 1 This command enables interrupt vector n This allows the possibility of an interrupt being caused by that source Related Commands DV LV 55 Automation Modules Incorporated 120 Technical Reference Manual Command JPn Jump to Command Absolute Argument 0 gt n gt 1 This command causes execution of a macro to jump to the absolute command specified by n Commands are numbered sequentially starting from If n is specified whereas the command would attempt to jump past the end of the macro command execution will resume as if the macro had ended Related Commands JR Command JRn Jump to Command Relative Argument 0 gt n gt 1 This command causes execution of a macro to jump to the command specified by n relative to the current command location If n is specified as zero then this command will jump to itself If n is specified such that the command would attempt to jump past the end of the macro command execution will resume as if the macro had ended If n is specified such that the command would attempt to jump to a point before the beginning of the macro an error will be reported
34. and is 10 and the value set by the FR command is 1 then the derivative sample period will be 1 1 10 0 0001 002 S or 2 mS This command is useful in tuning the PID servo loop to the inertial properties of the system Related Commands RI SS 20 Automation Modules Incorporated 120 Technical Reference Manual Command FVn Feed forward Velocity Argument 0 lt n lt 32767 Default 0 This command allows for the adjustment of the PID digital filter velocity feed forward term for the servo During the course of a Position Mode PM or Velocity Mode VM move at any point along the way with a consistent load the ideal required value of the servo output is fairly consistent and somewhat predictable During acceleration or deceleration OUTPUT VELOCITY FV CONSTANT ACCELERATION FA CONSTANT During constant velocity OUTPUT VELOCITY FV CONSTANT If this value can be dynamically predicted and summed with the output of the PID digital filter in effect it reduces the burden of the PID filter to make lead lag corrections based of the following error thereby enhancing performance Related Commands FA OO Command ILn Set Integration Limit Argument 0 lt lt 16 383 Default 0 This command clamps the level of influence that the PID digital filter integral term can use to reduce the static position error thereby reducing integral wind up When properly adjusted this can enhance
35. ations 41 Minimum commands for motion 71 Miscellaneous commands 62 Motion commands 36 P Parameter commands 19 Programming examples 71 R Register commands 41 Register Space 41 Reporting commands 29 S Sequence Commands 49 Serial communications commands 62 Serial interface 12 Specifications 7 Status Bits Accelerating 33 Bad Input 33 Breakpoint Reached 33 76 120 Technical Reference Manual Coarse Home Input Active 33 Current Direction 33 Current Mode 34 Desired Direction 33 Fail Input Flag 33 Limit Active 34 Limit Enabled 34 Limit Mode Abort 34 Limit Mode Stop 34 Limit Tripped 34 Limit Active 34 Limit Enabled 34 Limit Tripped 34 Looking for Edge 33 Looking for index 33 Over Temperature Fault 33 Position Mode 33 Servo Enabled 33 Servo Error 33 Servo Stopping 33 Torque Mode 3 Trajectory Complete 33 Velocity Mode 33 Status LED 17 System Variable Descriptions 43 System Variable Locations 4 n Table of Contents 5 Terminating command execution 17 Trapezoidal Velocity Profile 36
36. carriage return Linefeeds are not necessary since they are used for formatting and therefore they are ignored As characters are entered at the keyboard they should be echoed on your display If your display echoes its own transmitted characters you will want to issue the Echo Off EF command otherwise the Echo On EN command which is the default mode should be issued If you enter an invalid command the 5120 will respond with a question mark and space followed by a code indicating the type of error These codes are listed in Appendix A S120 Error Code Definitions Also the Status LED on the controller will begin to flash If you make a mistake when entering a command you can backspace to correct the error If you are entering commands and change your mind hitting the ESC key will cancel the line and give a new lt prompt Once a command line has been entered and has finished executing hitting the RETURN key will cause the same command line to be re executed While a set of commands are executing hitting the space bar will cause command execution to pause until the space bar is hit again Also if the ESC key is hit during execution or pause command execution will be terminated and you will receive a new gt prompt Command instructions are intended for use with the following syntax Command Argument lt CR gt Or Command Argument Command Argument etc The numerical range of an argument will va
37. ccumulator The value specified by n must be evenly divisible by 2 Related Commands RB RW WB WL WW Command RWn Read Word 16 bits at RAM location n Argument 0 gt n 2046 This command reads the 16 bit value at internal RAM location n and copies it to the low 16 bits of the accumulator while clearing the upper 16 bits The value specified by n must be evenly divisible by 2 Related Commands RB RL WB WL WW Command SLn Shift Accumulator Left n bits Argument 0 gt n gt 31 This command causes the accumulator to be shifted left n bits while filling the low order bits with zero Related Commands SR Command SRn Shift Accumulator Right n bits Argument 0 gt n gt 31 This command causes the accumulator to be shifted right n bits while filling the high order bits with zero Related Commands SL Command TRn Tell Contents of Register n Argument 0 gt n gt 1 This command reports the value contained by Register n 47 Automation Modules Incorporated 120 Technical Reference Manual Command WBn Write Byte 8 bits to RAM location n Argument 0 gt n 2047 This command copies the low 8 bits of the accumulator to the internal RAM location n Related Commands RB RL RW WL WW Command WLn Write Long 32 bits to RAM location n Argument 0 gt n 2046 This command copies all 32 bits of the accumulator to the internal RAM
38. ce 6 Pin Modular Jack Mating Connector 09 3 Digi Key A9093 ND 1 Receive Data input 2 Transmit Data output 3 Receive Data input 4 Transmit Data output 5 Clock output 6 Clock output Power Interface 4 5 08mm Centers Phoenix Mating Connector OnShore EDZ95002 Digi Key ED1717 ND 1 Main power return 2 Main V power input J5 RS 232 Comm Interface 6 Pin Modular Jack Mating Connector AMP 5 641337 3 Digi Key A9093 ND Handshake output Handshake input Receive data input Transmit data output Common 5 VDC Automation Modules Incorporated 120 Technical Reference Manual 9 Index GA 65 ST 39 A GH 37 SV 28 GO 37 TA 29 AID interface 11 HF 65 TB 29 Accumulator 41 HM 65 TC 29 Analog output interface 11 HN 65 TD 30 Appendix A IB e 50 iE n Error Code Definitions 69 Appendix B IE 50 TG 30 Summary of Commands 73 IF 50 TI 30 Appendix C Ton Be Connector Pin Definitions 74 Automatic Macro Execution 55 IN 50 TM 32 58 Axis Variable Descriptions 42 IP 51 32 Axis Variable Locations 44 IR 51 32 15 51 32 IU 51 TR 32 47 0 JP 56 TS 33 JR 56 34 LF 21 TV 35 LM 22 UM 58 LN 2 VE 35 LP 54 VI 67 DE 17 54 VM 40 ae LV 56 WA 52 AAS MA 38 WB 48 que MC 57 WE
39. ch bit is listed below Bit Servo Enabled This bit will be set to 1 when the servo is enabled via the Motor On MN command A 0 indicates that the servo has been disabled via one of the following reasons a Motor Off MF command a servo error due to excessive following error or over temperature condition a limit event an external fault 1 Servo Error A 1 in this bit position indicates that the maximum servo following error or over temperature condition has occurred or the external fault has been activated 2 Over Temperature Fault A 1 in this bit position indicates that the external fault input has been activated 3 Breakpoint Reached A 1 in this bit position indicates that a previously defined breakpoint has been reached This bit will be reset by any of the following commands Motor On MN Interrupt on Position IR Interrupt on Relative Position IR 4 Trajectory Complete A 1 in this bit position indicates that the servo has completed a commanded move A 0 indicates that the servo is busy executing a commanded move Servo Stopping A 1 in this bit position indicated that the servo has been commanded to stop Upon stopping this bit is then cleared Current Direction This bit indicated the current direction of travel for the servo 0 Positive 1 Negative Desired Direction This bit indicates the direction commanded by the Direction DI command 0 Positive 1 Ne
40. command before entering torque mode while in PM or VM it will remain limited while in QM and cannot be changed until the unit is in PM or VM For mode 1 or QM1 the 5120 will use one of its A D channels to monitor servo output current and attempt to maintain that output current at a steady level as commanded by the user program see the SQ and SC commands In that the A D converter has 10 bit resolution this will result in a value from 0 to 1023 which represents the instantaneous output current with O being approximately 0 Amps and 1023 being approximately 5 Amps with intermediate values being somewhat linear In the case of a motor for example when an output command of 512 is set or about 2 5 amps the PWM output begins to ramp up until the desired output current is reached If the motor is not loaded enough to require 2 5 amps then the PWM will ramp up to 10096 putting the maximum supply voltage to the motor If at this point the motor is suddenly loaded the PWM will ramp down to a level sufficient to supply 2 5 amps to the motor Note The command is not valid for the 5120 Related Commands EG PM VM Command SEn Set Maximum Following Error Argument 0 lt n gt 16 383 Default 16 383 This command is used to set the maximum allowable following error difference between the actual position and the optimal position for the servo If the following error exceeds the programmed value the servo will be turned off e
41. d Depending on the debounce delay set by the Input Debounce ID command a given input must remain in the same state during one or more samplings before it is considered valid If an input were to be found in a changed state during a sampling the input would become invalid and the debounce delay would be restarted If no or 0 debounce delay is used then no input debouncing is performed For example if a ID5 command has been issued then a given input must remain in the same state for 5 samplings or for 5 milliseconds before it is considered valid and the change is detectable 1 2 5 1 0 Technical Specifications 1 2 5 1 General Purpose I O Nominal Specifications Units Vin Minimum High Level 2 0 Rare Vit Maximum Low Level BR NE Output Voltage Output Voltage Current Table 3 General Purpose I O Specifications Automation Modules Incorporated 120 Technical Reference Manual 1 2 5 2 Dedicated I O Nominal Specifications Vin Minimum High Level V Input Voltage Le Input Voltage ee Current Table 4 Dedicated I O Specifications 1 3 Encoder Interface The S120 has one channel of quadrature type encoder interface with optional index signal input and the ability to supply 5 VDC at a minimum of 50 mA or greater depending on other demands put on the internal 5 VDC power supply The phase A and phase B inputs are pulled up to 5 VDC with 2 7K resistors and the phase A and phase B inputs are biased at 2 5 VDC
42. d by a colon and may be up to 127 characters long Additional The following are all the valid examples Note that the N option inhibits a CRLF Parameters must be given in specific order gt MG Display CRLF only gt MG THE BLACK BEAR IS Display THE BLACK BEAR IS followed by CRLF 2MGO Display contents of register 0 followed by CRLF gt MGN This command displays nothing followed by nothing 2MG THE BLACK BEAR IS 0 Display THE BLACK BEAR IS followed by the contents of register 0 followed by CRLF 2MG THE BLACK BEAR IS N Display THE BLACK BEAR IS followed by nothing gt MGO N Display the contents of register 0 followed by nothing 2MG THE BLACK BEAR IS 0 N Display THE BLACK BEAR IS followed the contents of register 0 followed by nothing Command NO No Operation This command does nothing It can be used to cause short delays in command line executions or to fill out commands see Sequence Commands Command RT Reset This command performs a complete restart of the 5120 including restoration of all default conditions such as acceleration and velocity and leaves the servo axis in the off state 66 Automation Modules Incorporated 120 Technical Reference Manual Command Variable Input Argument 0 gt n gt 5 This command
43. duce the possibility of accidental execution Command ZZ Dump Memory Argument 0 lt n lt 3FFFF This command does a display dump of the memory starting at address n This command is intended for use by the manufacturer for diagnosing purposes 68 Automation Modules Incorporated 120 Technical Reference Manual 5 Appendix A 5120 Error Code Definitions 1 ARGUMENT ERROR This error indicates that a command argument was not given or was specified out of the permissible numerical range 2 INVALID COMMAND This error indicates that an invalid or unrecognized command was specified in the command line 3 INVALID MACRO COMMAND This error indicates that an invalid or unrecognized command was used in defining a macro 4 MACRO ARGUMENT ERROR This error indicates that command argument was not given or was specified out of the permissible numerical range in defining a macro 5 MACRO NOT DEFINED This error indicates that execution of an undefined macro was attempted 6 MACRO OUT OF RANGE The 5120 allows for a maximum of 256 macros numbered 0 to 255 This error indicates that an attempt was made to access a macro out of this boundary 7 OUT OF MACRO SPACE The 120 allows for a maximum of 256 macros with up to 256 commands per macro and approximately 15800 bytes of macro storage space Each macro command requires 6 bytes of macro storage memory and each macro requires an overhead of 1 byte This err
44. e MR command If the servo axis is in Velocity Mode VM then the target position will track the current optimal position or that which is reported by the Tell Optimal TO command Related Commands TO TP 34 Automation Modules Incorporated 120 Technical Reference Manual Command TV Tell Current Velocity This command reports the trajectory generator current velocity for the servo The value reported has the same units as the Set Velocity SV command See the description of that command for further details Related Commands SV SS Command VE Tell Version This command reports the firmware revision level This revision level exists as a code in the internal RAM memory see Register Commands This code should be interpreted as the first byte being the major revision number and second byte being the minor revision number This allows user programs to determine the firmware revision for compatibility purposes Related Commands Register Commands 35 Automation Modules Incorporated 120 Technical Reference Manual 4 3 Motion Commands Motion Commands are those commands that involve or cause the actual movement of a servo Any position mode PM based motion will be carried out using a trapezoidal velocity profile with the maximum velocity determined by the Set Velocity SV command The acceleration and deceleration are the same and both are determined by the Set Acceleration SA command During the execution o
45. eat WA Wait WE Wait for Edge Home or Index WF Wait for Channel Off WI Wait for Index WN Wait for Channel On WP Wait for Absolute Position WR Wait for Relative Position WS Wait for Stop Learned Position Storage Commands LP Learn Current Position LT Learn Target Position MP Move to Position Macro Commands DV Disable Interrupt Vector EV Enable Interrupt Vector JP Jump Absolute JR Jump Relative LV Load Interrupt Vector MC Macro Call MD Macro Definition MJ Macro Jump MS Macro Sequence RC Return from Call RM Reset Macro s TM Tell Macro s UM Unpush Macro Serial Comm and Misc Commands BK Break BR Baud Rate CD Capture Data CS Capture Storage DD Dump Data DM Decimal Mode EF Echo Off EN Echo On GA Get A D Channel HF Hardware Handshaking Off HM Hexadecimal Mode 73 S120 Technical Reference Manual HN Hardware Handshaking On MG Display Message NO No Operation RT Reset VI Variable Input Set XOFF Code XN Set XON Code ZF Format ZZ Dump Memory Register Commands AA Accumulator Add AC Accumulator Complement AD Accumulator Divide AE Accumulator Exclusive Or AL Accumulator Load AM Accumulator Multiply AN Accumulator And AO Accumulator Or AR Copy Accumulator to Reg AS Accumulator Subtracted RA Copy
46. echnical Reference Manual 1 6 Serial Interface The 5120 communicates with a host computer or a dumb terminal via an RS 232 serial interface The baud rate is user selectable from 300 to 19 200 baud with 9600 baud being the default Characters are fixed at 8 bits in length with 1 stop bit and no parity Software XON XOFF handshaking is provided Hardware handshaking is not supported at this time 12 Automation Modules Incorporated 120 Technical Reference Manual 2 Macro Interrupt System The 5120 employs a Macro Interrupt System to provide additional versatility in programming the 5120 This system comprises 12 interrupt sources with corresponding vectors When an interrupt s source is enabled for operation and then becomes active the current macro being executed is saved to a so called macro stack and execution of the macro specified by that interrupt s vector table entry begins This happens to be similar procedure to that which the Macro Call MC command follows 2 1 The Interrupt Vector Table The Interrupt Vector Table consists of an entry for each interrupt source and each entry will correspond to that interrupt s level level 0 entry 0 level 1 entry 1 etc A particular table entry must be loaded with the number of a valid macro to be executed should that interrupt source become active The method for loading a vector table entry is provided by the Load Vector LV command The user must first use the Accumulator Load A
47. ervo During the course of a Position Mode PM or Velocity Mode VM move at any point during acceleration or deceleration with a consistent load the ideal required value of the servo output is fairly consistent and somewhat predictable During acceleration or deceleration OUTPUT VELOCITY FV CONSTANT ACCELERATION FA CONSTANT During constant velocity OUTPUT VELOCITY FV CONSTANT If this value can be dynamically predicted and summed with the output of the PID digital filter in effect it reduces the burden of the PID filter to make lead lag corrections based of the following error thereby enhancing performance Related Commands FV OO Automation Modules Incorporated 120 Technical Reference Manual Command FF Fail Input Off Default Off This command has no effect but is retained for backward compatibility purposes Command FN Fail Input On Default Off This command has no effect but is retained for backward compatibility purposes Command FRn Set Derivative Sampling Period Argument 0 lt n gt 127 Default 0 This command allows for the adjustment of the derivative sampling interval for the servo The period of this interval can be calculated by the following T n 1 S 1 where T is the period in seconds n is the FR command argument and S is the sample period count specified by the Servo Speed SS command For example if the value previously set by the SS comm
48. es that follow will refer It consists of a motor encoder combination driving a 4 pitch lead screw and nut with limit switches and hard stops at both ends The encoder provides 2000 quadrature counts per revolution giving 8000 counts per inch of linear travel at the nut It also gives an index pulse once per revolution There is 14 375 inches of travel from hard stop to hard stop A positive relative motion will cause the nut to extend away from the motor and a negative relative motion will cause the nut to retract toward the motor The normally open NO and common COM leads on the Retract Switch are connected to the Limit and Common pins of the controller The normally open NO and common COM leads on the Extend Switch are connected to Limitt and Common pins The NO lead on the Retract Switch is also connected to the Home input ENCODER 2000 QUADRATURE CDUNTS REV SCREW 4 TURNS INCH EXTEND ENCODER COUNT POSITIVE gt SWITCH 94 RETRACT SWITCH Figure 4 Referring to Listing 1 the minimum commands required for motion are shown macros 1 5 These commands could be entered directly with no macro definitions but are shown used as macros because that method tends to be the most commonly used in end applications Assumptions Default servo rate 552 Default position mode PM Encoder and motor wired to give desired operation 1 5650 Set
49. etermined by the Channel High CH and Channel Low CL commands Unused bits in the accumulator are ignored Related Commands BI Command CFn Turn I O Channel n Off Argument 0 lt lt 63 Default OFF This command will cause I O channel n to assume the OFF state The actual output state will depend on whether the channel is set active HIGH CH command or active LOW CL command Related Commands CH CL CN Command CHn Make I O Channel n Active High Argument 0 lt n lt 63 Default Active HIGH This command causes channel n to assume an active HIGH mode Related Commands CL 59 Automation Modules Incorporated 120 Technical Reference Manual Command CLn Make I O Channel n Active Low Argument 0 gt n gt 63 Default Active HIGH This command causes channel n to assume an active LOW mode Related Commands CH Command CNn Turn I O Channel n On Argument 0 gt n gt 63 Default OFF This command will cause I O channel n to assume the ON state The actual output state will depend on whether the channel is set active HIGH or active LOW Related Commands CF CH CL Command IDn Input Debounce n milliseconds Argument 0 lt n lt 7 Default 0 This command determines the length of debounce time if any that is applied to digital inputs O 7 These digital inputs are sampled once every millisecond What this means is
50. f a Position Mode based motion the target position MA or MR and the maximum velocity SV may be changed at any time however changes to the acceleration SA will be ignored If a velocity mode VM based motion is under way the maximum velocity SV and the acceleration SA may be changed at any time During this type of motion the target position will continuously be set equal to the current optimal position If a torque mode QM based motion is under way the torque setting SQ may be changed at any time During this type of motion the target and optimal positions will continuously be set equal to the current real position In either PM VM or QM a Stop ST or Abort AB command will cause motion for the servo axis to cease If the servo axis is in Position Mode PM and is commanded into Velocity Mode VM the motion will continue only with no target destination at the current maximum velocity set by the Set Velocity SV command If the servo axis is in PM or VM and commanded into Torque Mode QM the servo output will be reduced to zero and the unit will be placed in QM If the servo axis is in VM and commanded into PM the servo will be stopped at the current acceleration rate and placed into the PM mode If the servo axis is in QM and commanded into VM it will attempt to instantly assume the last known maximum velocity and remain in VM If the servo axis is in QM and commanded into PM the output will be reduced to zero and the servo
51. for Edge Looking for Index and Limit Tripped bits in the status word for the axis Related Commands LM LN MF Command MRn Move Target Relative Argument 1 073 741 824 lt n lt 1 073 741 824 This command generates a relative target position of n counts for the servo Since the Move Relative MR command will not initiate a motion a Go GO command must be used The servo s target position will be adjusted whether the servo is on or off Related Commands GO MA PM Command PM Enter Position Mode Default Position mode This command causes the servo to enter the position mode of operation In this mode the servo can be commanded to move to a specific target position The moves will be executed using a trapezoidal velocity profile based upon parameters set by the Set Velocity SV and the Set Acceleration SA commands Related Commands EG QM VM 38 Automation Modules Incorporated 120 Technical Reference Manual Command QMn Enter Torque Mode Argument 0 for voltage mode 1 for current mode Default Position mode This command places the servo axis in the Torque Mode of operation For mode 0 or QMO the output PWM duty cycle or analog output for appropriate models can be manually controlled by the user program Once has been entered the Set Torque SQ command can be used to set or change the servo output see the SQ command Bear in mind that if the output was being limited by an SQ
52. gative 8 Reserved 9 Reseved 10 Looking for Index A 1 in this bit position indicates that the IMCSA is currently watching for an index pulse to occur as commanded by the Find Index Fl command 11 Looking for Edge A 1 in this bit position indicates that the IMCSA is currently watching for the Coarse Home input to go active as commanded by the Find Edge FE command Coarse Home Input Active A 1 in this bit position indicates that the Coarse Home input is active 14 Capture Index Flag A 1 in this bit position indicates that the Find Index Fl command is trying to capture the position on occurrence of an index pulse as opposed to initializing the position 15 Bad Input A 1 in this bit position indicates that invalid input has been entered via the Variable Input command A 0 indicates that the last data obtained via the VI command was valid Accelerating A 1 in this bit position indicates that the servo is currently accelerating Position Mode A 1 in this bit position indicates that the servo is currently operating in position mode 18 Velocity Mode A 1 in this bit position indicates that the servo is currently operating in velocity mode Torque Mode A 1 in this bit position indicates that the servo is currently 33 Automation Modules Incorporated 120 Technical Reference Manual operating in voltage torque mode 0 Current Mode A 1
53. l Command ANn And Accumulator with n Argument 2 147 483 647 lt n lt 2 147 483 647 This command causes the result of the accumulator ANDed with n to reside in the accumulator Command AOn Or Accumulator with n Argument 2 147 483 647 lt n lt 2 147 483 647 This command causes the result of the accumulator ORed with n to reside in the accumulator Command ARn Copy Accumulator to Register n Argument 0 lt n lt 511 This command causes the value in the accumulator to be copied to Register n Related Commands RA Command ASn Subtract n from Accumulator Signed Argument 2 147 483 647 gt n 2 147 483 647 This command causes the value n to be subtracted from the accumulator Command RAn Copy Register n to Accumulator Argument 0 gt n gt 1 This command causes the value in Register n to be copied to the accumulator Related Commands AR Command RBn Read Byte 8 bits at RAM location n Argument 0 gt n 2047 This command reads the 8 bit value at internal RAM location n and copies it to the low 8 bits of the accumulator while clearing the upper 24 bits Related Commands RW RL WB WL WW 46 Automation Modules Incorporated 120 Technical Reference Manual Command RLn Read Long 32 bits at RAM location n Argument 0 gt n 2046 This command reads the 32 bit value at internal RAM location n and copies it to the a
54. l Reference Manual Command RC Return from Macro Call When executed this command will cause immediate return to the calling macro assuming there was one Related Commands MC interrupts Command RMn Reset Macro s Argument 0 lt gt 5 This command is used to delete one or more macros If an argument is used the macro specified by n will be deleted and the memory it used will be lost If no argument is used all macros will be deleted and all macro memory will be recovered A Reset Macro command RM should be used before entering or downloading a new set of macro commands Related Commands MD Command TMn Tell Macros Argument 2 lt lt 255 The Tell Macro TM command will display the commands which make any macros that have been defined If n lt 0 and n gt 255 then the macro specified by n be displayed If n 1 then all the macros will be displayed preceded by the individual macro number If n 7 2 then all macros will be displayed and will be preceded by the letters MD and the individual macro number This is useful when downloading programs from the 5120 to a computer in that you need not re enter the Macro Define MD command and number at the beginning of each macro Related Commands MD Command UMn Un push Macro s Argument 0 or 1 This command is used for controlling the macro subroutine call and return stack If this command is used with no argumen
55. llowed by a CRLF and wait for operator input if any to register 0 gt VI5 N Display a CRLF and wait for operator input if any to register 5 gt VI ENTER NUMBER 5 N Display ENTER NUMBER followed by a CRLF and wait for operator input if any to register 5 Command XFn Set XOFF Code Argument 0 lt lt 255 Default 19 This command does not function and is retained for backward compatibility purposes 67 Automation Modules Incorporated 120 Technical Reference Manual Command XNn Set XON Code Argument 0 lt lt 255 Default 17 This command does not function and is retained for backward compatibility purposes Command ZF Format NVRAM Argument 3 This command re formats and re initializes the S120 s non volatile static ram NVRAM This means that any macros will be deleted and their space recovered register contents will be set to 0 and the baud rate among other things will be set to their default values Evidence of the baud rate change will not be immediate but will occur when the unit is either power cycled or the Reset RT command is issued This command is intended for use by the manufacturer to place the unit in a known state after testing but is sometimes useful as a when all else fails means under certain circumstances This command must include an argument key code of 123 in order to function This is to re
56. location n The value of n must be evenly divisible by two Related Commands RB RL RW WB WW Command WWn Write Word 16 bits to RAM location n Argument 0 gt n 2046 This command copies the low 16 bits of the accumulator to the internal RAM location n The value of n must be evenly divisible by two Related Commands RB RL RW WB WL 48 Automation Modules Incorporated 120 Technical Reference Manual 4 5 Sequence Commands The 5120 includes commands that provide for conditional sequence command execution based on the register data I O state and etc These Sequence Commands are illustrated by the following general forms e f the condition is true command execution will continue normally If the condition is false the next two commands in the command line or the macro will be skipped e f the condition is true command execution will continue normally If the condition is false the rest of the command line or the macro will be skipped e f the condition is true command execution will continue normally If the condition is false command execution will be suspended until the condition becomes true Command DFn Doifl O Channel is Off Argument 0 lt lt 63 This command will cause command execution to continue if I O channel n is Off otherwise the rest of the command line or the macro will be skipped Related Commands CF CN DN Command DNn Doifl O Channel is On
57. mmands SI SD IL Command SIn Set Integral Gain Argument 0 lt n lt 32 767 Default 0 This command sets the integral gain term of the PID digital filter loop for the servo The Set Integral Gain SI and Integral Limit IL must both be set to a non zero value in order for the integral term to have any effect Related Commands SG SD IL 25 Automation Modules Incorporated 120 Technical Reference Manual Command SQn Set Maximum Torque Level Argument 32 767 lt n lt 32 767 in Torque Mode 0 1 023 gt n gt 1 023 in Torque Mode 1 QM1 0 lt n lt 32 767 in Position Mode PM 0 lt n lt 32 767 in Velocity Mode VM Default 32 767 This command sets the maximum output level when in Position Mode PM or Velocity Mode VM and sets the desired output level when in Torque Mode QM When this command is issued in Position Mode PM or Velocity Mode VM its limiting effect will remain in all modes of operation until again changed Note that an argument less than zero is allowed only in Torque Mode QM Examples gt PM SQ20000 lt CR gt Set maximum output to 20000 gt VM SQ10000 lt CR gt Set maximum output to 10000 gt QM SQ20000 lt CR gt Set output to forward 20000 gt QM SQ 10000 lt CR gt Set output reverse 10000 gt PM SQ10000 lt CR gt gt QM0 SQ15000 lt CR gt Set maximum output to 10000 Set output to forward 15000 but will only
58. nd is used to set the output polarity encoder phasing Index input sense Home input sense Limit and Limit input sense The polarity of the output will determine whether the servo is driven in a direction that reduces or increases position error The encoder phase will determine whether the position count will increase or decrease for a valid encoder input sequence The Index sense determines what logic edge will cause the Index input to be active The Limit Limit and Home sense determines whether these signals are active or active off To determine the argument to be used with the PH command use the follow table and add the required values together Output Phase Normal Output Phase Reversed Encoder Phase Normal Encoder Phase Reversed Index Active Level Low Index Active Level High Home Sense Active ON Home Sense Active OFF Limit Sense Active ON Limit Sense Active OFF Limit Sense Active ON Limit Sense Active OFF 0 1 0 2 0 4 0 8 0 MCN D oO For example if it were necessary to reverse the encoder phasing and to set the Limit and Limit inputs to active OFF then n would be 2 16 32 or 50 The default phasing and sense is equivalent to issuing this command with an argument of 0 Command Rin Sampling Rate of Integral Argument 0 lt n lt 127 Default 0 This command allows for the adjustment of the PID digital filter integral sampling interval for the servo The peri
59. ndshake Supply Voltage 11 To 50 VDC Approximately 5 0 Long by 3 3 Wide by 1 1 Thick Weight Approximately 1 Lb Dedicated Digital Inputs Limit Limit Home and Fault all TTL Table 1 Specifications Automation Modules Incorporated 120 Technical Reference Manual 1 2 Digital I O Interface The 5120 includes 8 channels of HCT TTL general purpose digital input and 8 channels of HCT TTL general purpose digital output Additionally there are four channels of TTL dedicated digital input and TTL Enable output The general purpose I O are buffered with 74HCT541 An expansion interface allows for optional expansion of I O to a total of 64 channels each of inputs and outputs 1 2 1 Dedicated Digital Inputs The 5120 5 dedicated digital inputs are Limite Limit Home and Fault Figure 1 illustrates one of these inputs All of these inputs are active low and have 2 7K ohm pull up resistors To activate one of these inputs the user need only connect that input to the controller s ground The Limit inputs are intended for signaling the 5120 that the axis has reached it s end of travel When such an event occurs the S120 can ignore the event or stop the servo in some controlled fashion The Home input is for detecting some sort of home position sensor This can be used with the encoder Index input to implement a very accurate homing method A typical use for the Fault input is for allowing the external driver amplifier to signal a faul
60. od of this interval can be calculated by the following T n 1 S 0 0001 where T is the period in seconds n is the RI command argument and S is the sample period count specified by the Servo Speed SS command For example if the value previously set by the SS command is 10 and the value set by the RI command is 1 then the integral sample period will be 1 1 10 0 0001 002 S or 2 mS This command is useful in tuning the PID servo loop to the inertial properties of the system Related Commands FR 23 Automation Modules Incorporated 120 Technical Reference Manual Command SAn Set Acceleration Argument 0 lt n lt 1 073 741 823 Default 0 This command sets the acceleration rate for the servo The 32 bit argument to this command is scaled by 65536 This number determines how much the servo s velocity will be altered by each servo loop interval determined by the Servo Speed SS command while it is accelerating or decelerating If this command is executed during a Position Mode move it will be ignored Example Encoder 500 lines or 2000 Counts Rev Desired Acceleration 75 Rev Sec Servo Loop Interval 1 000 Hz 9830 4 75 Rev Sec 2000 Counts Rev 1000 Hz 65536 To achieve an acceleration of 75 Rev Sec the command 549830 would be issued A simpler way to calculate the acceleration argument would be to determine a constant for your application by which to calculate desired acceleration
61. ommand is used to initialize the servo at a given position It will remain in effect until the Home input goes active At that time the current position of the servo will be defined as n This command will neither start nor stop any servo motion It is up to the user to initiate servo motion before issuing the command and to stop any motion after the command is completed Related Commands WE Command Fin Find Edge of Index Argument 1 073 741 824 lt n lt 1 073 741 824 This command is used to initialize the servo at a given position It will remain in effect until the Index input goes active At that time the current position of the servo will be defined as n Like the Find Edge FE command this command will not start or stop any servo motions that is up to the user Since an index pulse may occur at numerous points of the servo s travel once per revolution in rotary encoders a typical application will require a home signal to establish a coarse position reference before the index pulse can be used to fine tune that reference Related Commands Cl WI Command GH Go Home This command causes the servo move to absolute position 0 This is equivalent to a Move Absolute MA command when the destination is 0 This command will initiate motion therefore a Go GO command is not required Related Commands MA GO Command GO Go start motion This command causes the servo to begin motion When in the Velocit
62. on Modules Incorporated 120 Technical Reference Manual Automation Modules Incorporated 120 Technical Reference Manual 1 Introduction The 5120 is a single axis stand alone servo controller with input output I O capabilities designed for use with off the shelf power amplifiers for a variety of motor or actuator types and sizes The 5120 implements a mnemonic type command instruction set via a standard RS 232 serial communications interface These commands can be executed directly or used to create command macros which are stored in the onboard nonvolatile RAM The 5120 can interface to the real world via a 12 bit 10 VDC analog output a quadrature type encoder interface 8 channels of HCT TTL digital input and 8 channels of HCT TTL type digital output with additional TTL inputs serving for limit home and fault functions and a TTL enable output 3 channels of 10 bit analog to digital A D conversion and an RS 232 serial communications link A proprietary RS 422 interface is provided for I O expansion modules 1 1 Specifications FFerAgohm PID 7 Velocity Range 30 Bits Acceleration Range 30 Bits General Purpose Digital 8 HCT TTL Inputs 8 TTL Outputs Dedicated Digital Outputs Enable TTL Analog Inputs 3 Channels With 10 Bit Resolution Expansion Optional Expansion to 64 Communication Interface RS 232 Serial Interface Adjustable Baud Rate 8 Bits 1 Stop Bit No Parity XON XOFF Ha
63. onsists of a 16 bit integer part and a 16 bit fractional part Example Encoder 500 lines 2000 Counts Rev Desired Velocity 40 Rev Sec Servo Loop Interval 1 000 Hz 5242880 40 Rev Sec 2000 Counts Rev 1000 Hz 65536 To achieve a velocity of 40 Rev Sec the command SV5242880 would be issued A simpler way to calculate the velocity would be to determine a constant for your application by which to calculate desired velocity 131072 K 1 Rev Sec 2000 Counts Rev 1000 Hz 65536 5242880 40 Rev Sec K Related Commands SA SS 28 Automation Modules Incorporated 120 Technical Reference Manual 4 2 Reporting Commands The reporting commands output data relevant to the operating status of the 5120 Numerical output will be in the mathematical base determined by the Decimal Mode DM Hexadecimal Mode HM commands and output will be followed by a carriage return and linefeed Command TAn Tell Analog to Digital Channel n Argument 0 lt n lt 9 This command will cause a conversion on A D channel n and will display the result Note Only inputs 0 7 8 and 9 are used Related Commands GA Command TB Tell Breakpoint Default None This command reports the last programmed breakpoint value specified by the Interrupt on Position Absolute IP or the Interrupt on Position Relative IR commands If no breakpoint value has yet been specified then the word NONE is returned Related Commands IP
64. or indicates that so many macros macro commands have been defined that there is no remaining memory to define more 8 CAN T DEFINE MACRO IN A MACRO This error indicates that an attempt was made to define a macro from another macro that is currently being executed This is not allowed on the 5120 as to prevent loss of program control due to possible nesting 9 CAN T DEFINE MACRO WHILE SERVO ENABLED This error indicates that attempt was made to define a macro while the servo axis was enabled i e MN This is not allowed on the 5120 as to prevent loss of program and or servo control due to macro memory space definition contention 10 MACRO JUMP ERROR This command indicates that an attempt was made to jump MJ command to a command within a macro that does not exist 69 Automation Modules Incorporated 120 Technical Reference Manual 11 OUT OF MACRO STACK SPACE When a macro is called by another macro via the MC command or a macro interrupt the return macro and macro command number must be saved along with other internal variables This error indicates that the memory space set aside for this purpose has been exhausted and no more calls may be attempted The 5120 is capable of macro calls nested 25 deep 12 MACRO MUST BE FIRST COMMAND When defining a macro the MD command must be the first command in the command line This error indicates that this requirement was not met 13 STRING ERROR When using a
65. ry depending on the command with which it is used The mathematical interpretation of the argument will depend on whether the Decimal Mode DM or Hexadecimal Mode HM was the last issued DM is the power on default Both decimal and hexadecimal numbers less than zero should be entered with a preceding minus sign If no argument is given then it will be assumed as 0 The exceptions to this are the Macro Define MD Macro Jump MJ Macro Call MC Macro Sequence MS Reset Macro RM and Tell Macro TM commands It should be noted that commands can be strung together by using commas up to a maximum line length of 127 characters If a command line is ended by a and a comment i e gt SG1000 SD5000 Set filter gains lt CR gt then the and anything following it to the end of the line will be ignored This feature is not particularly useful if you are entering commands manually as comments are not retained by the S120 However if commands are downloaded to the S120 from a host computer the ability for line comments can make program documentation possible and desirable Automation Modules Incorporated 120 Technical Reference Manual 3 1 Downloading Commands In many cases it is more convenient to enter commands using a text editor on a host computer and then download that text file to the 5120 using a communications program such as ProComm or the Microsoft Windows Terminal program Whatever communications software is u
66. sed it must have the ability to provide a short delay approx 100 mS after transmitting each line to give the 5120 time to interpret and store the commands that were just sent Automation Modules Incorporated 120 Technical Reference Manual 4 Introduction to Commands The 5120 command instructions are varied and consist of several categories of purpose The command descriptions will be detailed by these categories 4 1 Parameter Commands The parameter setting commands are considered to be those for setting the operating conditions of the servo system i e PID filter gains velocity acceleration and etc Command DBn Dead Band Argument 0 lt n lt 16383 Default 0 This command sets the position following error dead band The purpose for the DB command is to allow an acceptable static position error for which there will be no restoring force This has the affect of reducing or eliminating hunting which is the continuous movement at or about a position in trying to seek that position This is useful for applications that cannot tolerate this condition Please note that the DB command is only in effect when the servo is not in motion when the Trajectory Complete bit is set in the servo status word Related Commands TF Command FAn Feed forward Acceleration Argument 0 lt n lt 32767 Default 0 This command allows for the adjustment of the PID digital filter acceleration feed forward term for the s
67. sed to define a new macro Any duplication of numbers will simply result in the loss of the previously defined macro using that number and the loss of the memory that it used The Macro Define MD command must be the first command in the command line or an error will be reported Related Commands RM TM Command MJn Macro Jump Argument 0 gt n gt 5 This command may be used to Jump to a previously defined macro command Once the 120 begins executing the new macro it has no record of how it got there This means that any commands that appear after the Macro Jump MJ command will not be executed If there is no macro defined by the number n an error will be reported Once the end of the macro is encountered macro execution stops See the Macro Sequence MS command The Macro Jump command can be used any place in a command string or macro command It is also acceptable for a macro to jump to itself Related Commands MC MS Command MSn Begin Macro Sequence Argument 0 lt lt 255 This command will cause macros to be executed sequentially beginning with macro n until an undefined macro or an End Program EP command is encountered This command can be used anywhere in a command string or macro command If the Macro Jump MJ or Macro Call MC commands are encountered macro execution will still continue to execute sequentially Related Commands MC MJ 57 Automation Modules Incorporated 120 Technica
68. t condition such as over temperature Note When a fault condition occurs the 16 bit internal variable FCNT see Internal Variables begins to increment at a rate of once per millisecond If the fault condition clears then the FCNT variable is also cleared If the fault condition remains present long enough for the FCNT variable to count up to the value assigned to the FCMP variable then the Fault bit in the status word will be set and the servo will be disabled assuming the Fault interrupt has not been enabled The default value for FCMP is 10000 which will give a 10 second delay before causing the Fault bit to be set 5V INPUT uC INPUT Figure 1 S120 Dedicated Input Automation Modules Incorporated 120 Technical Reference Manual 1 2 2 General Purpose Digital Inputs Figure 2 illustrates one of the S120 s general purpose inputs These inputs are of the type HCT TTL Each of these inputs has a 15K pull up resistor 5 15 INPUT uC INPUT 74 541 Figure 2 6120 General Purpose Input 1 2 3 General Purpose Digital Outputs Figure 3 illustrates one of the S120 s general purpose outputs These outputs are of the HCT TTL DUTPUT lt fo uC OUTPUT 74HCT541 type Figure 3 5120 General Purpose Output 1 2 4 Digital I O States There are several commands that deal with controlling the general purpose digital I O The Channel High CH and Channel Low CL commands provide the user with the ability
69. t or an argument of 0 then one macro will be removed from the macro stack If there is no macro to be removed then a MACRO STACK UNDERFLOW error will be reported If the argument is 1 then the macro stack will be completely reset The UM command is used in the event that a macro is paused due to a program interrupt and it is not desirable to return to that macro or under some circumstances a program may need to completely reset itself Related Commands MC interrupts 58 Automation Modules Incorporated 120 Technical Reference Manual 4 8 Input Output I O Commands The user is able to manipulate the S120 s I O channels via the use of several commands These include setting or clearing outputs reading inputs and altering the logic type of both Command Bin Bulk Input from I O Port n Argument 0 lt n lt 7 This command reads the value at the 8 bit digital input port and copies it to the low 8 bits of the accumulator with the lower channel being the lowest bit in the accumulator The unused bits of the accumulator will be set to 0 The state of the inputs will be determined by the Channel High CH and Channel Low CL commands and the inputs will have been debounced if the Input Debounce ID command is in effect Related Commands BO Command BOn Bulk Output to I O Port n Argument 0 lt n lt 7 This command copies the low 8 bits of the accumulator to the digital output port The state of the outputs will be d
70. that no display was connected at the time Command TF Tell Following Error This command reports the following error for the servo This value is the difference between the current desired temporal position or that which is reported by the Tell Optimal TO command of the trajectory generator and the servo s current real position or that which is reported by the Tell Position TP command Related Commands DB Command TG Tell Proportional Gain This command reports the proportional gain value of the PID digital filter for the servo Related Commands TI TD TL Command TI Tell Integral Gain This command reports the integral gain value of the PID digital filter for the servo Related Commands TG TD IL 30 Automation Modules Incorporated 120 Technical Reference Manual Command TKn Tell K Constants Argument 0 lt lt 1 This command will display a number of internal settings depending on the value specified by n If n is 0 or is not specified then various parametric values for the servo will be displayed If n is 1 then various system parameters will be displayed Example display for the command TKO gt TKO Parameter Values for Axis 1 Proportional Gain Integral Gain Derivative Gain Integral Limit Current Gain Velocity Feed forward Gain Accel Feed forward Gain Output Offset Position Error Dead Band Maximum Following Error
71. to be echoed as they are received It is normally used in the full duplex mode of operation in serial communications Related Commands EF Command GAn Get A D Channel Argument 0 lt n lt 9 This command will cause a conversion on A D channel n and will store the result in the bottom 10 bits of the accumulator Unused bits will be set to 0 Note Only inputs 0 7 8 and 9 are used Related Commands TA Command HF Hardware Handshaking Off Default Hardware handshake off This command does not function and is retained for backward compatibility reasons Command HM Hexadecimal Mode Default Decimal Mode This command causes all numerical input and output to be interpreted as hexadecimal or base 16 Numbers will be output as 2 4 or 8 digits with leading 0 s if they are positive and leading F s if they are negative Related Commands DM Command HN Hardware Handshaking On Default Hardware handshake off This command does not function and is retained for backward compatibility purposes 65 Automation Modules Incorporated 120 Technical Reference Manual Command MG n N Display Message Argument 0 lt n lt 511 This command allows for the display of an optional text string and or an optional register variable with the additional option of inhibiting the carriage return linefeed CRLF at the end The text string must be enclosed by quotes parameters must be separate
72. ts Once enabled the servo will be stopped or turned off if a limit switch input goes active At the same time the Limit Switch Tripped and Error Flags will be set in the status word These flags will remain set until the servo is turned back on with the Motor On MN command Once the servo is turned back on it can be moved out of the limit switch region with any of the standard motion commands The argument to this command determines which of the limit switch inputs will be enabled The coding is as follows Limit Switch Inputs Enabled 0 3 or no argument Limit and Limit 1 Limit 2 Limit Related Commands LF LM Command OOn Output Offset Argument 32767 lt lt 32767 Default 0 This command allows the user to set a continuous output for the servo In certain applications such as an overhanging load there will be a continuous burden placed upon a servo axis In cases like these where there is a predictable load the OO command can be used to provide a continuous restoring force that will be combined with the output of the PID digital filter This has the affect of improving the performance of the PID digital filter in that because it is not saturated with static load it has a better dynamic response to load disturbances Related Commands FA FV 22 Automation Modules Incorporated 120 Technical Reference Manual Command PHn Set Servo Phasing Argument 0 gt n gt 63 Default 0 This comma
73. ument is used that is greater than the macro memory available then an error will be reported Because information pertaining to this command is stored in non volatile memory once this command is issued the storage space will remain even after power cycling To recover the macro memory used by this command use the Reset Macros RM command Related Commands CD DD Command DDn Dump Data Argument 0 lt n lt 16383 This command is used to dump data that has been previously recorded by the Capture Data CD command to the display The argument determines the number of recorded samples to display If an argument is used that is greater than the allocated storage space then the argument will be truncated to fit that space Related Commands CD CS Command DM Decimal Mode Default Decimal Mode This command causes all numerical input and output to be interpreted as decimal or base 10 Numbers will be output with a leading if they are less than zero Related Commands HM Command EF Echo Off Default Echo On This command suppresses the echoing of characters received by the serial communication s interface It is normally used in the half duplex mode of operation in serial communications Related Commands EN 64 Automation Modules Incorporated 120 Technical Reference Manual Command EN Echo On Default Echo On This command causes characters received from the serial communication s interface
74. uted When that position has been reached the breakpoint reached flag in the status register will be set This command can be issued before or after the servo has been commanded to move Related Commands IP TB Command ISn If Bit n of Accumulator is Set 1 Argument 0 gt n gt 31 If bit n of the accumulator is set equals 1 command execution will continue otherwise the next two commands in the command line the or the macro will be skipped Related Commands IC Command lUn If Accumulator Unequal to n Argument 2 147 483 647 lt n lt 2 147 483 647 If the accumulator is unequal to the value n command execution will continue otherwise the next two commands in the command line or the macro will be skipped Related Commands IE Command RPn Repeat Argument 0 lt n lt 65 535 This command causes the command line to repeat n more times If n is not specified or is O the command line is repeated indefinitely 51 Automation Modules Incorporated 120 Technical Reference Manual Command WAn Wait n milliseconds Argument 0 lt n lt 65 535 This command causes a wait period of n milliseconds before going on to the next command Command WEn Wait for Edge Argument 0 or 1 This command waits until the Coarse Home Input Active bit in the status word is at the logic state specified by n before continuing command execution If n is not specified or is O
75. ve when that input is active 2 4 Interrupt Priority If more than one interrupt source becomes active at the same time then the source with the higher level will be executed first Level vector 31 has the highest priority and level vector 0 has the lowest priority Automation Modules Incorporated 120 Technical Reference Manual 2 5 Interrupt Completion Once an interrupt macro or set of macros has finished executing a Return from Call RC command or an undefined macro may be used to cause a return from the interrupting macro back to the interrupted macro where command execution will continue from where it was interrupted see MS command In cases where it is undesirable to return to the interrupted macro the Unpush Macro UM command can be used to remove the previously pushed macro from the macro stack This command can also be used to completely reset the macro stack in order that the user program can be restarted 2 6 Interrupt Latency Interrupt sources are sampled before each command in a macro is executed This means that the amount of time that an interrupt is held off before execution also known as interrupt latency depends on how long it takes the previous command to complete For most commands this delay will be imperceptible to the user Commands such as Wait WA Wait for Edge WE Wait for Stop WS Wait for Off WF Wait for On WN and Wait for Index WI would normally be a source of unacceptable delay in that the
76. with 2 7K resistors This arrangement will accommodate both open collector and totem pole single ended output encoders or differential output encoders The phasing of the channels as well as the index signal sense can be changed via program command see PH command 1 4 Analog Output Interface The 5120 analog output interface is a 12 bit DAC connected to an op amp that is capable of driving 10 VDC into a 2K ohm load This signal is intended for driving an off the shelf power amplifier for any variety of motor or actuator types and sizes Accompanying the analog output is a TTL signal called Enable that works in conjunction with the Motor On MN and Motor Off MF commands This signal will be high when the servo driver is to be enabled by using the Motor On MN command and will be low to disable the servo driver through the use of the Motor Off MF command or by some error condition 1 5 Analog to Digital Conversion A D Interface The 5120 provides a 3 channel 10 bit A D conversion interface with 8 5 VDC reference and analog ground For reverse compatibility purposes the A D interface is actually ten channels but the user is only given access to channels 7 8 and 9 The other channels are unavailable and should be ignored Whenever a Tell Analog TA or Get Analog GA command is issued the specified A D channel is converted and the result is either reported or stored for access by the user Automation Modules Incorporated 120 T
77. ws for the calculation of predefined positions that can be accessed via the LPS commands Command LPn Learn Current Position Argument 0 gt n gt 5 This command causes the current real position of the servo that position reported by the Tell Position TP command to be stored in location n of the Learned Position Storage table This command is useful for teaching positions to the 5120 Related Commands LT MP Command LTn Learn Target Position Argument 0 lt lt 255 This command causes the current ideal target position of the servo that position reported by the Tell Target TT command to be stored in the location n of the Learned Position Storage table This command is useful for setting up a table of target positions via a downloading procedure Related Commands LP MP Command MPn Move to Index Table Position n Argument 0 lt lt 255 This command causes the position contained by the Learned Storage Position table location n to become the new target position This command will not initiate a motion therefore a Go GO command may be required Related Commands LP LT 54 Automation Modules Incorporated 120 Technical Reference Manual 4 7 Macro Commands Command instructions can be entered directly and executed immediately but the 5120 also has the capability of using commands to form other commands called macros These macros are stored in the nonvolatile RAM N
78. xcept in the case of the related interrupt being enabled and the Error bit in the status word for the axis will be set This bit will remain set until the servo is turned back on with the Motor On MN command If the argument to this command is set to the maximum 16 383 it causes this function to be disabled Related Commands DB TF Command ST Stop Motion This command is used to terminate motion This command differs from the Abort AB command in that the servo will decelerate at its preset rate instead of stopping abruptly When in Torque Mode the outputs will be set to null Related Commands AB WS 39 Automation Modules Incorporated 120 Technical Reference Manual Command VM Enter Velocity Mode Default Position mode This command places the servo in the Velocity Mode of operation In this mode the servo can be commanded to move in either direction to a maximum velocity The servo will move in that direction until commanded to stop When using Velocity Mode the user must specify the direction for the servo to move using the Direction DI command After specifying the desired maximum velocity and the desired direction and placing the servo in velocity mode the servo can be started by issuing the Go GO command While the servo is moving in Velocity Mode the user can change the velocity by issuing new Direction DI and or Set Velocity SV commands The acceleration rate at which the servo s velocity will change
79. y Mode VM the axis will accelerate to a constant velocity When in the Position Mode PM the axis will begin to seek the specified target position The servo must be in the on state for motion to occur Related Commands MA MR PM VM 37 Automation Modules Incorporated 120 Technical Reference Manual Command MAn Move Target Absolute Argument 1 073 741 824 lt n lt 1 073 741 824 This command sets the target position of the servo to absolute position n The absolute position is relative to the point of initialization home or 0 As the Move Absolute MA command will not initiate a motion a Go GO command must be used The servo s target position will be adjusted whether the servo is on or off Related Commands GO MR PM Command MF Motor Off This command is used to place the servo in the off state The servo s output will go to the null level This command can be used to prevent unwanted motion or to allow manual positioning of the unit When the servo is turned off the target and the optimal positions will follow the real position Related Commands MN Command MN Motor On This command is used to place the servo in the on state When the servo is turned on its target position is set to its current position so that the servo is not inclined to move When this command is issued it will disable the Home and Index interrupt sources and will reset the Error Fault Breakpoint reached Looking
80. y can quite often be indeterminate in length This problem has been avoided by making these instructions interruptable For example if a WA10000 command a 10 second delay is currently in progress and an interrupt comes along the remaining delay period will be saved and then returned to after the interrupt has completed If the interrupt were to take 3 seconds to execute then the total wait time of the WA10000 command would be extended to 13 seconds The Position Mode PM Torque Mode QM Velocity Mode VM Wait for Position Absolute WP and Wait for Position Relative WR commands and any command that uses the serial communications link are all commands that could cause unacceptable interrupt latency Therefore their usage should be carefully considered where interrupts are possible 15 Automation Modules Incorporated 120 Technical Reference Manual 3 Entering Commands Immediately after power up the S120 is ready to accept commands To verify this you can hit the ESC If everything is working properly this should cause a greater than sign gt prompt to appear on your display If not you need to verify that the power and communications connections are correct and verify the compatibility of the communications protocol Commands are entered via a dumb terminal or host computer such as a PC compatible Commands sent to the 5120 should consist of standard ASCII characters and the command lines should be followed by a
81. y operate at the specified baud rate This baud rate will remain in place even after power cycling the unit until it is changed again Please note that the default baud rate is 9600 62 Automation Modules Incorporated 120 Technical Reference Manual Command CDn Capture Data Argument 0 lt n lt 16383 This command allows for the capture and recording of data from an internal variable with the user being able to later download and plot this data for analysis The number of samples that can be recorded depends on the amount of macro memory available at the time that the Capture Storage CS command is issued The argument determines the number of samples to record If an argument is used that is greater than the allocated storage space then the argument will be truncated to fit that space All data sizes are extended to 32 bits before they are stored Before using the CD command a few things must be taken care of The first of these is to define an area to store the data The Capture Storage CS command is used for this in that it allocates a storage area in the macro memory to where the data can be recorded The next thing to do is to specify the location and size of the data to be recorded The internal 16 bit variable RecAddr see Register commands is used to specify the location or address of the variable to be recorded The internal 16 bit variable RecSize is used to specify the data size If bit O of RecSize

Download Pdf Manuals

image

Related Search

Related Contents

Kenmore 7979CF User's Manual  Pacesaver Scooter Owner`s Manual  Parasound 275 Stereo Amplifier User Manual  Philips AE1506 Portable Radio  Bank Reconciliation User`s Manual OPEN SYSTEMS® Accounting    Manuel d`Utilisation  双針圧力計  

Copyright © All rights reserved.
Failed to retrieve file