Bootstrak Skip to main content

4. Operation

Streszczenie: Obsługa napędu przez ASCII: ustawianie prędkości transmisji, limitów i wzmocnień pętli prądowej, prędkościowej i pozycyjnej oraz filtrów, monitorowanie rejestrów statusu (0xa0), trajektorii (0xc9) i błędów (0xa4), odczyt zmiennych bieżących oraz odczyt wejść i ustawianie wyjść cyfrowych.
EN: Operation: baud rate, loop limits and gains, filters, status/trajectory/fault registers, run-time variables, digital inputs and outputs.

Dotyczy: serwonapędy Copley Controls z interfejsem ASCII (RS-232, sieć multi-drop CAN), program CME 2
Źródło: dokumentacja producenta (Copley Controls ASCII Interface Programmer’s Guide); tabele przepisane z obrazów na tekst – opracowanie Multiprojekt

This chapter describes the variables involved in basic operation of the amplifier. Contents include: 

4.1 Setting the Baud Rate

Variable 0x90 (R) controls the amplifier’s serial port baud rate. To change the baud rate, write the new value to 0x90. For instance, to change the value to 19200 send: s r0x90 19200. The amplifier will respond with an “ok” if the command is successful but it will be sent at the new baud rate.

After the carriage return of the s command, no other characters should be sent at 9600 (by default, some programs automatically append a line feed). If more characters are sent at 9600, they may be misinterpreted as a break command and cause the amplifier to change back to 9600 baud. There should also be a delay of 100 mSec minimum before characters at the new baud rate are sent to the amplifier.

When reading variable 0x90, note that the value received may not be the exact value set. This is because the amplifier sets the baud rate as close to the requested baud rate as possible given the internal clock frequencies of the amplifier’s microprocessor.

4.2 Setting Limits and Gains

This section describes the variables used to set control loop limits and gains.

4.2.1 Current Loop Limits and Gains

Current Loop Limits Variables

Variable IDBankDescription
0x21R FPeak current limit. Units: 0.01 A.
0x23R FI²T time limit. Units: mS.
0x22R FContinuous current limit. Units: 0.01 A.
0xaeR FCurrent loop offset. Units: 0.01 A.
Original image of the table (from the PDF manual)

Original table image: Current Loop Limits Variables

Current Loop Gains Variables

Variable IDBankDescription
0x00R FCurrent loop proportional gain (Cp).
0x01R FCurrent loop integral gain (Ci).
Original image of the table (from the PDF manual)

Original table image: Current Loop Gains Variables

4.2.2 Velocity Loop Limits and Gains

Velocity Loop Limits Variables

Variable IDBankDescription
0x3aR FVelocity loop velocity limit. Units: 0.01 counts/second.
0x36R FVelocity loop acceleration limit. Units: 1000 counts/second².
0x37R FVelocity loop deceleration Limit. Units: 1000 counts/second².
0xcfR FFast Stop Ramp. Units: 10 counts/second².
Original image of the table (from the PDF manual)

Original table image: Velocity Loop Limits Variables

Velocity Loop Gains Variables

Variable IDBankDescription
0x27R FVelocity loop proportional gain (Vp).
0x28R FVelocity loop integral gain (Vi).
Original image of the table (from the PDF manual)

Original table image: Velocity Loop Gains Variables

4.2.3 Position Loop Gains

Position loop limits are described in Position Mode (p. 29).

Position Loop Gains Variables

Variable IDBankDescription
0x30R FPp - Position loop proportional gain.
0x33R FVff - Velocity feed forward.
0x34R FAff - Acceleration feed forward.
0xe3R FPosition loop gain multiplier. 100 equals a factor of 1.
Original image of the table (from the PDF manual)

Original table image: Position Loop Gains Variables

4.2.4 Filters

Velocity Loop Filters Variables

Variable IDBankDescription
0x6bR FVelocity loop command filter co-efficients.
0x5fR FVelocity loop output filter co-efficients.
Original image of the table (from the PDF manual)

Original table image: Velocity Loop Filters Variables

Velocity Loops Filters Usage Notes

The velocity loop command and output filters should be set up using CME 2. If it is required that the filters be changed during operation, the following procedure should be used to determine the new filter co-efficients.

1 Set the filter up using CME 2.

     1 On the CME 2 Main screen, click V Loop.

     2 On the Velocity Loop screen, click Command Filter or Output Filter as desired.

     3 On the Filter screen, choose the filter type, set the parameters, click Apply and then click Close.

2 Use the CME 2 ASCII command line tool (Tools->ASCII Command Line) to read the updated variable. For instance, to read the command filter variable:

CommandResponse
g r0x6Bv -7936 200 0 775 1550 775 -12774 32763 5813
Original image of the table (from the PDF manual)

Original table image: Setting Limits and Gains › Filters › Velocity Loops Filters Usage Notes

3 Write program instructions to update the appropriate variable with those values. For instance, to write the command filter variable: 

CommandResponse
s r0x6B -7936 200 0 775 1550 775 -12774 32763 5813ok
Original image of the table (from the PDF manual)

Original table image: Setting Limits and Gains › Filters › Velocity Loops Filters Usage Notes

4.3 Monitoring Status

Status Register Variable (0xa0)

The status register variable (0xa0) provides amplifier status information. 0xa0 is read-only, and available in RAM only (not Flash). Bit mapped values described below: 

BitsDescription
0Short circuit detected.
1Amplifier over temperature.
2Over voltage.
3Under voltage.
4Motor temperature sensor active.
5Feedback error.
6Motor phasing error.
7Current output limited.
8Voltage output limited.
9Positive limit switch active.
10Negative limit switch active.
11Enable input not active.
12Amplifier is disabled by software.
13Trying to stop motor.
14Motor brake activated.
15PWM outputs disabled.
16Positive software limit condition.
17Negative software limit condition.
18Tracking error.
19Tracking warning.
20Amplifier has been reset.
21Position has wrapped. The Position variable cannot increase indefinitely. After reaching a certain value the variable rolls back. This type of counting is called position wrapping or modulo count. Note that this bit is only active as the position wraps.
22Amplifier fault. An amplifier fault that was configured as latching has occurred. For information on latching faults, see the CME 2 User Guide.
23Velocity limit has been reached.
24Acceleration limit has been reached.
25Position outside of tracking window.
26Home switch is active.
27Set if trajectory is running or motor has not yet settled into position (within Position Tracking Error Limit) at the end of the move. Once the position has settled, the in motion bit won’t be set until the next move starts.
28Velocity window. Set if the absolute velocity error exceeds the velocity window value.
29Phase not yet initialized. If the amplifier is phasing with no Halls, this bit is set until the amplifier has initialized its phase.
30Command fault. PWM or other command signal not present.
31Not defined.
Original image of the table (from the PDF manual)

Original table image: Monitoring Status › Status Register Variable (0xa0)

Trajectory Register Variable (0xc9)

The trajectory register variable (0xc9) provides trajectory generator status information. 0xc9 is read-only, and available in RAM only (not Flash). Bit mapped values described below:

BitDescription
0-8, 10Reserved for future use.
9Cam table underflow.
11Homing error. If set, an error occurred in the last home attempt. Cleared by a home command.
12Referenced. Set when a homing command has been successfully executed. Cleared by a home command.
13Homing. If set, the amplifier is running a home command.
14Set when a move is aborted. Cleared at the start of the next move.
15In-Motion Bit. If set, the trajectory generator is presently generating a profile.
Original image of the table (from the PDF manual)

Original table image: Monitoring Status › Trajectory Register Variable (0xc9)

Fault Register Variable (0xa4)

The fault register variable (0xa4) shows latching faults that have occurred. 0xa4 is available in RAM only (not Flash).

Bit mapped values described below: 

BitFault Description
0Data flash CRC failure. This fault is considered fatal and cannot be cleared.
1Amplifier internal error. This fault is considered fatal and cannot be cleared.
2Short circuit.
3Amplifier over temperature.
4Motor over temperature.
5Over voltage.
6Under voltage.
7Feedback fault.
8Phasing error.
9Following error.
10Over Current (Latched).
11FPGA failure. This fault is considered fatal and cannot usually be cleared. If this fault occurred after a firmware download, repeating the download may clear this fault.
12Command input lost.
13-31Reserved.
Original image of the table (from the PDF manual)

Original table image: Monitoring Status › Fault Register Variable (0xa4)

Note that when a latching fault has occurred, bit 22 of the status register (0xa0) is set.

To clear a fault condition, write a 1 to the associated bit of the fault register (0xa4). 

4.4 Reading Run Time Variables

This section describes the variables used to monitor run time conditions.

Current Loop Run Time Variables

Variable IDBankDescription
0x15RCommanded current. Units: 0.01 A.
0x0cRActual current. Units: 0.01 A.
0x25RLimited current. Units: 0.01 A.
Original image of the table (from the PDF manual)

Original table image: Current Loop Run Time Variables

Velocity Loop Run Time Variables

Variable IDBankDescription
0x2cRCommanded velocity. Units: 0.1 counts/second.
0x29RLimited velocity. Units: 0.1 counts/second.
0x18RActual motor velocity. Units: 0.1 counts/second.
0x5eRActual load velocity. Units: 0.1 counts/second.
0x2aRVelocity loop error. Units: 0.1 counts/second.
Original image of the table (from the PDF manual)

Original table image: Velocity Loop Run Time Variables

Position Loop Run Time Variables

Variable IDBankDescription
0x32RMotor position. Units: counts.
0x17RLoad position. Units: counts.
0x35RFollowing Error. Units: counts.
Original image of the table (from the PDF manual)

Original table image: Position Loop Run Time Variables

Position Loop Inputs from the Trajectory Generator (Variables)

Variable IDBankDescription
0x3dRCommanded position. Units: counts.
0x2dRLimited position. Units: counts.
0x3bRProfile velocity. Units: 0.1 counts/second.
0x3cRProfile acceleration. Units: 10 counts/second².
Original image of the table (from the PDF manual)

Original table image: Position Loop Inputs from the Trajectory Generator (Variables)

Miscellaneous System Variables

Variable IDBankDescription
0x1dRAnalog input voltage. Units: mV.
0x1bRSin input voltage. Units: mV.
0x1cRCos input voltage. Units: mV.
0x1eRBus voltage. Units: 100 mV.
0x20RAmplifier temperature. Units: degrees C.
0xb0RPhase angle. Units: degrees.
Original image of the table (from the PDF manual)

Original table image: Miscellaneous System Variables

4.5 Reading Digital Inputs

Input States Variable (0xa6)

The high/low states of the amplifier’s programmable digital inputs can be read using variable 0xa6. Each bit represents an input number as shown below. If an input is high, the corresponding bit is set to 1. If the input is low, the corresponding bit is set to 0.

For instance, if the value of 0xa6 is 33, the binary equivalent is 100001, showing that IN1 and IN6 are high and the other inputs are low.

0xa6 is read-only, and available in RAM only (not Flash). Bit mapped values described below.

NOTE: The number of programmable digital inputs varies depending on amplifier model. See the amplifier documentation. 

Digital inputs – bit mapping

BitInput
0Digital Input 1
1Digital Input 2
2Digital Input 3
3Digital Input 4
4Digital Input 5
5Digital Input 6
6Digital Input 7
7Digital Input 8
8Digital Input 9 (the source table shows "Digital Input 8" – a typo)
9Digital Input 10
10Digital Input 11
11Digital Input 12
12Digital Input 13
13Digital Input 14
14Digital Input 15
15Digital Input 16
Original image of the table (from the PDF manual)

Original table image: Digital inputs – bit mapping

4.6 Reading/Setting Digital Outputs

The amplifiers digital outputs can be programmed by CME 2 to reflect the state of any one or more of the amplifier’s event status register bits. The outputs can also be configured so their state can be set by the controller program.

The external controller, through the Output State variable, can set an output inactive or active. The actual level of the output pin however is determined by the Output Configuration variable. This variable sets the actual output pin to be high or low when active. When the amplifier powers up or is reset, all outputs are initially inactive. To ensure that outputs are high, or off, after power up or reset, they should be configured as active low.

Configuring Outputs (0x70 – 0x77)

Before a controller program can set an output pin’s active/inactive state, the output must be configured for program control. This is done by setting the appropriate bits in the output’s configuration variable.

The output configuration variables start with 0x70 for Output 1 and run to 0x77 for Output 8, as described below. These variables require two values be sent with Set (s) command.

NOTE: The number of programmable digital inputs varies depending on amplifier mode. See the amplifier documentation

Output configuration variables

Variable IDMemory BankDescription
0x70RFOutput 1 Configuration: 258 0 = Program Control, Active High; 2 0 = Program Control, Active Low.
0x71RFOutput 2 Configuration. Same as Output 1.
0x72 – 0x77RFOutput 3 through 8 Configuration. Same as Output 1.
Original image of the table (from the PDF manual)

Original table image: Output configuration variables

Setting Output States (0xab)

Writing the variable 0xab sets the active/inactive states of digital outputs that have been configured for program control. Each bit represents an output number as shown below. A bit value of 1 corresponds to an active output. A bit value of 0 corresponds to an inactive output.

Writing a 1 or 0 to an output that has not been configured for program control will have no effect on the output.

NOTE: The number of programmable digital outputs varies depending on amplifier model. See the amplifier documentation. 

Digital outputs – bit mapping

BitOutput
0Digital Output 1
1Digital Output 2
……
7Digital Output 8
Original image of the table (from the PDF manual)

Original table image: Digital outputs – bit mapping

Reading Output States (0xab)

Reading 0xab gets the active/inactive states of all the amplifier’s digital outputs, including those which are not set to program control. 

Reading/Setting Output Example

The controller configures 2 outputs for program control, reads the state of the outputs, and then sets an output low. 

CommandResponseComment
s r0x72 258 0okConfigures output 3 to program control, active low.
s r0x73 258 0okConfigures output 4 to program control, active low.
g r0xabv 10Reads the state of the outputs. Example returns a value of 10. Converting this value to binary equals 1010 which indicates outputs 2 and 4 are active.
s r0xab 4ok4 converted to binary equals 0100. This value will set Output 4 inactive and Output 3 active. Outputs 4 and 3 have been programmed active low so Output 4 will be high and 3 will be low. Since Outputs 1 and 2 are not under program control, they will not change state.
Original image of the table (from the PDF manual)

Original table image: Reading/Setting Digital Outputs › Reading/Setting Output Example

Słowa kluczowe

baud rate, prędkość transmisji, limity prądu, peak current, I2T, wzmocnienia pętli, Cp, Ci, Vp, Vi, Pp, Vff, Aff, filtry, rejestr statusu, 0xa0, 0xc9, rejestr błędów, 0xa4, zmienne bieżące, wejścia cyfrowe, 0xa6, wyjścia cyfrowe, 0xab, 0x70