DCX-VM300 Firmware Revision History Precision Microcontrol Corporation Note: For first release of DCX-VM300 Firmware, code was taken from DCX-VM200 Rev. 3.4a and DCX-AT300 Rev. 0.7a. See respective revision histories for details regarding code at those revision level. Changes for DCX-VM300 Ver. PM1 Rev. 0.8a ======================================================================= 3/16/99 Restructured firmware build process so that source code files common to both DCX-AT300 and DCX-VM300 are truly shared. Common files are now kept in a directory named \PMC\DCX\S300\PM1. Changes for DCX-VM300 Ver. PM1 Rev. 0.9a ======================================================================= 4/19/99 Removed rounding of velocity feed-forward voltage to integer value. The rounding was mistakenly left from series 200 implementation that sent DAC adjustment to modules in DAC units (integers). Series 300 implementation sends the DAC adjustment in volt units (floats). 4/30/99 Added support for MC360 stepper module. Changes for DCX-VM300 Ver. PM1 Rev. 1.0a ======================================================================= 5/11/99 Fixed interpolation calculation of optimal position on MC360. 5/19/99 Implemented improved synchronization between MC300/360 modules using DSP Host Port Interrupts. This eliminates intermittant output glitches caused by missed update interrupts on DSP. 5/20/99 Adjusted MC360 DSP code and FPGA configuration so stepper output pulses stay at inactive levels during reset and initialization. Changes for DCX-VM300 Ver. PM1 Rev. 1.1a ======================================================================= 6/25/99 Modified FPGA configurations on MC300 and MC360 modules to update DAC with 5MHz shift clock. Previous configurations were running with 1MHz clocks. This caused unnecessary delays in updating DACs. 6/25/99 Changed format of data written to MC300 DAC register in FPGA from offset binary to 2's complement. FPGA is configured to change data to correct format for DAC. This allows same module code to be used for other output configurations where FPGA converts value written into register into whatever format required for output circuit. 6/25/99 Fixed Define Home command in MC300 and MC360 module code. Previous code didn't zero host update command position values. This caused following error to be exceeded on next PID update. 6/25/99 Fixed derivative term calculation in MC300 and MC360 module code. Previous code didn't calculate the derivative term correctly when the sampling frequency setting (FR command) was greater than zero. Changes for DCX-VM300 Ver. PM1 Rev. 1.2a ======================================================================= 6/29/99 Implemented data recording Delay (DY, code = 190) and data recording Interval (RI, code = 191) commands. Both commands can be issued to one or all axes, and take parameters in units of seconds. The recording delay command sets the time period that the module will wait after the data recording command is issued before starting to record data. The recording interval command sets the time period between each sample of data on the module. Both the delay and interval are rounded to the nearest PID update period. 6/29/99 Fixed Define Home command. Previous code didn't zero host update current position value. This caused problem if user issued DH,MF,MN command sequence. Motherboard might read old position from module, and then send it to module as command position after executing MN command. Changes for DCX-VM300 Ver. PM1 Rev. 1.3a ======================================================================= 7/9/99 Added Convert to Integer to Accumulator eValuate command (use parameter 25). This operation converts the contents of the accumulator to an integer. 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). 8/11/99 Added capture function for MC300 servo modules. A new command, Capture Begin (CB, code=328) enables the module to capture the primary encoder's position on each rising edge of the auxiliary 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 servo's PID loop update, the maximum capture rates are 2 KHz, 4KHz, or 8 KHz for the Low Speed, Medium Speed, and High Speed modes respectively. 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/13/99 Changed MC300 logic so that breakpoint commands (WP,WR,IP & IR) activate module's Direction output. This optically isolated output will now be called "Compare". Alternatively, if the Output Mode command is issued to select Unipolar Output mode, the Compare output will change to a Direction signal output. In this case, no Compare output signal is available. 8/13/99 Added a position compare function for MC300 servo 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 primary encoder 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 the motor update period. This is 125, 250, or 500 microseconds for the high speed, medium speed, or low speed modes respectively. When the compare output is activated as the result of a compare or breakpoint occurance, the compare output signal will react according to the which mode has been selected with the Output mode for Compare command (OC, code=320). The parameter to this command selects one of the following modes: parameter compare output mode ================================== 0 disabled 1 static 2 toggle 3 one-shot The active level of the 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 encoder reaching the position. The optical isolator on the compare output signal takes an additional 2 to 3 microseconds to turn on depending on the load circuit. This optical isolator will take about 50 microseconds to turn off. This also depends on the load. When the compare output mode is set to Disabled, the output will be at its' in-active level. The controller sets the output mode to Disabled on power up or reset. 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 (not counting the delay for the optical isolator). 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. Changes for DCX-VM300 Ver. PM1 Rev. 1.4a ======================================================================= 10/19/99 Inverted direction singnal output of MC360 module. This was done to make its' operation consistent with MC260. Signal will remain inactive during calibration cycle after reset. This change required modifications to MC360 DSP code and FPGA configuration. Changes for DCX-VM300 Ver. PM1 Rev. 1.5a ======================================================================= 2/10/00 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. 2/10/00 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. 2/10/00 Recorded current profile mode in auxiliary status bits 28, 29 and 30. If Trapezoidal Profile is selected with PT command, bit 28 will be set. If S-Curve Profile is selected with PS command, bit 29 will be set. If Parabolic Profile is selected with PP command, bit 30 will be set. 2/10/00 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 2/10/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 Changes for DCX-VM300 Ver. PM1 Rev. 2.0a Note: This version of code will not fit in DCX-VM board with 1 Meg (29F010) flash devices. To support the current and planned future modules, the DCX-VM300 will be spec'd to have 4 Meg (29F040) flash devices. ======================================================================= 2/17/00 Implemented change to 4 Megabit Flash memory devices. This was done so that additional 300 series modules could be supported. Starting address of code was moved from C0000 hex to 100000 hex in linker command file DCXVM3.CMD. Also changed BEGROM constant in ENTRY.SRC to $100000, and FLASHBASE constant in DCXVM3.H to 0x100000. Had to create a new version of boot loader code that programs first 4k of code into 100000-100FFF range, and allows programming of code above 100000 address. Changes are in file SRECORD.C. This new loader was created in FLASH4M subdirectory, and named BOOT4M.ABS. 2/22/00 Added support for MC320 servo module wwhich has on-board sinusoidal commutation. Added following commands for commutation setup: LE - LOAD COMMUTATION ENCODER PRESCALE CONSTANT (code=332) LD - LOAD COMMUTATION ENCODER DIVISOR CONSTANT (code=333) LR - LOAD COMMUTATION ENCODER REPEAT COUNT (code=334) LA - LOAD COMMUTATION PHASE SHIFT A (code=330) LB - LOAD COMMUTATION PHASE SHIFT B (code=331) Each of these commands requires an axis specifier when they are issued. The LE command takes an integer parameter between 0 and 255. This command is used to set the constant for a prescaler on the module's encoder input. The prescaler divides down the encoder signal that drives the commutation circuit. The Encoder Prescale Constant (EPC) is used in the following formula to calculate the encoder counts driving the commutation circuit: encoder edges * (EPC / 256) = encoder counts Common EPC values are listed in the following table: EPC Divisor ======================== 256 1 128 2 64 4 32 8 16 16 8 32 4 64 2 128 1 256 In systems with high resolution encoders, the prescaler constant should be set so that the Encoder Divisor Constant (Set with the LD command) is in the range of 4000 to 65535. The LD command takes an integer parameter between 0 and 65535. This command sets the Encoder Divisor Constant (EDC) used in the commutation circuit. The following formula is used to calculate the proper EDC value: EDC = 16777216 / encoder counts per commutation cycle (after prescaling) A 3 pole motor requires 3 commutation cycles per rotaion, so the encoder counts per commutation cycle is equal to the encoder counts per rotation, divided by the encoder prescaler divisor, divided by 3: ECPCC = encoder counts per rotation / encoder prescaler divisor /3 The LR command takes an integer parameter between 0 and 65535. It is used to set the number of encoder counts (after prescaling) for one rotation of the motor. The commutation circuit will reset its' position counter each time the motor completes one rotation. This prevents the accumulation of error caused by truncation of the Encoder Divisor Constant to an integer. The LA and LB commands take floating point parameters that are in units of degrees (either positive or negative). These commands set the phase shifts for the module's analog output signals. The output voltage of the module's analog command signals is determined by the formulas: Output A = sin(((encoder counts / counts per cycle) * 360) + phase shift A) Output B = sin(((encoder counts / counts per cycle) * 360) + phase shift B) The setting of these phase shift values is determined by the position of the motor when the encoder is initialized by power on or reset. For a 3 phase motor, the A abd B phase shift values will always be 120 degrees apart. On the MC320, the auxiliary encoder has been removed from the FPGA configuration. To facilitate the use of hall effect sensors in the motor to initialize commutation, the auxiliary encoder module inputs A, B and Z have been connected to the motor status User Input 1, User Input 2 and Auxiliary index bits. 3/2/00 Added additional error checking and message displays while initializing modules. Initialized reply_file variable before calling initialize_modules() so error messages can be displayed. Changes for DCX-VM300 Ver. PM1 Rev. 2.1a ======================================================================= 10/27/00 Modified MC300 and MC360 module code to sense whether analog to digital converter is installed on module. If not, analog inputs will not be read and motor table values will remain fixed at 0. ======================================================================= CHANGE REVISION LEVEL IN VERSION COMMAND IN MISCCMD.C ======================================================================= End of revision history