DCX-PCI Firmware Revision History Copyright 2000-2001 Precision MicroControl Corp. All Rights Reserved Software Notes: 1. Heart beat timer period is set in function init_hbt(). This is found in source code file: RTEMS\RTEMS-X.X.X\C\SRC\EXEC\SCORE\CPU\MIPS64ORION\CPU_ASM.S. Changes for Rev. 0.1a =============================================================================== 3/17/00 Moved Host ASCII interface output mailbox to USC mailbox 1, and command interpreter status to USC mailbox 2. USC mailboxes will be assigned as follows: Register Offset Description ====================================== mailbox0 0x100 Host ascii command input mailbox1 0x104 Host ascii reply output mailbox2 0x108 Command interpreter status mailbox3 0x10C mailbox4 0x110 mailbox5 0x114 mailbox6 0x118 mailbox7 0x11C 8/2/00 Changed default ASCII response string terminator from '\r' character to '\n' character. ASCII input mailbox code was also modified so that '\r' character input is echoed as a '\n' character. 12/22/00 Changed heart beat timer period to 4 milliseconds. Module update and trajectory calculations are performed after timer interrupt. 1/29/01 Created Disable Watchdog command (DW, code=253). ***** Project Files Archived to CD ******* Changes for Rev. 1.0a =============================================================================== 2/7/01 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 implemented in the following files: MOTCMD.C, TRPROF.C, SCPROF.C, PAPROF.C and VLPROF.C 2/8/01 Implemented output text commands: FT, FD, OT, and OD 2/8/01 Implemented MC320 commutation setup commands: LA, LB, LD, LE and LR 2/9/01 Implemented Look Up variable command (LU, code=129) to allow indirect access to motor table variables. The LU command accepts a string parameter that should be one of the predefined variable names. The controller will look up the variable name and store an offset for the variable in the accumulator. The offset can then be used as the parameter to the read and write commands to access data in the motor tables. The Help command issued with a parameter of 1 will display a list of the predefined variables and there respective type (byte, word, long, float, or double). For example, a variable is defined for the motor's breakpoint position. The respective entry from the help command is: "BRKPOS = Breakpoint Position (double)" Issuing the following MCCL commands will load the breakpoint position for axis 1 into the accumulator: LU"BRKPOS",1RD@0 2/14/01 Implemented Echo On (EN) and Echo Off (EF) commands for ascii interface. 2/15/01 Modified motor module initialization code to record MC320 module subtype information in motor data and module type data. 2/15/01 Implemented Prompt Character (PC) command for ascii interface. 2/26/01 Modified module bus timing to be compatible with MC400 module. This requires updating configuration in U6 and U29 to rev. B Cleaned up initdigio() and dcmd() functions. Previous code used "zero" variable to write 0's to CIO registers. This was done to prevent Microtec compiler (used on other products) from generating CLR instructions which performed reads prior to writes. New code writes constant 0 to registers. Verified operation of TC, CN, CF, CI, CT, CH, and CL commands with MC400 digital I/O module. 2/28/01 Changed clock interrupt period from 4 milliseconds to 1 millisecond. Motor update service is executed immediatly after clock interrupt every millisecond. This includes transferring data with all motor modules and running trajectory generator calculations for each axis. Code for DSP on MC3XX modules was changed to be compatible with new service period. When building DSP code, the motherboard type (DCXPCI or DCXAT) must be defined in the MC300.H or MC360.H file. Real time OS on DCX-PCI will now switch to a different task after each clock interrupt. Even with 16 axes installed in motherboard, interrupt service and motor update will be 600 microseconds, worst case. 3/1/01 Modified code to prevent move relative 0 or move absolute to current position from turning stepper pulses on. This should have no effect on servo motors. Note that controller will not initaite a move unless the motor position (encoder or stepper counts) changes. 3/1/01 Fixed Motor On command to work properly if an axis had a limit switch trip, but the limit mode was set to leave the motor on. Previous code did not set the optimal position correctly. 3/1/01 Implemented Fault Input On (FN) and Fault Input Off (FF) commands for stepper axes. This makes the Amplifier Fault Enabled and Tripped status flags valid for stepper axes. 3/12/01 Fixed Define Home command by adding code to set cmdcount variable to 0. This corrects problem with issuing Motor On command immediatly after Define Home. In previous code, the Motor On command would use the non-zero cmdcount to set the target an optimal back to the pre define home value. 3/26/01 Fixed Home command. 3/28/01 Implemented Use Axis, Use Physical axis, and Tell Velocity commands. 3/30/01 Added ability to offset auxiliary encoder position by including a parameter with the AH and AF commands. 4/10/01 Fixed code for MC400, MC500 and motherboard digital I/O. Previous code accessed hardware with variables not declared as volatile. Compiler generates optimized code that discards reads and writes that appear to be unnecessary. Declaring variables that access hardware (or are updated by reads from hardware) as volatile prevents this from happening. 4/10/01 Modified motherboard digital I/O code to cause default state of channels 9 through 16 to be High True logic, in the on state. This is consistant with DCX-AT motherboard implementation. Changes for Rev. 1.1a =============================================================================== 5/7/01 Fixed move commands so that target position will be updated even if motor is off. 5/7/01 Corrected code that didn't properly mask off module subtype bits. In previous code, there was a problem with MC320 modules that are a MC300 subtype. Fixed MC320 module initialization and Use Physical command for MC320. 5/7/01 Added code to initialize Vector Acceleration, Deceleration and Velocity values to 10000. 5/7/01 Implemented get Auxiliary indeX into accumulator command (AX, code=225). This command is valid for MC300 and MC360 modules. 5/8/01 Implemented new commands to support initialization of IIR filter on MC300 and MC320 servo modules: YF - Yes Filter command enables filter (code = 335) NF - No Filter command disables filter (code = 336) FL - Filter Load command loads successive filter coefficients (code = 337) GF - Get Filter coefficient command gets the specified filter coefficient into accumulator (code = 338) ZF - Zero Filter command clears all filter coefficients to 0 and resets filter load index to 0 (code = 339) Created new auxiliary status bit to indicate when filter is enabled. Bit 7 will be set when servo filter is enabled. Added motor table variables COEFMAX and COEFCNT to hold the maximum number of filter coefficients and the number of coefficients that have actually been loaded on the controller. These values can be accessed by looking up the variable names. Both variables are shorts (16 bits). 5/10/01 Added new auxiliary statues reporting lines to Tell Status response. These are displayed by issuing a TS33 command to an axis. 5/10/01 Implemented Integral Option command (IO, code=205) to select how the integral term of the PID functions while a servo is moving. The command parameter selects 1 of 3 modes as follows: Command Param. = 0 - Integral term always on (this is the default setting) Command Param. = 1 - Freezes integration term during movement and continues integration once trajectory completes. Command Param. = 2 - Zero integration term during movement and starts integration once trajectory completes. Added motor table variable INTEGRALOPT to read the current Integral term Option setting. This variable is a short. 5/16/01 Changed motor initialization code on motherboard to set default speed of module by calling LS, MS or HS command functions. Previous code set motherboard variables and assumed module code had matching default values. New code uses MS command code to set medium speed as the default for servo modules, and HS command code to set high speed as the default for stepper modules. 5/16/01 Added code to Motor On and Motor Off commands to disable pulses on MC360 module. 5/16/01 Implemented closed loop stepper capability. Issuing the Input Mode command (IM, code=114) with a parameter of 1 selects the auxiliary encoder input as the position feedback for the MC360 stepper module. Issuing the same command with a parameter of 0 returns the stepper module to open loop operation. Changes for Rev. 1.2a =============================================================================== 6/1/01 Fixed velocity mode for stepper modules. Previous code didn't turn off pulses when velocity dropped below minimum. 6/1/01 Added code to zero local user registers for 2 command interpreter tasks (ASCII and binary interfaces) and any background tasks created with the Generate Task command. Changes for Rev. 1.2b =============================================================================== 6/21/01 For sequence commands, fixed skipping of commands with string parameters. In previous code command executor didn't update the string parameter size variable as it advanced the command indices. Changes for Rev. 1.3a =============================================================================== 8/03/01 Changed MC360 stepper module logic and software so that the breakpoint commands (WP,WR,IP & IR) use the step position. In previous code these commands used the module's encoder position. This is a change from the 200 series implementation that also uses the encoder position. The breakpoint commands now also activate the compare output signal which can be enabled with the Output mode for Compare (OC) command. See the discussion of the position compare function below for more details. 8/03/01 Added capture function for MC360 stepper modules. A new command, Capture Begin (CB, code=328) enables the module to capture the step position on each rising edge of the encoder's index input. The values will be stored in the module's recording memory. The CB command parameter sets the number of positions that will be captured before the Position Captured flag (bit 11) is set in the axes' status register and capturing is disabled. Issuing the command with a parameter of 0 or 1 (or no parameter at all), will cause the module to capture 1 position. A parameter of 2 will cause it to capture 2 positions, and so on. Issuing the CB command with a negative parameter will cause the data capture function to be disabled. The captured positions can be retrieved with the Display Recorded (DR, code=213) command. The parameter to this command selects which captured position is displayed. A parameter of 0 will display the first position captured after the CB command was issued, a parameter of 1 will display the second, and so on. Up to 512 positions can be captured in the modules memory. Since the captured positions are moved into the recording memory during the modules motor update, the maximum capture rate is 1 KHz. To determine how many position have been captured, the Capture Get count command (CG, code=329) issued to the axis will cause the number to be stored in the accumulator (user register 0). Once in the accumulator, it can be displayed with the Tell Register command (TR) or used for conditional testing. 8/03/01 Added a position compare function for MC360 stepper modules. This feature extends the existing breakpoint command (WP, WR, IP and IR) capabilities by automatically retrieving pre-programmed compare positions from memory, or calculating new positions at programmed increments. It also provides a high speed output that will be activated when a position compare occurs. To setup for compares at pre-programmed positions, the Load Compare command (LC, code=322) is used to load compare positions into a modules recording memory. The Begin Compare command (BC, code=324) causes the module to take sucessive positions from the memory and load them into a compare register that activates the compare output signal when its' contents match the step position. Up to 512 positions can be loaded into the recording memeory with the LC command. To begin the process, the BC command is issued to an axis with a parameter of -1, this terminates any current compare or breakpoint function, and sets the Load Compare Index to 0. Load Compare commands are then issued to the axis with the parameter set to the desired positions. The LC command can be issued up to 512 times to load the sucessive compare positions. The Begin Compare command is then issued to the axis with the parameter set to the number of compare positions loaded into the module. This causes the module to take the first position from the memory, and load it into the register. When that position is reached, the compare output signal will be activated, and the next position will be taken from the compare memory. This continues until the last compare position is reached. At that time, the Breakpoint flag will be set in the motor's status register. For compare positions to be calculated at incremental distances, use the Load Compare command as described above to set the position of the first comapare, and then issue the Next Compare increment command (NC, code=323) to the axis to set the distance between succeeding compares. To arm the compare for the first position, issue the Begin Compare (BC) to the axis with a parameter of 0. After the motors position equals the first compare position, the parameter to the NC command, which can be positive or negative, will be added to the first compare position to calculate the second. At each compare position the compare output will be activated. This process is repeated at each compare position until the compare function is stopped by issuing the BC command with a parameter of -1. Since the automatic updates for the next compare position is performed as part of the module's motor update routine, the distance between compare positions cannot be such that the time from one compare to the next is less than 1 millisecond. When a compare or breakpoint occurs, the compare output signal is activated. This signal is multiplexed with the Full/Half signal on the module connector. The Output mode for Compare command (OC, code=320) sets how this signal operates. The parameter to this command selects one of the following modes: parameter compare output mode ================================== 0 disabled 1 static 2 toggle 3 one-shot When the mode is set to disabled (the default) the signal operates as the Step Half/Step Full output and can be set high or low by the SH of SF commands respectively. In the static mode, when a breakpoint command is issued (WP, WR, IP or IR), the output will go to the in-active level and remain there until the breakpoint position is reached. When the position is reached the output will go to the active level, and remain there until a succeeding breakpoint command. This output mode should not be used for the compare from memory or compare incremental functions. Selecting the toggle output mode will cause the output to switch between in-active and active levels with each compare or breakpoint position reached. The initial state of the output can be set to in-active by selecting the Disabled mode momentarily, and then setting it back to toggle mode. Reaching the first compare or breakpoint position will cause the output to go to the active level. At the second position or breakpoint, it will switch back to the in-active level, and so on. Selecting the one-shot output mode will cause the compare output to generate an active level pulse of a fixed period at each compare or breakpoint position. The period of the pulse is set by issuing the Output Period command (OP, code=321). The parameter to this command is in units of seconds. The module hardware has a one-shot timer that can generate a pulse period of from 1 microsecond to 1 second. For time periods less then 50 milliseconds the timer has 1 microsecond resolution. For time periods greater than or equal to 50 milliseconds, it has 50 microsecond resolution. With either short or long duration pulses, the output signal is guranteed to go active within the 1/2 microsecond latency of the compare function. The active level of the compare output can be switched by adding a value of 128 to the OC command parameter. For all of the output modes, the compare output will be activated within 1/2 microsecond of the motor reaching the position. To determine how many compares have occured, either from memory or incremental, the Get Compare count command (GC, code=325) is issued to the axis. This will cause the number to be stored in the accumulator (user register 0). Once in the accumulator, it can be displayed with the Tell Register command (TR) or used for conditional testing. 8/9/01 Fixed background task command table to allow execution of recording setup commands DY and RI in background tasks. Also fixed table to prevent display recorded commands DR and DO from being executed in background tasks. 8/9/01 Fixed Limit Mode (LM) command so that limit switch invert bit can be cleared. In previous code invert bit could be set by the command, but not cleared. Changes for Rev. 1.3b =============================================================================== 8/28/01 Fixed contouring mode for MC360 stepper modules. In previous code stepper pulses were not properly enabled in module. Skipped Rev. 1.4 =============================================================================== Changes for Rev. 1.5a =============================================================================== 8/30/01 Modified pulse generator for MC360 stepper module to provide wider frequency range. The frequency range for each speed mode is as follows: Low Speed (LS): .1 steps /sec. to 78,000 steps /sec. Medium Speed (MS): 20 steps /sec. to 625,000 steps /sec. High Speed (HS): 153 steps /sec. to 5,000,000 steps /sec. Operating a stepper motor at speeds near the low end of a range results in higher step rate jitter. Changes for Rev. 1.5b =============================================================================== 9/5/01 Fixed operation of stepper module in velocity mode when a negative user scale is set in order to reverse direction of stepper. In previous code, direction command issued to module didn't take into account direction change caused by negative scale, and motor would move at minimum speed. Changes for Rev. 1.6a =============================================================================== 9/5/01 Changed Tell Status command when issued with a parameter of 34. With new code the controller will dispaly the maximum velocity, acceleration, deceleration, minimum velocity, and current velocity in user units. With previous code the controller displayed values in internal controller units. 9/5/01 Changed Tell Velocity command to report current velocity in user units. Previous code reported values in internal controller units. 9/5/01 Moved DSP code in MC3XX modules that processes data from host motherboard. In previous code, host updates were processed by DSP as part of timer interrupt service routine. In new code, updates are handled by background loop as soon as they are received. This assures that the module processes data from host motherboard during the interval that it was received. In previous code, with a full load of motor modules on board, high numbered stepper axes would not receive data until the following interval. Changes for Rev. 1.6b =============================================================================== 9/19/01 Modified Escape Task command to return error code -20 if task ID is invalid. 9/19/01 Added code to check for valid parameters to digital I/O commands. If parameter specifies a channel that doesn't exist, an error code of -1 will be returned. This indicates a command parameter error. In previous code, a channel command that specified a non-existant channel would cause a processor exception. Changes for Rev. 1.6c =============================================================================== 10/11/01 Implemented single stepping capability in ASCII interface. 10/12/01 Added "AXISNUM" to list of variables that can be accessed with look up command. 10/12/01 Increased maximum number of tasks in SYSTEM.H file to 13. This allows up to 10 background tasks to be created with the Generate Task command. 10/12/01 Modified position dead band display (LU"DBAND" and TS34) as user unit instead of encoder counts. 10/12/01 Changed discription of SFREQ variable to "Derivative Term Sampling Frequency". Changes for Rev. 2.0a =============================================================================== 8/16/01 Changed function of motherboard LED's. When the board is brought out of reset, the LED's are used by the boot loader to display status. After the driver loads and starts the motion firmware, each LED is associated with the respective numbered module position. During initiaization of a motor module the respective LED will be turned on. If the module initialization fails, the motherboard processor will be stalled and the LED will indicate which module is faulty. After initialization, the LED's will not be used unless an axis is reset (this reinitializes the module). Note that the motherboard LED's will no longer be used to indicate motor errors such as limit switch tripped. 8/16/01 Added support for MC362 Dual Axis Stepper Module. 10/4/01 Added ADCIN1 and ADCIN2 to list of motor table variables for Lookup command. These variables hold the readings of the analog inputs on the MC300/320/360 modules. Changes for Rev. 2.0a ET =============================================================================== 11/02/01 Added MC302 dual axis servo module control code. Removed the following on MC302: 1. Auxiliary encoder (AF, AT, AZ, AH, AX, GX) 2. Capture and compare (BC, LC, CB, NC, CG, GC, OC, OP) 3. IIR filter (YF, NF, GF, ZF, FL) 4. Amplifier fault detection (FN, FF) 5. Unipolar output mode (OM) due to hardware DIRNENA and DIRNOUT are not supported anymore. 12/13/01 Add a variable for backlash compensation distance in user unit in motor.h. Modified the LU table to display the backlash in user unit rather than in counts to be consistent with others. Changed LU"Backlash" from 32 bits int to double format. 01/09/02 Modified RT() to support dual axis. Whenever reset command is issued for one axis, the partner axis on the same module will also be reset due to both axes are on the same DSP and FPGA that need to be reset at the same time. Although the setting is based on the logical axis, the partner axis is based the logical axis corresponding to its physical partner axis. The last module has only one axis. 01/14/02 Modified UP() to support dual axis. Whenever free axis xUP command is issued for one axis, the partner axis on the same module will also be freed. Although the setting is based on the logical axis, the partner axis is based the logical axis corresponding to its physical partner axis. The last module only has one axis. xUPx can reassign any axis without considering its partner axis. Changes for Rev. 2.1a ET =============================================================================== 01/23/02 Added array moduledual[] for storing module location at power up. It is used to check whether the axis is already physically assigned in UP command. This solves the problem when single and dual modules are mixed on the same board which makes the module location difficult to calculate. 01/25/02 Modified the following error to be monitored for closed loop stepper only. Set default to 1024. 01/25/02 Added a new MCCL command ES-encoder scaling for closed loop stepper. It allows users to specify the (pulse/sec)/(encoder counts/sec) of their system. The variable name is ENCSCALE which will be part of the LU command as "double" format. It is used to calculate the velocity feedfoward gain for closed loop. The scaled velocity gain is updated whenever sending HS, MS, LS, IM or ES commands. It is stored in the motor variable "velgain" which can be seen by LU command in double format. The reported velocity gain by TK or LU"kvel" commands will be the calibrated value same as for open loop based on different pulse rate. User can modify the velocity gain by issuing VG command. It will be overwritten back to the calibrated values once HS, MS, LS, IM or ES command is issued again or when the controller is reset. Added missing MCCL commands in HE table. 01/28/02 Changed default settings for stepper to be same as AT300: Velocity from 1000 to 10000 Minimum velocity from 0 to 1000 01/28/02 Added phasing command for closed loop. PH will not have any effect on open loop. Issuing phase command in open loop will report an error. 01/30/02 Homing command changes: 1. Added closed loop stepper homing commands FI,IA and WI. Similar to servo, it is for encoder position counter and index. 2. Added new command EL (edge latch) and modified WE to match FE for open loop stepper homing commands. It is for pulse counter and home input. Removed the code for pulse counter and home input from IA and WI. Keep WE old function wait for coarse input status for servo, or closed loop steppers. 3. Modified motor status bit as following: MCCL Command Motor Status Bit ------------------------------------------------------------------------- FI, IA, WI Bit 8 MTRLFI (looking for index) Bit 10 MTRIXF (index or edge found) Bit 6 MTRHMD (motor homed) Servo Bit 24 MTRIDX (index or home input status or latch) Stepper Bit 27 MTRAEI (Aux. encoder index status or latch) ------------------------------------------------------------------------- FE, EL, WA Bit 9 MTRLFE (looking for edge) Bit 10 MTRIXF (index or edge found) Bit 6 MTRHMD (motor homed) Bit 24 MTRIDX (index or home input status or latch) ------------------------------------------------------------------------- Sequence of these bits are: At the start of FI,IA or FE,EL, the corresponding bit 8 or 9 will be set. Bit 10, 6 and 24 or 27 will be reset. Once the index or home input is made, bit 8 or 9 will be reset. Bit 10, 24 or 27 will be set. The index or pulse counter will be captured on DSP. At the end of FI, WI or FE, WA, bit 6 will be set. The index or pulse counter on the motherboard will be updated. User has to issue MN to update the actual motor position based on the captured index or pulse counter. Bit 24 or Bit 27 will be latched once FI, IA or FE, EL is issued. Anytime after issuing MF and MN, or reset controller, they will report the actual status of the corresponding inputs rather than latched. 4. Added new error code -21 CMD_NOT_APPLICABLE. With open loop stepper, issuing FI, IA and WI will report the error. With closed loop stepper, issuing FE, EL, WE, or any auxiliary encoder related commands AT, AH, AF, AZ, GX and AX will also report the error. 01/31/02 Added reporting error CMD_NOT_APPLICABLE for all commands that do not apply to certain modules or module with certain mode such as open or closed loop stepper. 02/01/02 Added a separate set of PID parameters for open loop stepper. It will be initialized at power up, reset or when switching from closed loop to open loop. It is transparent to users unless in a special mode. The displays of PID parameters are for closed loop ones. Also added set default PID values for closed loop stepper. For MC362, the displays will be zero since there is no closed loop on MC362. Open loop Closed loop Proportional gain: 0.001 0.0001 Integral gain: 0 0 Integration limit: 0 0 Derivative gain: 100 100 Derivative sampling frequency: 0 0 Added a special mode to allow changing of PID parameters of open loop stepper for development purpose. IM128 is used for both MC360 or MC362. Auxiliary status bit 15 MTRPIDE (PID enable) will be set. Under this mode, the displays by TG, TI, TD and TL will be for open loop ones. While the PID parameter variables through LU command will still display for closed loop ones. 02/07/02 Modified maximum following error on open loop stepper to be handled same as PID parameters. Instead of ignoring it in open loop, one can set it if it is in PID enable mode. Under this mode, the display by TS34 will be for the open loop maximum following error. The display from LU"maxerror" command will always be for the closed loop one. On MC362, it displays zero all the time. The default for open loop is set to zero. The default for closed loop is set to 1024. 02/08/02 Added integral option to open loop stepper which is handled same as PID parameters. Integral option is avaible also in open loop only if it is in PID enable mode. The display from LU"integralopt" command will always be for the closed loop one. On MC362, it displays zero all the time. Fixed integral option for stepper to pass trajectory generator complete bit to DSP to start integral for option 1 & 2. It was using trajectory complete which will not be high until actual position passed the target. 02/12/02 Removed command SQ, TQ for stepper MC360 & MC362. 02/19/02 Fixed an intermittent problem in velocity mode with Go command after limit switch is tripped. If Go command is issued after wait for stop without any delay, it may not move due to uncleared stopping flag. 02/20/02 Added index/edge found bit in TS32. Display text of index or home input corresponding to servo or stepper. 2/22/01 Added motor on bit in DSP and module status. It will be passed to the host to acknowledge the module motor on/off status. This is to ensure that the motor off and motor on command is completed after both host and module have processed the command. It will eliminate the need of adding a short delay in between MF, MN or after MN command in the application program for the command to be executed properly. Changed motor table data structure to be volatile to force compiler to generate correct code of reading updated motor table when interrupt is enabled. Changes for Rev. 2.2a ET =============================================================================== 2/28/02 Built to include MC302 FPGA configure code to support MC302 hardware. 3/07/02 Set trajectory complete bit in position mode after stepper is stopped by limit switch tripped with Abrupt option or by AB command. This will also ensure that wait for stop works under this situation. 3/08/02 Modified motor on complete condition to consider if an error that stops motor still presents while a motor on command is issued. It will not wait for the module motor on status since the motor is turned off again by the error. Same change applied to motor off in case motor is turned off again by other tasks. 3/14/02 Modified S-curve and Parabolic profile to limit profile position to target. This fixes a problem that in contour mode after a move of zero distance is issued, the next move goes beyond the end of motion table because of the index was updated incorrectly. 3/20/02 Modified contour path control not to change velocity if velocity profile is S-curve or Parabolic. Changed the motion block index logic to adjust the index to handle motion blocks that have move of zero. 3/20/02 Added the following variable to LU table: PRFVEL = Profile Generator Velocity (double) MTNIDX = Contour Motion Index (u.integer) MTNFILL = Contour Motion Fill Index (u.integer) TGTMTN = Contour Motion Target (u.integer) 3/21/02 With Trapezoidal profile in contour mode, when set initial maximum velocity, do not multiply it by velocity override. Different from S-curve and Parabolic profile, velocity can be changed on the fly and will be updated by trapezoidal profile and contour path generator. 3/22/02 When contour index is above 256, point table memory overlapped with code memory due to the expended motor table to support dual axes. It will trip the watchdog at address 0x80030714 when escape from a macro sequence that has repeated contour motion. Moved motion table out of linkcmds and declared in init.c to have it in the cached memory rather than uncached. Increased point table size in linkcmds from 0x4000 to 0x8000 to support dual axes. Modified macro mtn_entry define. It was one axis off which left a gap in the motion table. 3/26/02 Modified motor_update_service() to consolidate code to reduce the code size. Changes for Rev. 2.2b ET =============================================================================== 3/28/02 Moved the code to signal all modules for loop synchronization to init.c before the rtems motor_update_task is resumed. It will provide more stable interrupt for module PID loop. It has less effect by the time variation of the code runs due to the code runs from cached or uncached memory. Changes for Rev. 3.0a ET =============================================================================== 5/10/02 Built rev2.2b with RTEMS-4.5.0. 5/17/02 Added copyright header to all DSP source files. Added auto dsp build using command line instead of IDE. Changes for Rev. 3.1a BR =============================================================================== 9/7/05 Removed prototype code from source and build trees. Source was in rtems/rtems-4.5.0/c/src/appl/dcx sub-directory. 9/7/05 Removed DCX-PCI100 code from source and build trees. Source was in rtems/rtems-4.5.0/c/src/appl/dcxpci100 sub-directory. 9/7/05 Converted all PMC source code files from DOS to UNIX format. 9/7/07 Modified build script so that it copies and converts the latest MC3XX module FPGA configuration files. The FPGA tools create Intel hex files that must be converted to assembly source files that are built into the motherboard firmware. 9/7/05 Modified FPGA configuration for MC320 module to provide capability to read the prescaler and angle registers in the commutation circuit. Use the 1GW10,TR to read the prescaler register on axis 1. The prescaler increments or decrements the commutation angle every time bit 15 changes state. Use 1GW15,TR to read the commutation angle register. This 16 bit register tracks the commutation angle (65536 equals 360 degrees). 9/7/05 Changed FPGA configuration for MC320 module to correct commutation prescaler circuit. In previous design, direction signal from prescaler was out of sync (delayd by one clock) with count signal. This caused commutation to be corrupted during operation. Also added reset signal to clear prescaler summing register when constant value is written to prescaler. This will allow consistent initialization of commutation. With previous design, prescaler summing register was only cleared when the board or module was reset. If circuit is not reset, prescaler can output the first pulse at an inconsistent position. Changes for Rev. 3.2a BR =============================================================================== 2/14/06 Fixed calculation of feed-forward term for slave axes. This required adding a new variable called Current Speed (curspd) to motor table. In previous code, sign of feed-forward term was not correct for slave axes in contour mode. Current velocity is now a signed value that indicates current direction of travel. 2/14/06 Added code to zero Curacc motor table variable in Motor On command. This was done for consistancy in code. End of Revision History