DCX-VM200 Firmware Revision History Precision Microcontrol Corporation Changes for Ver. PM1 Rev. 0.1a ======================================================================= 4/21/94 Initial release of DCX-VM200 firmware Changes for Ver. PM1 Rev. 0.2a ======================================================================= 4/28/94 Fixed module Get and Put commands to work on MC260 modules. 5/4/94 Added support for MF310 GPIB inteface module. 5/5/94 Moved supervisor and user stacks up to 7FF0 and 6FF0 respectively. 5/11/94 Implemented Velocity Override command for contour mode. 5/12/94 Fixed MC200 module code to elliminate analog ouput glitch on reset. 5/12/94 Changed MC260 code that enables pulses when signaled by host. 5/13/94 Implemented Minimum Velocity (MV, code=199) command for stepper motors. Minimum velocity will be used for start and stop in position and velocity modes with trapezoidal profiles. 5/13/94 Changed default PID settings for servos. 5/16/94 Modified conditition for end of trajectory in trapezoidal profile generator to reliably stop near target. Previous code compared move distance to zero which didn't always occur due to floating point math rounding. 5/24/94 Changed MC260 code that enables and disables pulses under control of motherboard. 5/25/94 Added code to linear() function in CLKINT.C to terminate move for steppers when At Target status is received from module. This includes setting trajectory complete flag and setting optimal position to target. Also added to Define Home command to zero tgtcount variable. 5/26/94 Moved MC260 calibration timing to module to allow for shorter timing period. This reduces time for board to initialize itself after reset. 6/2/94 Implemented servo and stepper jogging using JN,JF,JG,JO,JB,JA and JV commands. Changes for Ver. PM1 Rev. 0.3a ======================================================================= 6/29/94 Changed contouring code. Created Motion Block table to manage sequences of contoured motions. Implemented arc contouring. 7/6/94 Implemented software motion limits using two new commands: LL - set motion Low Limit HL - set motion High Limit The limits are disabled on power up and are enabled only if the respective limit command is issued. 7/7/94 Added instruction to send Contour Mode command to stepper modules when mother board executes Contour Mode command. Changes for Ver. PM1 Rev. 0.4a ======================================================================= 7/18/94 Implemented use of GO command to initiate contoured path motion when syncronization is on. 7/18/94 Added code to set trapezoidal profile flag in Position Mode and Contour Mode commands if no profile is selected. 7/18/94 Implemented S-curve profiles in contour mode. 7/22/94 Replaced Arc X center and Arc Y center commands with arc Center Absolute and arc Center Relative commands. No reference to the axes as X or Y is made in these new commands. 7/22/94 Removed the following redundent commands: FX - set Fill contouring memory indeX FP - Fill contouring Position FL - Fill contouring Length FV - Fill contouring Velocity 7/22/94 Modified the Tell Status command to allow the command parameter to display isolated bit or formated servo table. 7/26/94 Implemented Position Deadband (DB) and At Target Delay (DT) commands for servos. 7/27/94 Created Get auXiliary encoder position. 7/27/94 Re-implemented host interrupts. Need to add hostint() function. 7/27/94 Added code to velocity and jog mode profilers to handle rollover of 32 bit encoder and step counters on modules. 7/28/94 Changed all tell commands to use the tenths decimal place of the command parameter to specify the precision of real number ascii replies. Binary interface replies will use integer command parameter to select integer, float or double replies. An exception to this is the Tell Register command which will reply to the binary interface in a format that matches the register contents. 7/28/94 Added Accumulator eValuate command. 7/28/94 Created Esacpe Task (ET) command for signaling a background task to cancel itself. The command parameter must be set to the command executor data address that was placed in the parent task's accumulator when the child was generated. 7/28/94 Modified command interpreter so that only an Escape (1B hex) or Cancel (18 hex) character will terminate a command sequence. 7/29/94 Implemented storage of macros in one segment of flash memory. 8/1/94 Added Tell torQue (TQ) and Tell velocity Konstant commands. 8/1/94 Added code to use Set Slave ratio (SS) command to allow user to adjust ratio betwwen master and slave axes. Changed variable name from prfratio to slvratio. Removed it from use in non-slave axis control. Changes for Ver. PM1 Rev. 0.5a ======================================================================= 8/5/94 Changed soft motion limit checking from counts to user units. This was done to elliminate complications caused by negative user scaling. The drawback is the extra processing time required to perform math on doubles. 8/5/94 Modified DR and DO commands to display values in user units. 8/10/94 Changed host ascii interface to default to Echo oN. Added code to cause board to echo Bell character if board is busy executing command when a printable character is received. Also added code to echo bell if back space is received from host and there are no characters in the input buffer. Changed reply terminating characters to a programmable string that can be set to CR, LF or CR/LF by use of the Echo on/off command parameter. Default terminating character is CR. Each ascii command port can be programmed independently for the desired terminating characters. Changes for Ver. PM1 Rev. 1.0a ======================================================================= 8/30/94 Modified velocity and acceleration feed-forward calculations so that gains can be stored in a form independent of user units. 8/30/94 Modified slave axis calculations to use master's optimal position instead of profile position (which is incorrect in contour mode). 8/30/94 Added code of Set Master command for steppers to place module in contour mode and to enable pulses. This will cause module to maintain stepper's position with feedback loop. 8/30/94 Modified code of Contour Path command for arcs to calculate length of helicoidal motions. 8/31/94 Modified contour mode of stepper module to disable pulses when stepper velocity is set by motherboard to be zero, and motor is at desired position. 8/31/94 Implemented Output Mode command for servo modules. 8/31 94 Added invert flags for module inputs. Limit Mode command can be issued with bit 7 of parameter set to change limit switch inputs to active high. 9/1/94 Initial release of DCX-VM200 firmware. Changes for Ver. PM1 Rev. 1.0b ======================================================================= 9/2/94 Fixed Tell Contouring count command for steppers 9/2/94 Set minimum velocity of stepper motors to zero when initiating contour path moves. 9/9/94 Corrected list of command mnumonics displayed with HElp command. Changes for Ver. PM1 Rev. 1.1a ======================================================================= 9/28/94 Fixed Macro Define code for flash memory. Previous code in CMDEXE.C left interrupts disabled which caused watchdog to trip. 9/29/94 Changed default precision for float values in Tell Register command for 0 to 6. 9/29/94 Fixed command executor so that Contour Path commands worked properly when placed in macros. 9/29/94 Implemented cubic spline interpolation in contour mode. This interpolation is triggered by a GO command with a parameter of 1 being issued to the controlling axis with synchronization on. 10/7/94 Fixed internal command codes for XN and XF commands. Previous revision had codes reversed. 10/10/94 Implemented parabolic velocity profile. Added Profile Parabolic command (PP, code=237). 10/12/94 Fixed velocity and jog modes for negative user scaling. Rollover values were incorrectly calculated. 10/14/94 Fixed declaration of point memory array. Previous code declared array as long, should be doubles. 10/14/94 Added -p68EC020 compiler switch to make file. This will generate code for 68EC020 processor. Previous code was compiled without switch which generated less efficient 68000 code by default. 10/14/94 Changed task_frame structure declaration to type definition in KERN68K.H. This was done to allow use of packed structure in DCX-VM200 code versus unpacked in DCX-AT200. Structure needed to be packed for proper compilation for 68020 processor. 10/14/94 Fixed Get Analog and Output Analog commands. Previous code didn't access current task's accumulator. Also disabled interrupts around non-interruptible ADC and DAC access. 10/14/94 Modified User Load function to place code starting address into accumulator (register 0). 10/17/94 Modified code in S-curve and parabolic profile generator code so that stepper pulses will only be disabled at the end of a commanded stop. Pulses will be disabled in path generator when motor reaches target in un-stopped motions. Changes for Ver. PM1 Rev. 1.1b ======================================================================= 11/15/94 Changed motion limit checks so that it's independent of user zero. 11/15/94 Fixed Find Index and Index Arm commands so that command parameter is properly set as negative of user zero. Previous code copied command parameter to user zero, which caused position to be reported as negative of command parameter (at position where index pulse occured. 11/15/94 Fixed Find Edge command for stepper motors. Previous code used Find Index command for both servos and steppers. This is not consistent with description in manual. Also modified Index Arm and Wait for Index commands to work for stepper motors. Changes for Ver. PM1 Rev. 1.2a (unreleased) ======================================================================= 4/20/95 Fixed Jogging oFf (JF) command so that axis is abruptly stopped if it is in motion when command is issued. Previous code did not turn off trajectory generator, causing undesirable results. 4/20/95 Fixed Find Edge (FE) command for steppers. Previous code waited for MTRIDX status bit to be false, correct code waits for it to be true. Work around for previous code is to use IA,WI command sequence. 4/20/95 Modified GPIB communication code to set EOI on the last character transmitted, whatever it is. Previous code set EOI only on carriage returns. 4/20/95 Modified ReseT (RT) command so that if an axis number is included when the command is issued, only that axis will be reset. Otherwise, the entire board is reset. 4/20/95 Added new variation to contouring mode. When a User Defined Contour Path command is issued (aCP0) and the Contour Distance is 0 (aCD0), then the axis with the longest move time will define the total time for the contour move. The determination of which axis has the longest move time is made using each axes' preset velocity, acceleration and deceleration (SV, SA and DS commands). In other words, one axis involved in the contour move will move at its' preset maximum velocity, the others will move at velocities below their respective maximums. All axes involved in the contour mode will start and stop at the same time. Example Command Sequence: 1DH,2DH 1SV300,1SA1000,1DS1000 2SV100,2SA1000,2DS1000 1CM1,2CM1 1CP0,1MA1000,2MA1000,1CD0 Based on the respective velocities and move distances, axis 2 would have the longest move time so its' velocity will control the contour move. Axis 2 will move at velocity 100 and axis 1 will complete its' motion in the same time as axis 2. Changes for Ver. PM1 Rev. 1.3a ======================================================================= 10/1/95 Implemented ASCII file storage using LOad file (LO, code=186) and TYpe file (TY, code=187) commands. Both commands take a parameter from 1 to 127 specifying a file number. After the LOad command is issued, the controller will accept ASCII characters from the interface port and store them in the file until the End of Text (cntrl-Z, 1A hex) character is received. Issuing the LOad command with a parameter of 0 will format the controllers file system erasing all files. This should be done before storing any files, including after a cold boot when the ram is not battery backed. The TYpe command sends the contents of the file to the interface port. Issuing this command with a parameter of 0 prints a directory listing of the file system. The file system uses the 192 KBytes in the expanded memory option of the board for storage. 2 KBytes of this space is used for the directory and FAT storage. 10/1/95 Implemented Run Initailize (RI, code=188), Run File (RF, code=189), Plot Initialize (PI, code=190) and Plot File (PF, code=191) commands. Each of these commands take a parameter from 1 to 127 specifying a file number. The Run Initialize and Plot Initialize commands process ASCII files containing configuration commands. Each configuration command has the following format: LABEL=VALUE ;optional comment The available configuration commands will be documented in the user's manual, but generally match those listed in the CNC Program user's manual. The Run File and Plot File commands process ASCII files containing G-code (RS-274) and HP Plotter Language programs respectively. If any of these commands are issued from an ASCII command interface, and are executed as the root task, they will generate output messages to show the status of operation. Alternatively, if these commands are issued from the binary interface, or are running as a background task, no output messages will be generated. Changes for Ver. PM1 Rev. 1.3b ======================================================================= 10/18/95 Added call to clearerr(fno) in LOad command to reset EOF flag on input file (interface). 10/18/95 Fixed calls to command executor in CNC and Plotter files. 10/18/95 Fixed bit ordering of binary command interface replies. Previous code had axis number and reply type bits reversed. Changes for Ver. PM1 Rev. 3.4a ======================================================================= 2/25/99 Restructured firmware build process so that source code files common to both DCX-AT200 and DCX-VM200 are truly shared. Common files are now kept in a directory named \PMC\DCX\S200\PM1. 2/25/99 Rearranged data in memory. This requires that DCX-VM200 motherboard have 128Kbyte static RAM's install in positions U17 and U18. Additional RAM is necessary to support new features of this firmware revision. 2/25/99 Removed CNC functionality from system firmware. Removed CNC Run Initailize and Run File commands from firmware. If CNC is implemented in the future, it will be done as application firmware that is built and installed separate from system firmware. 2/25/99 Move file storage commands from application firmware back into system firmware. This was done to support standalone plotting of files. Following commands are implemented: Format file storage (FO, code=270) Directory Listing (DL, code=271) Type file (TY, code=272) Remove File (RF, code=273) Load file (LO, code=274) The last three commands take a parameter value from 1 to 127 specifying a file number. The Format command should be executed before storing any files, including after a cold boot when the ram is not battery backed. After the LOad command is issued, the controller will accept ASCII characters from the interface port and store them in the file until the End of Text (cntrl-Z, 1A hex) character is received. The TYpe command sends the contents of the file to the interface port. The Directory Listing command will display currently stored files and the amount of remaining file storage space. The file system has 10K (10240) bytes of storage space on a board with standard memory. This space is allocated in 1024 byte sectors as needed for file loading. When 128K x 8 dual port RAMs are installed on the board, the file storage is increased by 192K (196608) bytes. When 512K x 8 dual port RAMs are installed, file storage is increased by 960K (983040) bytes. 2/25/99 Reimplemented Plotter capability using new commands: PE - Plotting Enable PXn - Plotter X axis PYn - Plotter Y axis XSn - plotter X Scale YSn - plotter Y Scale XOn - plotter X Offset YOn - plotter Y Offset PVn - Plotter Velocity PAn - Plotter Acceleration PIn - Plotter Initialize macro PUn - Pen Up macro PDn - Pen Down macro SPn - Select Pen macro All configuration commands should be issued prior to enabling plotting. Plotting will be terminated when End Of File (1A hex) character is received. 2/25/99 Added Plotter commands: PF - Plot File PQ - Plotting Quick velocity (used when pen is up) 2/25/99 Implemented tangential cutter control. An axis is set into this mode by issuing the Set Master command with a parameter that indicates two master axes. The parameter contains one master axis number in the least significant nibble, the second master axis number in the next significant nibble. Example: parameter = master axis 1 + (master axis 2 * 16) = 33. The master axes must both be in contour mode using the same controlling axis. 2/25/99 Modified command interpreter and executor to support "extended" commands. This doubles the number of available command codes to 512. Command codes 0 - 383 are reserved for system firmware, codes 384 - 511 are reserved for application firmware. The command interpreter will assume that any ascii commands having a three letter mnemonic are implemented in the application firmware. To support these changes, the command tables in CMDTBL.SRC were increased in size. NOTE that the code table entries were changed from .byte's to .short's. 2/25/99 Rearranged first part of internal motor data structure to match first part of motor table located in dual port memory. This will allow application firmware to get motor information from table in fast static ram as opposed to slow dual port memory. 2/25/99 Modified command interpreter and executor to support string parameters delimited by double quotes. Added following commands: FTs - Format Text with integers (address returned in Reg. 0) FDs - Format text with Double (address returned in Reg. 0) OTs - Output Text with integers ODs - Output text with Double 2/25/99 Changed PC mailbox code so that character echo is performed as each character is received. This will stop execution until echo character is received. This will require utilities that download command files to board to receive last echoed character before exiting. 2/25/99 Implemented backlash compensation feature for servos. This includes three new commands: BN - Backlash compensation oN BF - Backlash compensation oFf BD - Backlash compensation Distance The backlash compensation distance is set in user units, and is the value that will be added to, or subtracted from a servo's commanded position based on current direction. 2/25/99 Added test for Escape character to serial port interface so that command sequences can be aborted. 2/25/99 Added code to Tell Macro command to display amount of available macro storage space. 2/25/99 Added code to set command interpreter status non-zero when a carriage return is received from PC Ascii interface (just prior to input mailbox being cleared). Delayed clearing of command interpreter status until after prompt character is sent to output mailbox. The following can now be stated about the PC Ascii interface: 1. Command interpreter status goes non-zero before carriage return is removed from input mailbox. 2. Command interpreter status stays non-zero until prompt character is placed in output mailbox. This allows utility programs that us the PC Ascii interface to be designed without possible race conditions in communicating with the controller. 2/25/99 Implemented multi-user command interfaces. Each command interface is handled by a separate task so they can run simulaneously and independently. Command interpreter status word in dual port memory (808h offset) now has the following format: BIT FLAG ==================================== 0 Host Binary Interface - Busy 1 Unused 2 Unused 3 Unused 4 Host Ascii Interface - Busy 5 Unused 6 Unused 7 Host Ascii Interface - Loading File 8 Serial Interface - Busy 9 Unused 10 Unused 11 Serial Interface - Loading File 12 GPIB Interface - Busy 13 Unused 14 Unused 15 GPIB Interface - Loading File 2/25/99 Implemented Get Device ID command (GD, code=246) to load the accumulator with the module type associated with an axis. 2/25/99 Modified the module ID's stored in dual port ram so that they include subtype number in the upper nibble. On MC200 and MC260 modules, the subtype is set by the 4 upper input pins of the 78310 port 0. Example: MC210 has ID of 0, with subtype of 1 Module ID = 0 + (1 << 4) = 16 2/25/99 Modified mc200 module firmware to support MC210 module. 2/25/99 Modified circular contouring to perform spiral motion if end point is not the same distance from the center as the starting point. End of arc will be at the designated target. This required increasing the size of motion table entries so that starting and ending radii could be stored. 2/25/99 Implemented new commands to support additional means of specifying arcs with the Contour Path command: RR - aRc Radius (negative parameter generates arc > 180 degrees) EA - Ending arc angle Absolute (angle in degrees, x axis = 0) ER - Ending arc angle Relative (angle in degrees, relative to start) Each of these commands can be used as part of a arc Contour Path command, specifying the controlling axis as the axis number. Examples: 1CM1,2CM1 1CP2,1MR10000,2MR10000,1RR10000 ;Generates 90 degree arc 1CP2,1MR-10000,2MR-10000,1RR-10000 ;Generates 270 degree arc 1CP2,1MR10000,2MR0,1EA0 1CP3,1MR-10000,2MR0,1ER180 2/25/99 Implemented HPGL circle and arc commands in plotting functions. The syntax of the circle command is: CI radius(,chord); where the chord angle is optional and will be ignored. When this command is executed, a smooth circle centered at the current pen position will be drawn. Prior to drawing the circle, the pen will be automatically lifted and moved to the starting point on the circle (0 degrees if radius is positive, 180 degrees if radius is negative). After the circle is completed, the pen will be raised and moved back to the center of the circle. The pen will be left in its' original position, prior to the command being executed. The syntax of the arc commands is: AA x_abs,y_abs,angle(,chord); or AR x_rel,y_rel,angle(,chord); where the chord angle is optional and will be ignored. In the AA and AR commands, the x and y parameters specify the center of the circle in absolute coordinates or relative to the pens current position respectivly. If the arc angle specified in the command is positive, the arc will be drawn counter clockwise, if negative it will be drawn clockwise. 2/25/99 Added Save Configuration (SC, code=276) and Restore Configuration (RC, code=277) commands. Each of these commands takes an optional axis specifier and has a file number as the command parameter. These commands save and restore the entire motor tables respectively. This includes the public motor table in dual port memory the private motor table in internal RAM. These commands allow the motors to be stopped (aVO0) during a contour move, their configurations save, switched to any other mode (except contouring), moved about and then returned to their original positions, their configurations restored, and then commanded to continue the contour move (aVO1.0). 2/25/99 Added MEmory allocate (ME, code=268) and Free Memory (FM, code=269) commands. The ME command tkes the number of bytes required as a command parameter, and returns the address of the allocated memory space in the accumulator. The FM command takes the address of allocated memory as the command parameter. It returns the memory to the heap from which it was allocated. The parameter to this command must be the value that was returned by the ME command. 2/25/99 Modified Velocity Override command so that it affects not only contour mode motion, but motion in position and velocity modes. Jogging motion is not affected by the VO command. The velocity override value that is set in one mode will carry over to the others modes. 2/25/99 Implemented command execution single stepping and breaking. Switching to single step is accomplished by entering a space character during execution or executing a BreaK command with a string or a non-zero integer command parameter. While single stepping the command that will be executed next when the space character is entered is displayed followed by a reverse prompt character '<'. The command display will be preceded by the command index number, and optionally the macro number, inside braces. If the command includes a direct parameter ('@' sign with a register number), the contents of that register will be displayed after the command in square brackets. Example: BREAK AT COMMAND 5, MACRO 10 break command parameter {C5,M10} 1MR@15 [REG.15=10000] < A carriage return will take the controller out of single stepping mode, and the command sequence will continue. 2/25/99 Implemented Execute Command file (EC, code=279) command. This command assumes the on-board file specified by the EC command parameter contains DCX commands. If single stepping is enabled while executing the command file, the file and line numbers will be displayed with the command index. 2/25/99 Modified ASCII command interpreter to be more flexible in the syntax it accepts. From a ASCII command interface, it will ignore space and tab characters that separate the components of a command sequence. It will not accept spaces between the characters of the command mnemonic, or within a numerical parameter. When executing commands from an on-board ASCII command file, the interpreter will also ignore text that is preceded with a semi-colon (comments), and concatenate lines that are separated by a backslash-newline combination. This allows the board to execute command files created by the tuning utility. 2/25/99 Implemented Use Axis (UA, code=156) and Get axis Used (GU, code=137) commands. When the axis number for a command is set to 0 (or defaults to 0 in ASCII command interpretation), the "Default Axis" number set by the UA command parameter will be used as the axis number. Each command interface maintains its' own Default Axis number. A macro that is called inherits the default axis number of the calling command. Likewise, a task that is generated inherits the Default Axis number of the task that generated the task. The Get axis Used command places the current Default Axis in the accumulator (Reg. 0). The Default Axis number for each command interface is set to 0 on reset, so the behavior of the board is compatible with previous code as long as the UA command is not used. This feature allows the axis number of a command to be variable. Example: MD10,MR10000 ;Macro 10 defined to move the current ; default axis 10000 counts UA1,MC10 ;Set default axis to 1, call generic macro, ; axis 1 moves UA2,MC10 ;Set default axis to 2, call generic macro, ; axis 2 moves A good way to think of this is: specifying axis 0 in a command does not imply all axes, it now implies the current default axis. Keep in mind that the default axis can be still be set to 0, as is the case after reset, and specifying axis 0 in a command will imply all axes. As part of this change, the Tell Macro command will now show an axis number of 0 as a lower case 'a'. This implies that the current Default Axis will be used when the command executes. In addition, when the command interpreter is in single step mode, and the axis number encoded with a command is 0, the current Default Axis number will be shown after the command. 2/25/99 Implemented Tell Error command (TE, code=76) to show the last error code for a command interface. After this command completes the recorded error code will be set to 0, and the respective error flag in the command interpreter staus word will be cleared. Command interpreter status word now has the following layout: BIT FLAG ==================================== 0 Host Binary Interface - Busy 1 Host Binary Interface - Error 2 Unused 3 Unused 4 Host Ascii Interface - Busy 5 Host Ascii Interface - Error 6 Host Ascii Interface - Stepping 7 Host Ascii Interface - Loading File 8 Serial Interface - Busy 9 Serial Interface - Error 10 Serial Interface - Stepping 11 Serial Interface - Loading File 12 GPIB Interface - Busy 13 GPIB Interface - Error 14 Unused 15 GPIB Interface - Loading File 2/25/99 Modified ascii interfaces so that when a command execution error occurs, the command and its' location are shown after the error code. For example if the command MC10000 is issued, the board will respond: ?-5 {C0} MC10000 > 2/25/99 Implemented logical to physical axis reassignment using the Use Physical axis command (UP, code=157). If this command is issued with no axis specified, and a command parameter of 0, it will unassign all axes. If this command is issued specifying a axis number, but with a command parameter of 0, it will unassign just that axis. A logical axis that has no physical axis assigned to it will have no control capability. Issuing the UP command with an axis and a non-zero parameter will assign the physical axis specified by the command parameter to the logical axis specified by the command axis specifier. The physical axis numbers that can be used match the module positions that have motor control modules installed (1-6). The module positions are numbered in the silkscreen printing on the DCX motherboard. To alert the user when a command is issued with a bad axis number, the following command codes have been added: -14 = NO AXIS SPECIFIED -15 = AXIS NOT ASSIGNED -16 = AXIS ALREADY ASSIGNED -17 = AXIS DUPLICATE ASSIGNMENT When a command is with no axis specified, and the command supports this, the command will only affect axes that have current physical assignments. If a command is issued specifying a logical axis that has no current physical assignment, a command error will be generated when the command executes. The default logical to physical assignments that are setup when the board is powered up or reset, will be the same as before. That is, the logical axes will be assigned to consecutive physical axes (motor modules) as they are located on the board. It is best to reassign the axes before issuing any other motion commands just after power up. Any parameter setup that has been done for an axis wil be lost when it is reassigned. Prior to reassigning a logical or physical axis it must be unassigned. This can be for all axes by issuing the UP command with no axis specified, and a command parameter of 0. Example: If MC200 modules are installed in positions 1, 3 and 5 on the motherborad, on power up they will be assigned to logical axes 1, 2 and 3 respectively . Issuing the following commands: UP,4UP1,5UP3,6UP5 will reassign the axes as 4, 5 and 6. Be careful that the default axis set with the Use Axis command is set properly when using the UP command, or things can get very confused. 2/25/99 In order to support the logical to physical axis reassignment feature (see previous note), the point memory has been allocated based on the maximum number of axes the board can support. This means that the teach memory will only hold a maximum of 256 points. 2/25/99 Implemented Output deabBand command (OB, code=195) and Output Offset command (OO, code=203) for MC200 and MC210 modules. Both commands must be issued to a specific axis. The parameter to the OB command must be a positive real value between 0 and 10. This value will be added to or subtracted from the analog output of the MC200 module. If the calculated output voltage is positive, the voltage is increased by the output deadband voltage. If the calculated output voltage is negative, the voltage is decreased by the deadband amount. And if the calculated output is zero, the output will be 0 volts. The parameter to the OO command must be a real number between -10 and 10 volts. This value will be added to the modules output signal. The default values for output deadband and output offset are 0. Only one of these parameters should be set to a non-zero value on a servo axis. These commands have no function for stepper axes. 2/25/99 Modified MC200 module firmware to support additional output modes. The Output Mode (OM) command can be issued to a MC200 servo module with a parameter of 0, 1, 2 or 3 according to the desired output mode: 0 = Bipolar analog output (J3 pin 2) 1 = Unipolar analog output (direction on PWM signal, J3 pin 7) 2 = Bipolar PWM signal output (J3 pin 7, 0 = 50% duty cycle) 3 = Unipolar PWM signal output (direction on analog output signal, 0 - 4.5 volts) Note that the MC200 PWM output has a 500 microsecond fixed period. Whether the output is analog or PWM signal, the SQ, OB and OO command parameters have units where 10 represents the maximum output. 2/25/99 Implemented new feature of slave mode where the slave can be connected to the contour profile of the master axis. This is accomplised by issuing the Set Master command to the slave axis, specifying a single master that is already in contour mode, and is the profiling axis of the contour. After the axis is placed in slave mode, it's position will track the contour motion position. This is equal to the linear travel distance of the contour motion. By setting the slave axes' PID loop gains to 0, turning off the following error, and setting the slave's velocity gain appropriately, the slaves output can equal the contouring velocity. This output can then serve as the power control for lasers in cutting applications. Example: Axes 1, 2 and 3 control machine axes X, Y and Z respectively. Use PWM output (J3 pin 7) of MC200 installed as axis 4, to control laser power. The MC200 will use Output Mode 3 for unipolar PWM output with 2 KHz frequency. The minimum duty cycle will be set for 10% (50 microsecond positive going pulse). The maximum duty cycle will be 50% (250 microseconds) at 10000 quadrature counts per second. The commands to configure the axes and cut a triangle are shown below (servo PID parameters already set): 1CM1,2CM1,3CM1 ;Place X, Y and Z axes in contour mode 1VV10000,VA10000,VD10000 ;Set max. velocity to 10000 counts/sec. 4OM3 ;Select PWM output for laser control 4SG0,SD0,SI0 ;Turn off PID loop parameters 4SE0 ;Turn off following error, axis will ; be running open loop 4OB1.0 ;Set output deadband to 1 tenth ; maximum output which is 10. ; This equals 50 microsecond period). 4VG0.0004 ;Set velocity gain for 200 microsecond ; pulse at 10000 counts/second. ; 10000 * 0.0004 = 4 ; 4 / 10 * 500 microsecond = 200 microsecond ;The period that is generated by the ; velocity gain plus the period created ; by the output deadband equals the ; total output period: ; 200 (VG) + 50 (OB). = 250 at 10000 4MN ;Turn axis (laser) on, power = 0 4SS1.0 ;Set slave ratio to 1.0 4SM1 ;Place axis 4 as slave to axis 1 ; which must already be in contour ; mode as the profiling axis 1CP1,1MR50000 ;Draw Triangle 1CP1,2MR50000 1CP1,1MR-50000,2MR-50000 4SM0 ;Disconnect slave axis from contour 4MF ;Turn axis (laser) off 2/25/99 Modified MC200, MC210 and MC260 module code to support modules running with 12 MHz crystals installed. The MC200 and MC210 modules will not have integral terms in the PID loops when running in high speed mode (4 KHz loop rate). 2/25/99 Changed MC200 module code to remove glitches in analog outputs caused by variations in when PID loop is executed. New code measures the time since the last motherboard update and uses that value to interpolate between the motherboard trajectory position updates. Also implemented this change in MC260 code. 2/25/99 Implemented a master slave mode to support threading operations. To initiate this, the parameter to the Set Master command issued to a slave axis is the master axis number plus 256. A move absolute, move relative or go home command can also be issued to the slave axis to set a target position where the axis will be taken out of slave mode. The Index Arm or Find Index command must be issued to the master axis after the Set Master command has been issued to the slave axis. The slave will be synchronized to the master's position when its' encoder index pulse occur's. The auxiliary status bits that are used for slave mode are: Bit 20 = Axis is slaved to master's command position Bit 21 = Axis is slaved to master's contour position Bit 22 = Axis is slaved to master's encoder position Bit 23 = Axis is slaved and waiting for master's index mark This new slave mode uses bits 22 and 23. They can be tested to determine when the slave axis is in motion. Example: 2US2000,MN ;Set scaling of master axis. For a spindle, this ; will be the encoder counts per revolution. 2SQ3.0,QM ;Start master axis moving in torque mode. 1US4000,MN ;Set user scaling of slave axis. 1MA0,WS ;Position slave axis to the desired starting ; point. 1SS0.1 ;Set the slave ratio. This is the lead or pitch ; when cutting a thread. 1SM258 ;Slave axis 1 to 2 (command parameter = 2 + 256) 1MA1.0 ;Set target position, this will be where slave ; mode is terminated and axis stops. 2IA ;Arm the index on the master axis. When the index ; pulse occurs, slave will begin tracking the ; master axis. 1RL16,IS22,JR-2 ;Wait until stus bit in auxiliary status is ; clear to indicate when slave has reached target. 2SQ0 ;Stop master axis. 2/25/99 Fixed problem with MC260 module resets. In previous code, MC260's would not reset properly, or fail to operate after reset. This problem happened frequently on modules with 12 MHz crystals. It was never observed on 16 MHz modules. To eliminate the problem, the RFM register in the 78310 uC needs to be initialized early in the startup code. This register controls the function of an output pin on the device that is used to enable and disable the stepper pulses of the module. This pin also has the capability to provide pulses to a pseudo static RAM device that might be connected to the uC. Because of its' behavior after reset (goes low), and its' ability to be driven to a static level under software, this pin was used as an enable control for the stepper pulses. On the MC200 servo modules this pin was used to enable the reference voltage for the DAC. On reset the signal goes low to force the DAC output to 0 volts. In the MC200, the startup code initialized the RFM early on in order to enable the reference. In the MC260, the RFM was not initialized until the first motor move. For some unknown reason, failing to initialize this output causes the device to fail some part of its operation during module initialization. The work around was to add an instruction to initialize the register to a value that causes the signal to be set statically low. Since this has the effect of disabling stepper pulses, which is the desired state, no other action is required. In identifying the previous described problem, other improvements in the firmware were identified and implemented as follows: Extended length of reset pulse to MC2XX modules when the RT command is issued to a specific axis. The 78310 uC spec. sheet calls out for a minimum of 10 microseconds. In previous code, this pulse was less than 2 microseconds. Disable clock service during reset of a specific axis using the RT command. This allows interrupts to be enabled, so that watch dog trips do not occur. Turned on the LED that is associated with a specific axis during reset of a specific axis. In previous code, the LED's were only flashed during initialization of each axis after a global reset. Check for MC260 module returning an invalid number during the reading of calibration information from the module. In previous code, if module pulse generator wasn't working, a value of 0 was passed to the motherboard, which subsequently did a divide by zero causing a processor fault. New code will hold the motherboard processor in an infinite loop so the user can determine the module that failed to initialize by the axis LED's. Modified main command interpreter loops in both MC200 and MC260 module code so that interrupts are not enabled until after CI variables are initailized. 2/25/99 Changed code in MC200 and MC260 modules so that serial port pins are left configured as port pins. Two of these pins are used as crystal select pins. Changes for Ver. PM1 Rev. 3.4b ======================================================================= 3/8/99 Added support of offset values for auxiliary encoder inputs. Auxiliary encoder define Home (AH) and Auxiliary encoder Find index (AF) commands will now accept a command parameter that will be used as an offset of the auxiliary encoder's reported position. Changes for Ver. PM1 Rev. 3.5a ======================================================================= 5/4/99 Implemented closed loop stepper mode. Fixed HS, MS and LS commands to copy calibrated velocity gain value to motor table variables. This allows them to be read with Tell Velocity Constant command (TK, code=92), multiplied by stepper pulse to encoder ratio, and then reset with Velocity Gain command (VG, code=119). Closed loop stepper mode is initiated by issuing Input Mode command (IM, code=114) with a parameter of 1. The IM command with a parameter of 0 disables it. The Phase command (PH, code=115) can be issued with a parameter of 1 to reverse the direction of the stepper pulses to match the encoder. The Stop on Error command (SE, code=25) can be used to set the maximum following error before the motor is turned off. A sample command sequence to operate a stepper axis in closed loop mode is: 1MS ;Select stepper output speed range (HS, MS, or LS) 1TK.3 ;Get controller to display current calibrated velocity gain 01 5.501 ;Controller reports VG=5.501 for Medium Speed mode 1VG13.75 ;Set Velocity Gain to current value multiplied by ; step pulses to encoder count ratio. For a 400 line ; encoder (2000 quarature counts per rotation) ; mounted to a 5000 pulse per rotation stepper, ; the ratio would be 5000/2000 = 2.5 ; The resulting VG parameter would be 5.501 x 2.5 = 13.75 1IM1 ;Switch to closed loop stepper mode 1AH ;Zero encoder counter 1MN ;Turn axis on, this updates target and optimal to current ; encoder position. Tell position command reports ; encoder position. 1SV20000 ;Set maximum velocity, acceleration, and deceleration 1SA2000 ; in units of encoder counts 1DS2000 1MV200 ;Set minimum velocity so motor reaches target with ; some non-zero velocity. Typically 1/100 maximum speed. ;WARNING: Minimum Velocity must be less than Maximum Velocity 1SE500 ;Set maximum following error in encoder counts 1SG100 ;Set proportional gain, derivative gain, integral gain, and 1SD0 ; integration limit for best motor speed stability. Values 1SI1 ; shown here are defaults used for open loop stepper. Command 1IL10 ; parameters for these commands with MC260 are integers ; in the range 0 - 65535. 1MR200000 ;Issue moves in units of encoder counts ;Watch axis error lights on DCX motherboard for indication ; that maximum following error was exceeded. ;If motor moves a short distance and then stops with an ; error indicated, try switching motor phasing with 1PH1 ; command (PH = 0 is default, required for open loop stepper). ; This will cause motor to move in opposite direction. Changes for Ver. PM1 Rev. 3.6a ======================================================================= 8/9/99 Changed Ascii command interfaces so that single step prompt '<' is displayed regardless of whether echo is enabled or not. This change was done to make single step prompt operation consistent with normal prompt (ie. '>' is displayed regardless of whether echo is enabled or not). Changes for Ver. PM1 Rev. 3.7a ======================================================================= 11/23/99 Made changes to firmware that supports MC260 stepper module. In previoius code, stepper module did not perform correctly if speed was set to 0, or direction was changed while moving in velocity mode. A similar problem occurred in position mode if the target was changed requiring the motor to change directions in the middle of a move. In new code, module uses the sign of the DAC offset to set the state of the direction control signal. If DAC offset drops to 0, module will retain the previous direction signal state. Code for GO command on motherboard no longer sends a DI command to module. IMPORTANT NOTE: For MC260 stepper module to work correctly, the minimum velocity (MV) of the motor must be set to a non-zero value. typically 1 - 10 percent of the maximum velocity. Changes for Ver. PM1 Rev. 3.8a ======================================================================= 12/16/99 Changed default maximum velocity for a stepper motor to 10000. This matches what is specified in the defaults table of the user's manual. Added code to set the default minimum velocity for a stepper motor to 1000. These settings are acceptable for all 3 speed ranges. No changes were made to servo motor defaults. 12/16/99 Recorded state of limit switch input invert flags in auxiliary status bits 24 and 25. When the Limit Mode command (LM) is issued with bit 7 set in the parameter, the limits will be configured as inverting in the module, and both bits 24 and 25 will be set in the auxiliary status word. 12/16/99 Added additional parameter options to the Tell Status command (TS). The following table shows the available options: Parameter Return Value =========================================== 0 status word (32 bits) 1-31 status bit 1 to 31 32 show status information (ascii interface only) 33 show auxiliary status information (ascii interface only) 34 show motor table information (ascii interface only) 35 show internal servo table information (ascii interface only) 64 auxiliary status word (32 bits) 65-95 auxiliary status bit 1 to 31 96 profile control word (32 bits) 97-127 profile control bit 1 to 31 128 path control word (32 bits) 129-159 path control bit 1 to 31 Changes for Ver. PM1 Rev. 3.9a ======================================================================= 2/8/00 This revision number skipped to make firmware revision match new Windows API oriented User's Manual. Changes for Ver. PM1 Rev. 4.0a ======================================================================= 2/8/00 Fixed Tell Status command for parameter values of 32, 33, 34 and 35. This was broken by code changes in rev. 3.8a. 2/8/00 Modified code to handle changes in target position while moving in trapezoidal profile mode. Previous code had problems with target position changes that required motor to stop and change direction. In new code, if a servo or stepper motor is moving, and a new move command is issued that requires change direction, the command interpreter will stall while the motor decelerates and then starts in the new direction. The controller will determine whether it can stop at the new target using the motors current position, speed, and minimum velocity setting. With new code rmpdown() function in trprof.c is not needed, but will be left in place in case implementation changes in future. Added statement to set Acceleration Mode flag when ramp down finishes. This appeared to be missing in previous code. Added command error value -13 to indicate when a move is issued to an axis that currently has an error flag set. Also implemented the ability to change target destinations while moving with S-curve or Parabolic profiles. In previous code, move commands were ignored if axis was already moving. In new code, axis will be stopped, and then restarted to the new target. Note that the command interpreter will stall while axis decelerates using a trapezoidal velocity profile. Modified code for velocity mode so that DI command is issued to module when direction change is commanded. This is done after rampdown to zero velocity. These changes were implemnted in the following files: MOTCMD.C, TRPROF.C, SCPROF.C, PAPROF.C and VLPROF.C ======================================================================= CHANGE REVISION LEVEL IN VERSION COMMAND IN MISCCMD.C ======================================================================= End of revision history