Copley Controls ASCII Programmers Guide

User Manual: ASCII ProgrammersGuide

Open the PDF directly: View PDF PDF.
Page Count: 67

DownloadCopley Controls ASCII Programmers Guide
Open PDF In BrowserView PDF
ASCII Programmer’s Guide

PN/ 16-01196
Revision 01
April 2015

TABLE OF CONTENTS
About This Manual .................................................................................................................................... 3
1:

Introduction .............................................................................................................................................................. 6

1.1: The Copley ASCII Interface ............................................................................................................... 7
1.2: Communication Protocol .................................................................................................................... 7
2:

Command Set........................................................................................................................................................... 8

2.1: Command Format .............................................................................................................................. 9
2.2: Set Command (s) ............................................................................................................................. 10
2.3: Get Command (g)............................................................................................................................. 11
2.4: Copy Command (c) .......................................................................................................................... 12
2.5: Reset Drive Command (r) ................................................................................................................ 13
2.6: Trajectory Generator Command (t) .................................................................................................. 14
2.7: Register Read and Write Command (i) ............................................................................................ 16
2.8: Clear Encoder Faults Command ...................................................................................................... 17
3:

Operating Modes ................................................................................................................................................... 18

3.1: Desired State Parameter .................................................................................................................. 19
3.2: Current Mode ................................................................................................................................... 20
3.3: Velocity Mode ................................................................................................................................... 24
3.4: Position Mode ................................................................................................................................... 28
4:

Operation ................................................................................................................................................................ 41

4.1: Setting the Baud Rate ...................................................................................................................... 42
4.2: Setting Limits and Gains .................................................................................................................. 42
4.3: Monitoring Status ............................................................................................................................. 46
4.4: Reading Run Time Parameters........................................................................................................ 50
4.5: Reading Digital Inputs ...................................................................................................................... 51
4.6: Reading/Setting Digital Outputs ....................................................................................................... 52
5:

Quick Reference to the Parameters ..................................................................................................................... 54

5.1: Parameters by Function ................................................................................................................... 55
6:
7:

CME 2 ASCII Command Line Tool ........................................................................................................................ 60
Serial and Multi-Drop Connection ........................................................................................................................ 62

7.1: Connecting ....................................................................................................................................... 63
A:

Error Codes ............................................................................................................................................................ 65

Copley Controls

2

About This Manual
Overview and Scope
This manual describes Copley ASCII Interface developed by Copley Controls. This manual was
written for the reader who has a basic knowledge of motion control theory and operation, Copley
Controls drives, and Copley Controls CME 2 software.

Related Documentation
•
•
•

CME 2 User Guide
Camming User Guide
Parameter Dictionary

Copley Controls software and related information can be found at:
http://www.copleycontrols.com/Motion/Products/Software/index.html

Copley Controls

3

Product Warnings
Observe all relevant state, regional, and local safety regulations when installing and using Copley
Controls drives. For safety and to assure compliance with documented system data, only Copley
Controls should perform repairs to drives.
DANGER: Hazardous voltages.

!
DANGER

Exercise caution when installing and adjusting.
Failure to heed this warning can cause equipment damage,
injury, or death.
Risk of electric shock.

!
DANGER

Drive high-voltage circuits are connected to DC or AC power.
Failure to heed this warning can cause equipment damage,
injury, or death.
Using CME 2 can affect or suspend externally controlled
operations.

!
DANGER

4

When operating the drive under control of the ASCII Interface, use of
CME 2 to change drive parameters can affect operations in progress.
Using CME 2 to initiate motion can cause external program operations
to suspend. The operations may restart unexpectedly when the CME
2 move is stopped.
Failure to heed this warning can cause equipment damage,
injury, or death.

Copley Controls

ASCII Programmer’s Guide

About This Manual

Revision History
Revision Date
00
May 2014

Comments
Added info on multi-axis drives

01

Fixed description for parameter 0x3A and 0xA9, also
minor typo/text edits.

April 2015

Copley Controls

5

CHAPTER
1: INTRODUCTION

Copley Controls

6

ASCII Programmer’s Guide

Introduction

1.1: The Copley ASCII Interface
The Copley ASCII Interface is a set of commands that can be used to control and monitor Copley
Controls drives over an RS-232 serial connection.
The ASCII Interface can be used to:
•
•
•

Read and write the drive’s parameters
Control the trajectory generator
Read and write CVM registers.

1.2: Communication Protocol
Copley drives use the “speak when spoken to” protocol. This means that the drive will never
initiate communications, but it will respond to commands with a data packet, an error code, or
acknowledgement (except for a reset command).
The baud rate of the drive will always be set to 9600 on power up or after a reset. Copley drives
are designed to identify a break condition on the serial line and synchronize its communication
interface based on it. A serial break command is normally an illegal condition in which the system
initiating the break command holds its transmit line low for longer than a single byte of serial data.
If such a condition is detected by the drive, it will flush any pending input data, reset its baud rate
to 9600, and wait for a new command to be received on its serial port. The drive will never initiate
a break command itself.
Use the following settings for the serial port communications:
Baud Rate

9,600 to 115,200 (Defaults to 9,600 on power up or reset.)

Data Format

N, 8, 1

Flow Control

None

Copley Controls

7

CHAPTER
2: COMMAND SET

Copley Controls

8

ASCII Programmer’s Guide

Operating Modes

2.1: Command Format
The general syntax of a Copley ASCII message is:
[node ID][<.>axis letter] [command code] [command parameters] 
The specific syntax for each command is described in the remaining sections of this chapter.

[node ID]
(Optional), the CANopen node ID of a drive on a multi-drop network (See Multi-Drop Network
Connections). The node ID is followed by a space, unless an axis letter is specified. The valid
range is 1-127.

[<.>axis letter]
Optional, the axis letter for multi-axis drives (BE2, SP4, etc.). Axes are specified by a single letter
and must be preceded by a period. Valid axis letters start at “A” and continue sequentially. For
example, the SP4 is a four axis drive with valid axis letters of A, B, C, D.

[command code]
The command code is a single-letter code for the command.
Code

Command

Description

s

Set

Set a value of a parameter in ram or flash.

g

Get

Read the value of a parameter in ram or flash.

c

Copy

Copy the value of a parameter from ram to flash or flash to
ram.

r

Reset

Reset the drive.

t

Trajectory

Trajectory generator command.

i

Register

Read or write the value of a CVM program register.

[command specific parameters]
Command specific parameters are used to provide additional data for a command. If more than
one parameter is required, they should be separated by spaces. The remaining sections of this
chapter describe the parameters for each command code.


A carriage return is used to indicate the end of the command to the drive.

Copley Controls

9

Operating Modes

ASCII Programmer’s Guide

2.2: Set Command (s)
The s command is used to set the value of a drive parameter in RAM or flash.

Syntax
[node ID][<.>axis letter] s [memory bank][parameter ID] [value]

Command Specific Parameters
[memory bank]

Identifies which memory bank to set the parameter in.
f = flash memory
r = RAM memory

[parameter ID]

Identifies the parameter to set. This value can be decimal or hexadecimal.

[value]

The new value(s) to be set in the parameter. Value can be sent in integeror
hexadecimal format. If multiple values are required, they are separated by
spaces.

The drive responds to the s command with:
ok if the command is accepted.
e  if the command was not accepted. See Error Codes.

Examples
Command
s r0x30 1200

Response
ok

s f0x30 1200

ok

Set parameter 0x30 (position loop proportional gain) to 1200
in flash. The “ok” response indicates that the command
executed successfully.

3 s f0x30 1200

ok

Set parameter 0x30 (position loop proportional gain) to 1200
in flash for the drive with CAN node ID of 3. The “ok”
response indicates that the command executed
successfully.

.b s f0x30 1200

ok

Set parameter 0x30 (position loop proportional gain) to 1200
in flash on axis B. The “ok” response indicates that the
command executed successfully.

s r 0x30 1000

e 33

Attempted to set 0x30 to 1200 in RAM. Error 33 (ASCII
command parsing error) was returned. Note the extra space
between the bank and the parameter ID.

10

Comment
Set parameter 0x30 (position loop proportional gain) to 1200
in RAM. The “ok” response indicates that the command
executed successfully.

Copley Controls

ASCII Programmer’s Guide

Operating Modes

2.3: Get Command (g)
The g command is used to read the value of a drive parameter from RAM or flash.

Syntax
[node ID][<.>axis letter] g [memory bank][parameter ID][optional ]

Command Specific Parameters
[memory bank]

Identifies which memory bank to read the parameter from.
f = flash memory
r = RAM memory

[parameter ID]

Identifies the parameter to read. This value can be decimal or hexadecimal.



(Optional), instructs the drive to return the value in hexadecimal format.
This option is not available on Feature set A or Feature Set B drives.

The drive responds to the Get command with:
v [value] where value equals the contents of the parameter. If the parameter contains
multiple values, they will separated by spaces.
e  if the command was not accepted. See Error Codes.

Examples
Command
g r0x30

Response
v 1200

Comment

3 g r0x30

v 1200

Read the value of parameter 0x30 (position loop
proportional gain) from RAM for the drive with CAN
node ID of 3. Example shows a value of 1200
returned.

.b g r0x30

v 1200

Read the value of parameter 0x30 (position loop
proportional gain) from RAM on axis B. Example
shows a value of 1200 returned.

g r0xa0x

v
0x4000f800

Read the value of parameter 0xa0 (amplifier event
status) and return the value in hexadecimal format.

g f0x17

e 15

Attempted to read parameter 0x17 (actual motor
position) from flash. Error 15 (Parameter doesn’t exist
on requested page) was returned. Note that actual
motor position is stored in RAM only.

Copley Controls

Read the value of parameter 0x30 (position loop
proportional gain) from RAM. Example shows a value
of 1200 returned.

11

Operating Modes

ASCII Programmer’s Guide

2.4: Copy Command (c)
The c command is used to copy the value of a parameter from one memory bank to another (RAM
to flash or flash to RAM).

Syntax
[node ID][<.>axis letter] c [memory bank][parameter ID]

Command Specific Parameters
[memory bank]

Identifies which memory bank to set the parameter in.
f = copy from flash to RAM
r = copy from RAM to flash

[parameter ID]

Identifies the parameter to read. This value can be decimal or hexadecimal.

The drive responds to the c command with:
ok if the command is accepted.
e  if the command was not accepted. See Error Codes.

Examples
Command
c r0x30

Response
ok

Comment

.b c r0x30

ok

Copy the value of 0x30 from RAM to flash for axis B.
The “ok” response indicates that the command executed
successfully.

3 c r0x30

ok

Copy the value of 0x30 from RAM to flash for the drive
with CAN node ID of 3. The “ok” response indicates that
the command executed successfully.

c f0x30

ok

Copy the value of 0x30 from flash to RAM. The “ok”
response indicates that the command executed
successfully.

12

Copy the value of 0x30 from RAM to flash. The “ok”
response indicates that the command executed
successfully.

Copley Controls

ASCII Programmer’s Guide

Operating Modes

2.5: Reset Drive Command (r)
The r command is used to reset the drive. The command requires no additional parameters. The
drive baud rate is set to 9600 when the drive restarts. The drive does not respond to this message.
NOTE: if a reset command is issued to a drive on a multi-drop network, error code 32, “CAN
Network communications failure,” will be received. This is because the drive reset before
responding to the gateway drive. In this case, the error can be ignored.

Syntax
[optional node ID] r

Notes
The axis letter has no effect with this command because the reset command applies to all axes of
a multi-axis drive.

Example
Command
r
3 r

Copley Controls

Response
none
none

Comment
Drive is reset.
The drive with CAN node ID of 3 is reset.

13

Operating Modes

ASCII Programmer’s Guide

2.6: Trajectory Generator Command (t)
The t command controls the trajectory generator.

Syntax
1

The original syntax for the t command is:
[node ID][<.>axis letter] t [command code]

2

For Feature Set C and D with a firmware version of at least 3.26 and Feature Set E drives
with a firmware version of at least 1.44, the axis letter is not needed because the axis can
be specified in the command code. If the axis is supplied in addition to setting the axis bits
in the command code, the axis letter will be OR’d with the bits set in the command code.
This is allowed for backward compatibility reasons.
[node ID] t [command code]

Command Specific Parameters
[command code]

Trajectory command information, bit-mapped as follows:
Bit(s)

Description

0-3

Sub-command
Value Meaning
0

Abort the move in progress.

1

Initiate or update a move.

2

Initiate home sequence

4-11

Reserved and should be set to zero

12*

If set apply command to axis A

13*

If set apply command to axis B

14*

If set apply command to axis C

15*

If set apply command to axis D

* NOTE: The axis bits are only available on Feature Set C and D with a firmware version of at
least 3.26 and Feature Set E drives with a firmware version of at least 1.44
The drive responds to the t command with:
ok if the command is accepted. An “ok” response only indicates the command was
accepted by the drive. Monitor the trajectory status register to verify that motion has actually
been initiated.
e  if the command was not accepted. See Error Codes

14

Copley Controls

ASCII Programmer’s Guide

Operating Modes

Examples
Command
t 1

Response
ok

t 0x5002

ok

t2

e 33

Copley Controls

Comment
Initiate a move.
Initiate a home sequence on axis A and C
Attempted to initiate a homing sequence. Error 33
(ASCII command parsing error) was returned. Note there
is no space between the command and sub-command.

15

Operating Modes

ASCII Programmer’s Guide

2.7: Register Read and Write Command (i)
The i command is used to read and write one of the CVM program’s 32 registers.

Write Syntax
[node ID] i  [value]

Command Specific Parameters


Identifies which register to access. The valid range is 0-31.

[value]

If included, the new value to be written to the register. The value can be in
decimal or hexadecimal format.

Read Syntax
[node ID][<.>axis letter] i 

Command Specific Parameters


Identifies which register to access. The valid range is 0-31.

The drive responds to the i command with:
•
•
•

ok if the command is accepted and the value is written to the register.
r [value] where value equals the contents of the register that was read.
e  if the command was not accepted. See Error Codes

Notes
All axes on a multi-axis drive share a single set of CVM registers. Therefore, the axis letter is not
used for this command.

Examples
Command
i r0 15

Response
ok

i r0

r 15

Read the value of register 0. Example displays a
returned value equal to 15.

8 i r0

r 35

Read the value of register 0 on drive with CAN node ID
of 8. Example displays a returned value equal to 35.

16

Write the value “15” to register 0.

Copley Controls

ASCII Programmer’s Guide

Operating Modes

2.8: Clear Encoder Faults Command
This command will clear the faults being reported by the encoder. When received by the drive, the
drive will attept to send the clear faults command to the encoder.

Syntax
For motor encoders:
enc clear
For load encoders:
ldenc clear

Notes
The encoder must be connected to the drive for this command to work.

Examples
Command
enc clear
ldenc clear

Copley Controls

Response
ok
ok

Drive attempts to clear the faults on the motor encoder
Drive attempts to clear the faults on the load encoder

17

CHAPTER
3: OPERATING MODES

Copley Controls

18

ASCII Programmer’s Guide

Operating Modes

3.1: Desired State Parameter
The desired state parameter (0x24) defines the drive’s operating mode and input source control.
Mode-specific values are mentioned in the remaining sections of this chapter.
Value

State

0

Disabled.
NOTE: If the desired sate is saved to flash as 0, then CME 2 assumes the drive has
not been programmed, and when CME connects to the drive, the Basic Setup screen
will be displayed.

1

The current loop is driven by the programmed current value.

2

The current loop is driven by the analog command input.

3

The current loop is driven by the PWM & direction input pins.

4

The current loop is driven by the internal function generator.

5

The current loop is driven by UV command.

11

The velocity loop is driven by the programmed velocity value.

12

The velocity loop is driven by the analog command input.

13

The velocity loop is driven by the PWM & direction input pins.

14

The velocity loop is driven by the internal function generator.

21

Servo mode, the position loop is driven by the trajectory generator.

22

Servo mode, the position loop is driven by the analog command input.

23

Servo mode, the position loop is driven by the digital inputs (pulse & direction, master
encoder, etc.).

24

Servo mode, the position loop is driven by the internal function generator.

25

Servo mode, the position loop is driven by the cam tables.

30

Servo mode, the drive is controlled by the CANopen or EtherCAT interface.

31

Microstepping mode, the position loop is driven by the trajectory generator.

32

Microstepping mode, the position loop is driven by the analog command input.

33

Microstepping mode, the position loop is driven by the digital inputs (pulse & direction,
master encoder, etc.).

34

Microstepping mode, the position loop is driven by the internal function generator.

35

Microstepping mode, the position loop is driven by the cam tables.

36

Microstepping mode, the velocity loop is driven by the analog command input.

40

Microstepping mode, the drive is controlled by the CANopen or EtherCAT interface.

42

Diagnostic use only. The current loop is driven by the programmed current value, and
the phase angle is micro-stepped.

Copley Controls

19

Operating Modes

ASCII Programmer’s Guide

3.2: Current Mode
Programmed Current Mode
The Programmed Current mode sets the output of the drive at a programmed current level. When
the drive is enabled in this mode, or when the programmed current level is changed, the output
current ramps to the new level at the programmed rate.

Parameters
Parameter ID

Bank

Description

0x24

RF

Desired state: Programmed Current mode (1)

0x02

RF

Programmed current value. Units: 0.01 A.

0x6a

RF

Current ramp limit. Units: mA/second.
A value of zero in this register disables slope limiting and
results in a step change.

NOTE: When changing both the level and the ramp parameters while the drive is enabled, change
the ramp rate first.

Example
Enable the drive in Programmed Current Mode. Ramp the output current up to 2 A in 0.5 seconds.
The controller monitors the output current, and after it reaches 2 A the current is ramped down to 1
A in 2 seconds.
Command
Response Comment
s r0x6a 4000 ok
Set ramp rate to 4 A/second.
s r0x02 200
ok
Set the output level to 2 A.
s r0x24 1

ok

Enable the drive in Programmed Current Mode. Output
current will start increasing at a rate of 4 A/second.

The controller uses the following command to monitor the output current.
g r0x0c
v 150
Reads actual current output from the drive. Example
displays a returned value equal to 1.50 A.
After the output current reaches 2 A, the controller sends the new ramp and level
parameters.
s r0x6a 500
ok
Set new ramp rate of 0.5 A/second.
s r0x02 100
ok
Change the output level to 1 A. Output current will start
decreasing at a rate of 0.5 A/second.
The controller disables the drive.
s r0x24 0
ok
Disable the drive.

20

Copley Controls

ASCII Programmer’s Guide

Operating Modes

Analog Current Mode
In Analog Current Mode, the current output of the drive is proportional to the analog reference
input command signal.

Parameters
Parameter ID

Bank

Description

0x24

RF

Desired state. Analog Current Mode (2).

0x19

RF

Analog input scaling factor. Amount of current to be
commanded when 10 volts is applied to the analog input.
Units: 0.01 A.

0x26

RF

Analog input dead band. Units: mV.

0x1a

RF

Analog input offset. Units: mV.

NOTE: Parameters 0x19, 0x26 and 0x1a are used in Analog Current, Velocity and Position modes.
Verify that these parameters are set correctly before switching between these modes of operation.

Example
The controller sets the scaling, enables the drive in Analog Current Mode, monitors the current
output, and changes the scaling to a new value.
Command
Response Comment
s r0x19 1000 ok
Set scaling factor to 10V = 10A.
s r0x24 2
ok
Set drive to Analog Current Mode.
The controller uses the following command to monitor the output current.
g r0x0c
v 525
Reads actual current output from the drive. Example
displays a returned value equal to 5.25 A.
The controller changes the scaling factor
s r0x19 100
ok
Set scaling factor to 10V = 1A.
The controller disables the drive.
s r0x24 0
ok
Disable the drive.

Copley Controls

21

Operating Modes

ASCII Programmer’s Guide

PWM Current Mode
In the PWM Current Mode, the current output of the drive is proportional to the duty cycle of the
input command signal. In most applications the command signal configuration is set using CME 2
and not changed during operation.

Parameters
Parameter ID

Bank

Description

0x24

RF

Desired state: PWM Current Mode (3).

0xa9

RF

Digital input scaling factor. Amount of current commanded
at 100 percent duty cycle. Units: 0.01 A.

0xa8

RF

Digital input command configuration normally set using the
CME 2 PWM Command screen. See table below for
definition of the values.

NOTE: Parameters 0xa9 and 0xa8 are used in PWM Current and Velocity modes. Verify that these
parameters are set correctly before switching between these modes of operation.

Example
The controller sets the scaling, enables the drive in PWM Current Mode, and monitors
commanded and actual current.
Command
Response Comment
s r0xa9 1000 ok
Set scaling factor to 10A.
s r0x24 3
ok
Enable the drive in PWM Current Mode.
The controller uses the following commands to monitor the commanded and output
current .
g r0x15
v 500
Reads commanded current from the drive. Example
displays a returned value equal to 5 A.
g r0x0c
v 495
Reads actual current output from the drive. Example
displays a returned value equal to 4.95 A.
The controller disables the drive.
s r0x24 0
ok
Disable the drive.

PWM Current Mode Command Signal Configuration
If required during operation, the PWM command signal configuration can be changed by setting
the value of parameter 0xa8 as shown below.

22

Copley Controls

ASCII Programmer’s Guide

Operating Modes

PWM Input
Type

Invert PWM
Input

Invert Sign
Input

Allow 100%
Output

Value

50%

No

--

No

0x00

50%

No

--

Yes

0x08

50%

Yes

--

No

0x02

50%

Yes

--

Yes

0x0a

100%

No

No

No

0x01

100%

No

No

Yes

0x09

100%

No

Yes

No

0x05

100%

No

Yes

Yes

0x0d

100%

Yes

No

No

0x03

100%

Yes

No

Yes

0x0b

100%

Yes

Yes

No

0x07

Copley Controls

23

Operating Modes

ASCII Programmer’s Guide

3.3: Velocity Mode
Programmed Velocity Mode
The Programmed Velocity Mode sets the output of the drive to a programmed motor velocity.
When the drive is enabled in this mode, or when the programmed velocity is changed, the motor
velocity will ramp to the new level at the programmed rate.

Parameters
Parameter ID

Bank

Description

0x24

RF

Desired state: Programmed Velocity Mode (11).

0x2f

RF

Programmed velocity command. Units: 0.1 counts/second.

0x36

RF

Velocity acceleration limit. Units: 1000 counts/second2

0x37

RF

Velocity deceleration limit. Units: 1000 counts/second2

0x39

RF

Fast stop ramp. Units: 1000 counts/second2

Example
The controller sets the velocity parameters, enables the drive in Programmed Velocity Mode,
monitors the actual motor velocity, and then changes the velocity.
Command
s r0x36 2

Response
ok

Comment
Set acceleration limit to 2000 counts/second2.

s r0x37 4
s r0x2f 10000

ok
ok

Set deceleration limit to 4000 counts/second2.
Set the programmed velocity to 1000 counts/second.

s r0x24 11

ok

Enable the drive in Programmed Velocity Mode.

The controller uses the following commands to monitor the motor velocity.
g r0x18
v 10010
Reads actual velocity from the drive. Example
displays a returned value equal to 1001
counts/second.
The controller sets a new velocity to 500 counts/second.
s r0x2f 5000
ok
Set the programmed velocity to 500 counts/second.
Motor will decelerate at 4000 counts/second2 to 500
counts/second.
The controller disables the drive.
s r0x24 0
ok
Disable the drive.

24

Copley Controls

ASCII Programmer’s Guide

Operating Modes

Analog Velocity Mode
In the Analog Velocity Mode, the motor velocity is proportional to the analog reference input
command signal.

Parameters
Parameter ID

Bank

Description

0x24

RF

Desired state: Analog Velocity Mode (12).

0x19

RF

Analog input scaling factor. Velocity commanded per 10
volts of input. Units: 0.1 counts/second

0x26

RF

Analog input dead band. Units: mV.

0x1a

RF

Analog input offset. Units: mV.

0x36

RF

Velocity acceleration limit. Units: 1000 counts/second2

0x37

RF

Velocity deceleration limit. Units: 1000 counts/second2

0x39

RF

Fast stop ramp. Units: 1000 counts/second2

NOTE: Parameters 0x19, 0x26 and 0x1a are used in Analog Current, Velocity and Position modes.
Verify that these parameters are set correctly before switching between these modes of operation.

Example
The controller sets the scaling, enables the drive in Analog Velocity Mode, monitors the actual
motor velocity, and changes the scaling.
Command
s r0x19 10000

Response
ok

Comment
Set scaling factor to 1000 counts/second.

s r0x24 12

ok

Enable the drive in Analog Velocity Mode.

The controller uses the following command to monitor the actual motor velocity.
g r0x18
v 5000
Reads actual velocity from the drive. Example
displays a returned value equal to 500 counts/second.
The controller changes the scaling factor.
s r0x19 7000
ok
Set scaling factor to 700 counts/second.
The controller disables the drive.
s r0x24 0
ok
Disable the drive.

Copley Controls

25

Operating Modes

ASCII Programmer’s Guide

PWM Velocity Mode
In the PWM Velocity Mode, the motor velocity is proportional to the duty cycle of the input
command signal. In most applications the command signal configuration is set using CME 2 and
not changed during operation.

Parameters
Parameter ID

Bank

Description

0x24

RF

Desired state: PWM Velocity Mode (13).

0xa9

RF

Scaling Factor. Velocity command at 100 percent duty
cycle. Units: 0.1 counts/second.

0x36

RF

Velocity acceleration limit. Units: 1000 counts/second2

0x37

RF

Velocity deceleration limit. Units: 1000 counts/second2

0x39

RF

Fast stop ramp. Units: 1000 counts/second2

0xa8

RF

Digital input command configuration. This is normally set
using the CME 2 PWM Command screen. See table below
for the definition of the values.

NOTE: Parameters 0xa9 and 0xa8 are used in PWM Current and Velocity modes. Verify that these
parameters are set correctly before switching between these modes of operation.

Example
The controller sets the PWM scaling, enables the drive in PWM Velocity Mode, and monitors the
commanded and actual velocity.
Command
s r0xa9 800000

Response
ok

Comment

s r0x24 13

ok

g r0x2c

v 49995

Reads commanded velocity from the drive.
Example displays a returned value equal to 4999.5
counts/second.

g r0x18

v 49991

Reads actual velocity from the drive. Example
displays a returned value equal to 4999.1
counts/second.

s r0x24 0

ok

Disable the drive.

Set scaling factor to 80000 counts/second at
100%.
Enable the drive in PWM Velocity Mode.

PWM Velocity Mode Command Signal Configuration
If required during operation, the PWM command signal configuration can be changed by setting
the value of parameter 0xa8 as shown below.

26

Copley Controls

ASCII Programmer’s Guide

Operating Modes

PWM Input
Type

Invert PWM
Input

Invert Sign
Input

Allow 100% Output

Value

50%

No

--

No

0x00

50%

No

--

Yes

0x08

50%

Yes

--

No

0x02

50%

Yes

--

Yes

0x0a

100%

No

No

No

0x01

100%

No

No

Yes

0x09

100%

No

Yes

No

0x05

100%

No

Yes

Yes

0x0d

100%

Yes

No

No

0x03

100%

Yes

No

Yes

0x0b

100%

Yes

Yes

No

0x07

Copley Controls

27

Operating Modes

ASCII Programmer’s Guide

3.4: Position Mode
Updating Trajectory Parameters in Position Modes
When the drive enters a position mode, the trajectory parameters (velocity, acceleration and
deceleration) are copied into the trajectory generator. To change any of them after the drive is in a
position mode, send the new value to the appropriate parameter and then send a t 1 command to
initiate a trajectory update.

Programmed Position Mode
In the Programmed Position Mode, the axis moves to target positions sent to the drive over the
serial interface. The target positions can be absolute or relative from the current position. The
motion profile used can be set to trapezoidal or S-curve.
To initiate a move, first set the appropriate parameters and then send the trajectory command t 1
to start the move. When using the trapezoidal profile, the move parameters can be changed during
the move. Again, first set the appropriate parameters and then send another t 1 command. When
the t 1 command is received, the target position, absolute / relative, velocity, acceleration and
deceleration rates will be updated. In this manner, the move in progress can be changed. The Scurve profile cannot be updated in this manner.
To abort a move in progress, send a t 0 command. This will stop the move in progress using the
abort deceleration rate. The drive will remain enabled.
A special velocity mode can be used to move the axis using the velocity, acceleration and
deceleration of the trapezoidal profile but with no specific target position. Direction of motion is set
by entering a “1” or “-1” into the position command parameter. Once started, the move will
continue until the velocity parameter is set to zero and a t 1 command is sent or a t 0 abort
command is sent.

Parameters
Parameter ID

Bank

Description

0x24

RF

Desired state:
21 = Programmed Position Mode, Servo
31 = Programmed Position Mode, Stepper

0xc8

RF

Profile type:
0 = Absolute move, trapezoidal profile.
1 = Absolute move, S-curve profile.
256 = Relative move, trapezoidal profile.
257 = Relative move, S-curve profile.
2 = Velocity move.

0xca

RF

Position command. Units: counts.
Relative move = the distance of the move.
Absolute move = the target position of the move.
Velocity move = 1 for positive direction, -1 for negative direction.

28

Copley Controls

ASCII Programmer’s Guide

Operating Modes

0xcb

RF

Maximum velocity. Units: 0.1 counts/second.

0xcc

RF

Maximum acceleration rate. Units: 10 counts/second2.

0xcd

RF

Maximum deceleration rate. Units: 10 counts/second2.

0xce

RF

Maximum jerk rate. Units: 100 counts/ second3.

0xcf

RF

Abort deceleration rate. Units: 10 counts/second2.

NOTES: 1) Maximum jerk rate is not used in the trapezoidal profile. 2) In the S-curve profile, the
maximum deceleration rate is note used. The maximum acceleration rate is used for both
acceleration and deceleration.

Example
The controller sets profile parameters, executes an absolute trapezoidal move to position 40,000
counts, monitors for move completion, and then executes a relative move of 10,000 counts using
the same profile parameters.
Command
s r0xc8 0

Response
ok

Comment

s r0xca 40000

ok

s r0xcb 70000
s r0xcc 200000

ok
ok

Set maximum velocity to 7000 counts/second.

s r0xcd 200000

ok

Set maximum deceleration to 2000000 counts/second2.

s r0x24 21

ok

Enable the drive in Programmed Position (Trajectory
Generator) Mode.

Set the trajectory generator to absolute move,
trapezoidal profile.
Set the position command to 40000 counts.
Set maximum acceleration to 2000000 counts/second2.

The controller verifies actual axis position before starting move.
g r0x32
v 0
Read actual position. Example displays an actual
position of 0.
t 1
ok
Execute the move.
The controller monitors the event status register to determine when the move has been
completed.
g r0xa0
v 134217728 The controller monitors bit 27 of the event status
register to determine when the move is complete.
Example displays a status register value of 134217728.
When this is decoded, it shows that bit 27 is set
meaning the axis is in motion.
After the controller determines that motion has stopped, it checks the trajectory status register
to see if the move was aborted for any reason.
g r0xc9
v 4096
The controller checks bit 14 of the trajectory status
register to determine if the move was aborted. Example
displays a status register value of 4096. When this is
decoded, it shows that bit 14 is not set meaning the
move was not aborted.
The controller sets the trajectory configuration and commanded position parameters to their
new values and executes the new move.
Copley Controls

29

Operating Modes

ASCII Programmer’s Guide

s r0xc8 256

ok

s r0xca 10000

ok

Set the trajectory generator to relative move,
trapezoidal profile.
Set the position command to 10000 counts.

t 1

ok

Execute the move.

The controller aborts the move.
t 0
ok

Motion stops and the drive is left enabled

The controller disables the drive.
s r0x24 0
ok

Disable the drive.

30

Copley Controls

ASCII Programmer’s Guide

Operating Modes

Analog Position Mode
In the Analog Position Mode, the axis position is commanded by the analog reference input
command signal.
The analog position command operates as a relative motion command. When the drive is enabled
the voltage on the analog input is read. Then any change in the command voltage will move the
axis a relative distance, equal to the change in voltage, from its position when enabled. To use the
analog position command as an absolute position command, the drive should be homed every
time it is enabled.

Parameters
Parameter ID

Bank

Description

0x24

RF

Desired state: Analog Position Mode (22).

0x19

RF

Analog input scaling factor. Commanded position per 10 volts of
input.
Units: counts.

0x26

RF

Dead band. Units: mV.

0x1a

RF

Analog input offset. Set to 0 when in this mode of operation.

0xcb

RF

Maximum velocity. Units: 0.1 counts/second.

0xcc

RF

Maximum acceleration rate. Units: 10 counts/second2.

0xcd

RF

Maximum deceleration rate. Units: 10 counts/second2.

0xcf

RF

Abort deceleration rate. Units: 10 counts/second2.

NOTES: 1) Parameters 0x19, 0x26 and 0x1a are used in Analog Current, Velocity and Position
modes. Verify that these parameters are set correctly before switching between these modes of
operation. 2) To invert the direction of motion with respect to the polarity of the command voltage,
set the scaling factor as a negative value.

Copley Controls

31

Operating Modes

ASCII Programmer’s Guide

Example
The controller sets the move parameters, homes the axis and then places the amp in the Analog
Position Mode. The controller monitors actual position. The controller then changes the maximum
velocity and scaling factor.
Command
s r0x19 4000

Response
ok

Comment

s r0xcb 70000

ok

Set velocity to 7000 counts/second

s r0xcc 20000

ok

Set acceleration to 200000 counts/second2

s r0xcd 20000
s r0x24 21

ok
ok

Set deceleration to 200000 counts/second2

t 2

ok

Set analog scaling to 4000 counts per 10V.

Drive set in Programmed Position Mode required for
homing.
Execute homing. Assumes all homing parameters have
been previously set.

The controller monitors the trajectory status register to determine when the axis has been
homed.
g r0xc9
v 8192
Controller checks bit 12 of the trajectory status register to
determine if the axis was homed successfully. Example
displays a status register value of 8192. Decoded, this value
shows that bit 12 is not set, meaning the axis has not
finished homing.
After a successful homing, the controller changes the drive’s operating mode.
s r0x24 22
ok
Drive set in Analog Position Mode
t 1
ok
This command will guarantee all new move parameters are
in effect.
The controller monitors actual motor position.
g r0x32
v 2012
Reads actual motor position from the drive. Example
displays a returned value equal to 2012 counts.
The controller changes velocity and scaling parameters
s r0xcb 20000
ok
Set velocity to 2000 counts/second
s r0x19 1000

ok

Set analog scaling to 1000 counts / 10V input.

t 1

ok

This command required for new velocity to take effect.

The controller disables the drive.
s r0x24 0
ok

32

Disable the drive.

Copley Controls

ASCII Programmer’s Guide

Operating Modes

Pulse and Direction Mode
In the Pulse and Direction Position Mode, the axis position is commanded by pulses applied to one
of the drives digital inputs. The direction of the commanded move is determined by the logic level
of a second digital input.
The scaling factor sets the ratio of position command, in counts, for each input pulse. This ratio is
stored in parameter 0xa9 as two 16 bit words. The first word stores the numerator or number of
position counts. The second stores the denominator or the number of input pulses.
Example: To set a ratio of 10 counts of position change for every input pulse.
The ration would be 10/1. To make sending the data easier, it should be converted to hex word
format so the ratio would now be 0x000a / 0x0001. The two words can now simply be combined
and sent to the drive by sending the command s r0xa9 0x000a0001.
To invert the direction, the numerator should be set to a negative value.
Example: Changing direction of the previous example would require a ratio of -10/1. Using the 2’s
complement method, -10 is represented as 0xfff6 hex. The ratio in hex would now be 0xfff6 /
0x001. Combining these words, the command to be sent would be s r0xa9 0xfff60001.

Parameters
Parameter ID

Bank

Description

0x24

RF

Desired state:
23 = Digital Input Position Mode, Servo
33 = Digital Input Position Mode, Stepper

0xa8

RF

Digital Command Configuration (Pulse and Direction)
0 = Increment position on rising edge
4096 = Increment position on falling edge

0xa9

RF

Scaling factor, Output counts/Input pulses.

0xcb

RF

Maximum velocity. Units: 0.1 counts/second.

0xcc

RF

Maximum acceleration rate. Units: 10 counts/second2.

0xcd

RF

Maximum deceleration rate. Units: 10 counts/second2.

0xcf

RF

Abort deceleration rate. Units: 10 counts/second2.

Copley Controls

33

Operating Modes

ASCII Programmer’s Guide

Example
The controller sets the move parameters, places the amp in the Pulse and Direction Position
Mode, monitors commanded and actual position, and then changes the scaling factor.
Command
s r0xa8 0

Response
ok

Comment

s r0xa9 0x00020001

ok

s r0xcb 70000

ok

Set scaling factor to 2 output counts per input
pulse.
Set velocity to 7000 counts/second.

s r0xcc 20000

ok

Set acceleration to 200000 counts/second2.

s r0xcd 20000

ok

Set deceleration to 200000 counts/second2.

s r0x24 23

ok

Enable the drive in Digital Input Position Mode.

Configure the digital inputs to pulse and
direction with the position incrementing on the
rising edge of the input pulse.

The controller monitors commanded and actual motor position.
g r0x3d
v 4000
Reads commanded position from the drive.
Example displays a returned value equal to
4000 counts.
g r0x32
v 2012
Reads actual motor position from the drive.
Example displays a returned value equal to
2012 counts.
The controller changes the scaling parameter.
s r0xa9 0x00010001 ok
Set scaling factor to 1 output count per input
pulse.
The controller disables the drive.
s r0x24 0
ok

34

Disable the drive.

Copley Controls

ASCII Programmer’s Guide

Operating Modes

Pulse Up/Down Mode
In the Pulse Up/Down Position Mode, the axis position is commanded by pulses applied to the
drives digital inputs. The direction of the commanded move is determined by which of the digital
inputs the pulses are applied to.
The scaling factor sets the ratio of position command, in counts, for each input pulse. It is stored in
parameter 0xa9 as two 16 bit words. The first word stores the numerator or number of position
counts. The second stores the denominator or the number of input pulses.
Example: To set a ratio of 10 counts of position change for every input pulse.
The ratio would be 10/1. To make sending the data easier, it should be converted to hex word
format so the ratio would now be 0x000a / 0x0001. The two words can now simply be combined
and sent to the drive by sending the command s r0xa9 0x000a0001.
To invert the direction, the numerator should be set to a negative value.
Example: Changing direction of the previous example would require a ratio of -10/1. Using the 2’s
complement method, -10 is represented as 0xfff6 in hex format. The ratio in hex format would now
be 0xfff6 / 0x001. Combining these words, the command to be sent would be
s r0xa9 0xfff60001.

Parameters
Parameter ID

Bank

Description

0x24

RF

Desired state:
23 = Digital Input Position Mode, Servo.
33 = Digital Input Position Mode, Stepper.

0xa8

RF

Digital Command Configuration (Pulse Up/Down Mode):
256 = Increment position on rising edge.
4352 = Increment position on falling edge.

0xa9

RF

Scaling factor, Output counts/Input pulses.

0xcb

RF

Maximum velocity. Units: 0.1 counts/second.

0xcc

RF

Maximum acceleration rate. Units: 10 counts/second2.

0xcd

RF

Maximum deceleration rate. Units: 10 counts/second2.

0xcf

RF

Abort deceleration rate. Units: 10 counts/second2.

Copley Controls

35

Operating Modes

ASCII Programmer’s Guide

Example
The controller sets the move parameters and then places the amp in the Pulse Up/Down Position
Mode, monitors commanded and actual position, and then changes the scaling factor.
Command
s r0xa8 256

Response
ok

Comment

s r0xa9 0x000f0001

ok

Set scaling factor to 15 output counts per input pulse.

s r0xcb 70000

ok

Set velocity to 7000 counts/second.

s r0xcc 20000

ok

s r0xcd 20000

ok

Set acceleration to 200000 counts/second2.
Set deceleration to 200000 counts/second2.

s r0x24 23

ok

Enable the drive in Digital Input Position Mode.

Configure the digital inputs to pulse up/down with the
position incrementing on the rising edge of the input
pulse.

The controller monitors commanded and actual motor position.
g r0x3d
v 4000
Reads commanded position from the drive. Example
displays a returned value equal to 4000 counts.
g r0x32
v 2012
Reads actual motor position from the drive. Example
displays a returned value equal to 2012 counts.
The controller changes the scaling parameter.
s r0xa9 0x00010001 ok
Set scaling factor to 1 output count per input pulse.
The controller disables the drive.
s r0x24 0
ok

36

Disable the drive.

Copley Controls

ASCII Programmer’s Guide

Operating Modes

Quadrature Mode
In the Quadrature Position Mode, the axis position is commanded by a master encoder with its A
and B channels applied to the drive’s digital inputs.
The scaling factor sets the ratio of position command, in counts, for each count of the master
encoder. The scaling factor is stored in parameter 0xa9 as two 16 bit words. Word 1 stores the
numerator or number of position counts. Word 2 stores the denominator or the number of input
counts.
Example: To set a ratio of 10 counts of position change for every input count, the ratio would be
10/1. To make sending the data easier, the ratio should be converted to its hex equivalent
(0x000a/0x0001). The two words can now be combined and sent to the drive by sending the
command s r0xa9 0x000a0001.
To invert the direction, the numerator should be set to a negative value.
Example: Changing direction of the previous example would require a ratio of -10/1. Using the 2’s
complement method, -10 is represented as 0xfff6 in hex format. The ratio in hex format would now
be 0xfff6/0x001. Combining these words, the command to be sent would be
s r0xa9 0xfff60001.

Parameters
Parameter ID

Bank

Description

0x24

RF

Desired state:
23 = Digital Input Position Mode, Servo.
33 = Digital Input Position Mode, Stepper.

0xa8

RF

Digital Command Configuration:
512 = Quadrature Mode.

0xa9

RF

Scaling factor, Output counts/Input pulses.

0xcb

RF

Maximum velocity. Units: 0.1 counts/second.

0xcc

RF

Maximum acceleration rate. Units: 10 counts/second2.

0xcd

RF

Maximum deceleration rate. Units: 10 counts/second2.

0xcf

RF

Abort deceleration rate. Units: 10 counts/second2.

Example
The controller sets the move parameters, enables the drive in the Quadrature Position Mode, and
monitors commanded and actual position.
Command
s r0xa8 512

Response
ok

Comment

s r0xa9 0x00010001

ok

s r0xcb 70000

ok

Set scaling factor to 1 output counts per input
pulse.
Set velocity to 7000 counts/second

s r0xcc 20000

ok

Set acceleration to 200000 counts/second2

Copley Controls

Configure the digital inputs to quadrature
position mode.

37

Operating Modes

ASCII Programmer’s Guide

s r0xcd 20000

ok

Set deceleration to 200000 counts/second2

s r0x24 23

ok

Enable the drive in Digital Input Position
Mode.

The controller monitors commanded and actual motor position.
g r0x3d
v 4000
Reads commanded position from the drive.
Example displays a returned value equal to
4000 counts.
g r0x32
v 2012
Reads actual motor position from the drive.
Example displays a returned value equal to
2012 counts.
The controller disables the drive.
s r0x24 0
ok

38

Disable the drive.

Copley Controls

ASCII Programmer’s Guide

Operating Modes

Homing Mode
Homing sequences can be performed using the t command when the drive is in Programmed
Position Mode (servo or stepper). In most applications the homing sequence is configured using
CME 2 and not changed during operation.

Parameters
Parameter ID

Bank

Description

0x24

RF

Desired state:
21 = Programmed Position Mode, Servo.
31 = Programmed Position Mode, Stepper.
This is the required mode for homing.

0xc2

RF

Homing Method. See table below for values.

0xc3

RF

Fast Velocity Units: 0.1 counts/second.

0xc4

RF

Slow Velocity Units: 0.1 counts/second.

0xc5

RF

Acceleration / Deceleration Units: 10 counts/second2.

0xc6

RF

Home Offset Units: counts.

0xc7

RF

Current Limit Units: 0.01 A.

0xbf

RF

Current Delay Time Units: milliseconds.

0xb8

RF

Positive Software Limit Units: counts.

0xb9

RF

Negative Software Limit Units: counts.

Example
The controller modifies the homing parameters, enables the drive in the Programmed Position
Mode, initiates a homing sequence and then monitors homing status.
Command

Response

Comment

Setting the homing parameters is only required if the home sequence stored in flash memory
is not satisfactory.
s r0xc2 544
ok
Sets the homing method to use the next index pulse as
home.
s r0xc4 40000 ok
Sets the slow velocity to 4000 counts/second.
s r0xc6 1000

ok

Sets the home offset to 1000 counts.

s r0x24 21

ok

t 2

ok

Enables the drive in programmed position mode.
Starts the homing sequence.

The controller monitors the trajectory status register to determine when the homing sequence
is complete.
g r0xc9
v 20480
Controller checks bit 12 of the trajectory status register to
determine if the axis was homed successfully. Example
displays a status register value of 20480. Decoded, this
value shows that bit 12 is set meaning the axis is
referenced.
Copley Controls

39

Operating Modes

ASCII Programmer’s Guide

Homing Methods
For a complete description of each homing method, refer to the Appendix on Homing Methods in
the CME 2 User Guide.
Method

Start
Direction

Value

Set Current Position as Home

N/A

512

Next Index

Positive

544

Negative

560

Positive

513

Negative

529

Positive

545

Negative

561

Positive

514

Negative

530

Positive

546

Negative

562

Positive

610

Negative

626

Positive

516

Negative

532

Positive

548

Negative

564

Positive

771

Negative

787

Positive

515

Negative

531

Positive

803

Negative

819

Positive

867

Negative

883

Positive

547

Negative

563

Positive

611

Negative

627

N/A

15

Limit Switch
Limit Switch Out to Index
Home Switch
Home Switch Out to Index
Home Switch In to Index
Hard Stop
Hard Stop Out to Index
Lower Home
Upper Home
Lower Home Outside Index
Lower Home Inside Index
Upper Home Outside Index
Upper Home Inside Index
Immediate Home

40

Copley Controls

CHAPTER
4: OPERATION

Copley Controls

41

Operation

ASCII Programmer’s Guide

4.1: Setting the Baud Rate
Parameter 0x90 (RAM only) controls the drive’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
drive 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 drive to change back to 9600 baud. There
should also be a delay of 100 mS minimum before characters at the new baud rate are sent to the
drive.
When reading parameter 0x90, note that the value received may not be the exact value set. This is
because the drive sets the baud rate as close to the requested baud rate as possible given the
internal clock frequencies of the drive’s microprocessor.

4.2: Setting Limits and Gains
This section describes the parameters used to set control loop limits and gains.

Current Loop Limits Parameters
Parameter ID

Bank

Description

0x21

RF

Peak current limit. Units: 0.01 A.

0x23

RF

I2T time limit. Units: mS.

0x22

RF

Continuous current limit. Units: 0.01 A.

0xae

RF

Current loop offset. Units: 0.01 A.

Current Loop Gains Parameters
0x00

RF

Current loop proportional gain (Cp).

0x01

RF

Current loop integral gain (Ci).

Velocity Loop Limits Parameters
Parameter ID

Bank

Description

0x3a

RF

Velocity loop velocity limit. Units: 0.1 counts/second.

0x36

RF

Velocity loop acceleration limit. Units: 1000 counts/second2.

0x37

RF

Velocity loop deceleration Limit. Units: 1000 counts/second2.

0xcf

RF

Fast Stop Ramp. Units: 10 counts/second2.

42

Copley Controls

ASCII Programmer’s Guide

Operation

Velocity Loop Gains Parameters
Parameter ID

Bank

Description

0x27

RF

Velocity loop proportional gain (Vp).

0x28

RF

Velocity loop integral gain (Vi).

Copley Controls

43

Operation

ASCII Programmer’s Guide

Position Loop Limits
Position loop limits are described in Position Mode.

Position Loop Gains Parameters
Parameter ID

Bank

Description

0x30

RF

Pp - Position loop proportional gain.

0x33

RF

Vff - Velocity feed forward.

0x34

RF

Aff - Acceleration feed forward.

0xe3

RF

Position loop gain multiplier. 100 equals a factor of 1.

Filter Parameters
Parameter ID

Bank

Description

0x6b

RF

Velocity loop command filter coefficients.

0x5f

RF

Velocity loop output filter coefficients.

0x150

RF

Second chained biquad filter on the output of the velocity loop (only
available on Plus Products).

0x151

RF

Third chained biquad filter on the output of the velocity loop (only
available on Plus Products).

0x152

RF

First chained biquad filter on the input of the current loop (only
available on Plus Products).

0x153

RF

Second chained biquad filter on the input of the current loop (only
available on Plus Products).

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 coefficients.

1

Set the filter up using CME 2.
•
•

2

44

For Plus Products open the Filter Configuration screen, for all other products, open
the Velocity Loop screen.
Choose the filter type, and parameters, then click Apply, and then close.

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

g r0x6B

Response

For Plus Products, the response is a combination of hex and
Copley Controls

ASCII Programmer’s Guide

Operation

floating point numbers:
V 0x211100c8 0x00010101 1.56119e+00 641467e-01 2.00687e-02 4.01373e-02 2.00687e02
For all other products, the response is nine decimal values:
v -7936 200 0 775 1550 775 -12774 32763 5813

3

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

Response

Copley Controls

For Plus Products, use the combination of hex and floating
point numbers from Step 2:
S r0x6B 0x211100c8 0x00010101 1.56119e+00 641467e-01 2.00687e-02 4.01373e-02 2.00687e02
For all other products, the response is nine decimal values
from Step 2:
S r0x6B -7936 200 0 775 1550 775 -12774
32763 5813
ok

45

Operation

ASCII Programmer’s Guide

4.3: Monitoring Status
Event Status Register (0xa0)
The status register parameter (0xa0) provides drive status information.
0xa0 is read-only, and available in RAM only. Bit mapped values described below:
Bits

Description

0

Short circuit detected.

1

Drive over temperature.

2

Over voltage.

3

Under voltage.

4

Motor temperature sensor active.

5

Feedback error.

6

Motor phasing error.

7

Current output limited.

8

Voltage output limited.

9

Positive limit switch active.

10

Negative limit switch active.

11

Enable input not active.

12

Drive is disabled by software.

13

Trying to stop motor.

14

Motor brake activated.

15

PWM outputs disabled.

16

Positive software limit condition.

17

Negative software limit condition.

18

Tracking error.

19

Tracking warning.

20

Drive has been reset.

21

Position has wrapped. The Position parameter cannot increase indefinitely. After reaching
a certain value the parameter rolls back. This type of counting is called position wrapping
or modulo count. Note that this bit is only active as the position wraps.

22

Drive fault. A drive fault that was configured as latching has occurred. For information on
latching faults, see the CME 2 User Guide.

23

Velocity limit has been reached.

24

Acceleration limit has been reached.

25

Position outside of tracking window.

26

Home switch is active.

27

Set 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

46

Copley Controls

ASCII Programmer’s Guide

Operation

bit won't be set until the next move starts.
28

Velocity window. Set if the absolute velocity error exceeds the velocity window value.

29

Phase not yet initialized. If the drive is phasing with no Halls, this bit is set until the drive
has initialized its phase.

30

Command fault. PWM or other command signal not present.

31

Not defined.

Copley Controls

47

Operation

ASCII Programmer’s Guide

Trajectory Status Register (0xc9)
The trajectory register parameter (0xc9) provides trajectory generator status information.
0xc9 is read-only, and available in RAM only. Bit mapped values described below:
Bit

Description

0-8

Reserved for future use.

9

Cam table underflow.

10

Reserved for future use

11

Homing error. If set, an error occurred in the last home attempt. Cleared by a home
command.

12

Referenced. Set when a homing command has been successfully executed. Cleared by
a home command.

13

Homing. If set, the drive is running a home command.

14

Set when a move is aborted. Cleared at the start of the next move.

15

In-Motion Bit. If set, the trajectory generator is presently generating a profile.

Latching Fault Status Register (0xa4)
The fault register parameter (0xa4) shows latching faults that have occurred.
0xa4 is available in RAM only.
Bit mapped values described below:
Bit

Fault Description

0

Data flash CRC failure. This fault is considered fatal and cannot be cleared.

1

Drive internal error. This fault is considered fatal and cannot be cleared.

2

Short circuit.

3

Drive over temperature.

4

Motor over temperature.

5

Over voltage.

6

Under voltage.

7

Feedback fault.

8

Phasing error.

9

Following error.

10

Over Current (Latched),

11

FPGA 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.

12

Command input lost.

13

Reserved.

14

Safety circuit consistency check failure.

48

Copley Controls

ASCII Programmer’s Guide

15

Unable to control motor current

16

Motor wiring disconnected

17

Reserved.

18

Safe torque off active.

Operation

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).

Copley Controls

49

Operation

ASCII Programmer’s Guide

4.4: Reading Run Time Parameters
This section describes the parameters used to monitor run time conditions.
NOTE: Parameters listed with * are read only.

Current Loop Parameters
Parameter ID

Bank

Description

0x15

R

Commanded current. Units: 0.01 A.

0x0c
0x25

*

Actual current. Units: 0.01 A.

*

Limited current. Units: 0.01 A.

R
R

Velocity Loop Parameters
Parameter ID

Bank

Description

0x2c

R

Commanded velocity. Units: 0.1 counts/second.

0x29
0x18
0x5e
0x2a

*

Limited velocity. Units: 0.1 counts/second.

*

Actual motor velocity. Units: 0.1 counts/second.

*

Actual load velocity. Units: 0.1 counts/second.

*

Velocity loop error. Units: 0.1 counts/second.

R
R
R

R

Position Loop Parameters
Parameter ID

Bank
*

Description

0x32

R

Motor position. Units: counts.

0x17

R

Load position. Units: counts.

0x35

*

R

Following Error. Units: counts.

Position Loop Inputs from the Trajectory Generator
Parameter ID

Bank
*

Description

0x3d

R

Commanded position. Units: counts.

0x2d

R

Limited position. Units: counts.

0x3B
0x3C

50

*

Profile velocity. Units: 0.1 counts/second.

*

Profile acceleration. Units: 10 counts/second2.

R
R

Copley Controls

ASCII Programmer’s Guide

Operation

Miscellaneous System Parameters
Parameter ID
0x1d

Bank

Analog input voltage. Units: mV.

*

Sin input voltage. Units: mV.

*

Cos input voltage. Units: mV.

*

Bus voltage. Units: 100 mV.

*

R

0x1b

R

0x1c

R

0x1e

Description

*

R

0x20

R

Drive temperature. Units: degrees C.

0xb0

R

Phase angle. Units: degrees.

4.5: Reading Digital Inputs
Input Pin States (0xa6)
The high/low states of the drive’s programmable digital inputs can be read using parameter 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. Bit mapped values described below.
NOTE: The number of programmable digital inputs varies depending on drive model. Refer to the
drive’s data sheet for specific information.
Bit

Input

0

Digital Input 1

1

Digital Input 2

2

Digital Input 3

…

…

n

Digital Input n+1

Extended Input States (0x15c)
Same as parameter 0xa6 above, except it is a 32-bit version to accommodate drives with more
than 16 inputs.

Copley Controls

51

Operation

ASCII Programmer’s Guide

4.6: Reading/Setting Digital Outputs
The drives digital outputs can be programmed by CME 2 to reflect the state of any one or more of
the drive’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 parameter, can set an output inactive or active.
The actual level of the output pin however is determined by the Output Configuration parameter.
This parameter sets the actual output pin to be high or low when active. When the drive 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.

Output Configuration (0x70 – 0x77, 0x1a0 – 0x1a3)
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 parameter. Output configurations require 3 or 5 words depending on the
configuration. Refer to the Parameter Dictionary for details.
NOTE: The number of programmable digital inputs varies depending on drive mode. See the
drive’s datasheet for details.
Parameter ID

Memory
Bank

Description

0x70 – 0x77

RF

Output 1 through 8 Configuration.
258 0 = Program Control, Active High
2 0 = Program Control, Active Low

0x1a0 – 0x1a3

RF

Output 9 through 12 Configuration.
Same as Outputs 1through 8

Output States and Program Control (0xab)
Writing the parameter 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.
Reading 0xab gets the active/inactive states of all the drive’s digital outputs, including those which
are not set to program control.
NOTE: The number of programmable digital outputs varies depending on drive model. See the
drive documentation.
Bit

Output

0

Digital Output 1

1

Digital Output 2

52

Copley Controls

ASCII Programmer’s Guide

Operation

…
n

Digital Output n+1

Example
The controller configures 2 outputs for program control, reads the state of the outputs, and then
sets an output low.
Command
s r0x72 258 0

Response
ok

Comment

s r0x73 258 0

ok

Configures output 4 to program control, active low.

g r0xab

v 10

Reads 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 4

ok

4 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.

Copley Controls

Configures output 3 to program control, active low.

53

APPENDIX
5: QUICK REFERENCE TO THE
PARAMETERS

Copley Controls

54

ASCII Programmer’s Guide

Quick Reference to the Parameters

5.1: Parameters by Function
Programmed Current Mode Parameters
0x02

Programmed current value. Units: 0.01 A.

0x6a

Current ramp limit. Units: mA/second.

Analog Current Mode Parameters
0x19

Analog input scaling factor. Units: 0.01 A.

0x26

Analog input dead band. Units: mV.

0x1a

Analog input offset. Units: mV.

PWM Current Mode Parameters
0xa9

Digital input scaling factor. Units: 0.01 A.

0xa8

Digital input command configuration.

Programmed Velocity Mode Parameters
0x2f

Programmed velocity command. Units: 0.1 counts/second.

0x36

Velocity acceleration limit. Units: 1000 counts/second2

0x37

Velocity deceleration limit. Units: 1000 counts/second2

0x39

Fast stop ramp. Units: 1000 counts/second2

Analog Velocity Mode Parameters
0x19

Analog input scaling factor. Units: 0.1 counts/second

0x26

Analog input dead band. Units: mV.

0x1a

Analog input offset. Units: mV.

0x36

Velocity acceleration limit. Units: 1000 counts/second2

0x37

Velocity deceleration limit. Units: 1000 counts/second2

0x39

Fast stop ramp. Units: 1000 counts/second2

PWM Velocity Mode Parameters
0xa9

Scaling Factor. Units: 0.1 counts/second.

0x36

Velocity acceleration limit. Units: 1000 counts/second2

0x37

Velocity deceleration limit. Units: 1000 counts/second2

0x39

Fast stop ramp. Units: 1000 counts/second2

0xa8

Digital input command configuration.

Copley Controls

55

Quick Reference to the Parameters

ASCII Programmer’s Guide

Programmed Position Mode Parameters
0xc8

Profile type

0xca

Position command

0xcb

Maximum velocity. Units: 0.1 counts/second.

0xcc

Maximum acceleration rate. Units: 10 counts/second2.

0xcd

Maximum deceleration rate. Units: 10 counts/second2.

0xce

Maximum jerk rate. Units: 100 counts/ second3.

0xcf

Abort deceleration rate. Units: 10 counts/second2.

Analog Position Mode Parameters
0x19 Analog input scaling factor. Units: counts.
0x26 Dead band. Units: mV.
0xcb

Maximum velocity. Units: 0.1 counts/second.

0xcc

Maximum acceleration rate. Units: 10 counts/second2.

0xcd

Maximum deceleration rate. Units: 10 counts/second2.

0xcf

Abort deceleration rate. Units: 10 counts/second2.

Pulse and Direction Mode Parameters
0xa8 Digital Command Configuration
0xa9 Scaling factor. Output counts/Input pulses.
0xcb

Maximum velocity. Units: 0.1 counts/second.

0xcc

Maximum acceleration rate. Units: 10 counts/second2.

0xcd

Maximum deceleration rate. Units: 10 counts/second2.

0xcf

Abort deceleration rate. Units: 10 counts/second2.

Pulse Up/Down Mode Parameters
0xa8 Digital Command Configuration
0xa9 Scaling factor, Output counts/Input pulses.
0xcb

Maximum velocity. Units: 0.1 counts/second.

0xcc

Maximum acceleration rate. Units: 10 counts/second2.

0xcd

Maximum deceleration rate. Units: 10 counts/second2.

0xcf

Abort deceleration rate. Units: 10 counts/second2.

56

Copley Controls

ASCII Programmer’s Guide

Quick Reference to the Parameters

Quadrature Mode Parameters
0xa8

Digital Command Configuration

0xa9

Scaling factor, Output counts/Input pulses.

0xcb

Maximum velocity. Units: 0.1 counts/second.

0xcc

Maximum acceleration rate. Units: 10 counts/second2.

0xcd

Maximum deceleration rate. Units: 10 counts/second2.

0xcf

Abort deceleration rate. Units: 10 counts/second2.

Homing Mode Parameters
0xc2

Homing Method. See table below for values.

0xc3

Fast Velocity. Units: counts/second

0xc4

Slow Velocity. Units: counts/second

0xc5

Acceleration / Deceleration. Units: 10 counts/second2.

0xc6

Home Offset. Units: counts.

0xc7

Current Limit. Units: 0.01 A.

0xbf

Current Delay Time. Units: milliseconds.

0xb8

Positive Software Limit. Units: counts.

0xb9

Negative Software Limit. Units: counts.

Current Loop Limits Parameters
0x21

Peak current limit. Units: 0.01 A.

0x23

I2T time limit. Units: mS.

0x22

Continuous current limit. Units: 0.01 A.

0xae

Current loop offset. Units: 0.01 A.

Current Loop Gains Parameters
0x00

Current loop proportional gain (Cp).

0x01

Current loop integral gain (Ci).

Velocity Loop Limits Parameters
0x3a

Velocity loop velocity limit. Units: 0.1 counts/second.

0x36

Velocity loop acceleration limit. Units: 1000 counts/second2.

0x37

Velocity loop deceleration Limit. Units: 1000 counts/second2.

0xcf

Fast Stop Ramp. Units: 10 counts/second2.

Velocity Loop Gains Parameters
0x27

Velocity loop proportional gain (Vp).

0x28

Velocity loop integral gain (Vi).

Velocity Loop Filters Parameters
0x6b

Velocity loop command filter coefficients.

0x5f

Velocity loop output filter coefficients.

Position Loop Gains Parameters
0x30

Pp - Position loop proportional gain.

0x33

Vff - Velocity feed forward.

Copley Controls

57

Quick Reference to the Parameters

0x34

Aff - Acceleration feed forward.

0xe3

Position loop gain multiplier.

ASCII Programmer’s Guide

Current Loop Run Time Parameters
0x15

Commanded current. Units: 0.01 A.

0x0c

Actual current. Units: 0.01 A.

0x25

Limited current. Units: 0.01 A.

Velocity Loop Run Time Parameters
0x2c

Commanded velocity. Units: 0.1 counts/second.

0xcb

Profile velocity. Units: 0.1 counts/second.

0x29

Limited velocity. Units: 0.1 counts/second.

0x18

Motor velocity. Units: 0.1 counts/second.

0x5e

Load velocity. Units: 0.1 counts/second.

0x2a

Velocity loop error.

Position Loop Run Time Parameters
0x3d

Commanded position. Units: counts.

0x2d

Limited position. Units: counts.

0x32

Motor position. Units: counts.

0x17

Load position. Units: counts.

0x35

Following Error. Units: counts.

Position Loop Inputs from the Trajectory Generator (Parameters)
0x3b

Profile velocity. Units: 0.1 counts/second.

0x3c

Profile acceleration. Units: 10 counts/second2.

0x2d

Limited position. Units: counts.

Miscellaneous System Parameters
0x1d

Analog input voltage. Units: mV.

0x1b

Sin input voltage.

0x1c

Cos input voltage.

0x1e

Bus voltage. High voltage A/D reading. Units: 100 mV.

0x20

Drive temperature. Units: degrees C.

0xb0

Phase angle. Units: degrees.

0x90

Baud rate

Inputs and Outputs
0xa6 or 0x15c

Read input states

0xab

Read/Write output states.

0x70 thru 0x77
0x1a0 thru 0x1a3

Configure outputs.

Status and State Parameters
0xa0

Status Register.

0xc9

Trajectory Register.

58

Copley Controls

ASCII Programmer’s Guide

0xa4

Fault Register.

0x24

Drive desired state.

Copley Controls

Quick Reference to the Parameters

59

CHAPTER
6: CME 2 ASCII COMMAND LINE TOOL

Copley Controls

60

Copley ASCII Interface Programmer’s Guide

CME 2 ASCII Command Line Tool

The CME 2 ASCII Command Line tool lets users send individual ASCII commands to drives.

1

From the CME 2 Main screen, select Tools->ASCII Command Line from the
menu bar to open the ASCII Command Line screen:

2
3

Enter an ASCII command in the Command field.
Press the Enter key to send the command to the drive. Observe the response in
the Response field.
If a value is returned, it is preceded by the letter “v.” In the following example,
the get command was used to retrieve the RAM value of parameter 0x32
(actual position).

An error code is preceded by the letter “e.” To view an error definition, hold the cursor
over the error number. See Error Codes

Copley Controls

61

CHAPTER
7: SERIAL AND MULTI-DROP
CONNECTION

Copley Controls

62

ASCII Programmer’s Guide

Serial and Multi-Drop Connection

7.1: Connecting
Instructions for hooking up a single-axis connection and a multi-drop network appear below.

Single-Axis Connections
For RS-232 serial bus control of a single axis, set the CAN node address of that axis to zero (0).
Note that if the CAN node address is switched to zero after power-up, the drive must be reset or
power cycled to make the new address setting take effect.

PC, PLC, or HMI
for ASCII Control

Serial
COM port
for
RS-232

9pin D-sub

SER-CK "Serial Cable Kit"

RJ11

Copley Am plifier
w ith ASCII
RS-232

CAN
ADDR
0

ADDRESS MUST BE SET
TO ZERO BEFORE
POWER-UP OR RESET.

Multi-Drop Network Connections
For RS-232 serial bus control of multiple axes, set the CAN node address of the serially connected
drive (gateway) to zero (0). Assign each additional drive in the chain a unique CAN node address
value between 1 and 127. For information on CAN node address, see the drive user guide or data
sheet. Verify that all drives are set to the same CAN bit rate. Use 120 Ω termination on the first
and last drive.
TERMINATION MUST BE
USED ON FIRST AND LAST
NODE

PC, PLC, or HMI
for ASCII Control

Serial
COM port
for RS-232

9pin D-sub

SER-CK "Serial Cable Kit"

RJ11

Copley Amplifier
with ASCII RS-232

CAN
ADDR

120 Ohm
Terminator

CAN Port
0

CAN Network Cable UTP CAT.5E Gigabit Ethernet
RJ45

RJ45

RJ45

CAN Port
1

RJ45

CAN
ADDR

CAN
ADDR

CAN Port
2

CAN
ADDR

RJ45

CAN Port

RJ45
ADDRESSES MUST BE
SET BEFORE POWER-UP
OR RESET.

120 Ohm
Terminator

The CAN Status Light and Multi-Drop Connections
When starting drives on a multi-drop CAN loop, it is common to see a green-green-red flash
sequence on the CAN Status Indicator LED of the first drive to start up. This sequence indicates
Copley Controls

63

Serial and Multi-Drop Connection

Copley ASCII Interface Programmer’s Guide

that the drive has not found any other active nodes on the CAN loop. Under normal circumstances,
this flash sequence does not indicate a problem, and it will clear after the first few commands are
sent to the drive.
To avoid seeing this flash sequence, assure that the gateway drive starts up first. The CAN status
indicator will always be off on node 0.

64

Copley Controls

APPENDIX
A: ERROR CODES

Copley Controls

65

Error Codes

Copley ASCII Interface Programmer’s Guide

Error Codes
Code

Meaning

1

Too much data passed with command

3

Unknown command code

4

Not enough data was supplied with the command

5

Too much data was supplied with the command

9

Unknown parameter ID

10

Data value out of range

11

Attempt to modify read-only parameter

14

Unknown axis state

15

Parameter doesn’t exist on requested page

16

Illegal serial port forwarding

18

Illegal attempt to start a move while currently moving

19

Illegal velocity limit for move

20

Illegal acceleration limit for move

21

Illegal deceleration limit for move

22

Illegal jerk limit for move

25

Invalid trajectory mode

27

Command is not allowed while CVM is running

31

Invalid node ID for serial port forwarding

32

CAN Network communications failure

33

ASCII command parsing error

36

Bad axis letter specified

46

Error sending command to encoder

48

Unable to calculate filter

66

Copley Controls

Copley ASCII Interface Programmer’s Guide
P/N 16-01196
Revision 01
April 2015
 2015
Copley Controls
20 Dan Road
Canton, MA 02021 USA
All rights reserved



Source Exif Data:
File Type                       : PDF
File Type Extension             : pdf
MIME Type                       : application/pdf
PDF Version                     : 1.5
Linearized                      : No
Author                          : 
Company                         : 
Create Date                     : 2015:05:06 10:34:58-04:00
Modify Date                     : 2015:05:06 10:38:17-04:00
Source Modified                 : D:20150506143447
Language                        : EN-US
Tagged PDF                      : Yes
XMP Toolkit                     : Adobe XMP Core 5.4-c005 78.147326, 2012/08/23-13:03:03
Metadata Date                   : 2015:05:06 10:38:17-04:00
Creator Tool                    : Acrobat PDFMaker 11 for Word
Document ID                     : uuid:78546c6b-ef42-42c6-811c-f6e6944312c0
Instance ID                     : uuid:217b89ad-3928-416f-b126-21c0a24ccb70
Subject                         : 77
Format                          : application/pdf
Title                           : Copley Controls
Creator                         : 
Producer                        : Adobe PDF Library 11.0
Page Layout                     : OneColumn
Page Mode                       : UseOutlines
Page Count                      : 67
EXIF Metadata provided by EXIF.tools

Navigation menu