Page 1
PCL-839+ 3-Axis Stepping Motor Control Card User Manual...
Page 2
No part of this man- ual may be reproduced, copied, translated or transmitted in any form or by any means without the prior written permission of Advantech Co., Ltd. Information provided in this manual is intended to be accurate and reli- able.
Page 3
Product Warranty (2 years) Advantech warrants to you, the original purchaser, that each of its prod- ucts will be free from defects in materials and workmanship for two years from the date of purchase. This warranty does not apply to any products which have been repaired or...
Page 4
This product has passed the CE test for environmental specifications when shielded cables are used for external wiring. We recommend the use of shielded cables. This kind of cable is available from Advantech. Please contact your local supplier for ordering information.
Page 9
General Information If you have just purchased the PCL- 839+, or just need to brush up on its features or specifications, you would want to read this chapter. Sections include: • Introduction • Features • Applications • Specifications • Block Diagram...
Chapter 1 General Information 1.1 Introduction The PCL-839+ is a high-speed three-axis stepping motor control card that simplifies stepping motor control, giving you added performance from your stepping motors. Three-Axis Control The PCL-839+ has three single-chip pulse generators on-board, which enables the simultaneous and independent control of three axes.
1.2 Features • Three on-board pulse generators that enables simultaneous independent control of three stepping motors • Two operating modes - two-pulse (+ and - direction pulse) or one-pulse (pulse-direction) mode • Programmable step rate from 1 to 200k pps (pulses per second). •...
1.4 Specifications • Number of axes: Three independent axes (individually programmable) • Operating modes: Two-pulse mode (+ or – direction) or one-pulse (pulse-direction) mode • Steps per command: ±16777215 steps • Step Rate: 1-200K • Acceleration/deceleration ramping: User programmable start, run and ramping rates.
1.5 Block Diagram Address Address Decoder DATA DIR & PCL-AK OUTPUT PULSE STEPPING MOTOR ISOLATOR OUTPUT Buffer CONTROLLER PCD-4541 ORG,EL+, INPUT EL- & ISOLATOR FUNCTION SD+,SD- DECODER INPUTS IRQ Selecteor DIGITAL OUTPUTS BLOCK DIGITAL INPUTS PCL-839+ HIGH SPEED STEPPING MOTOR CONTROL CARD Figure 1.1: PCL-839+ 3-Axis Stepping Motor Control Card Chapter 1...
Page 15
Installation If you have not yet configured and/or installed your PCL-839+, or need to change the configuration (e.g. set a dif- ferent base address), this chapter will give you the information you require. Sections include: • Switch and Jumper Settings •...
Chapter 2 Installation 2.1 Switch and Jumper Settings Before you install the PCL-839+, you need to select the card's base address, and set the limit switch configurations as well as the interrupt level that the card will use. This section describes this procedure in detail. 2.1.1 Setting the PCL-B39 Base I/O address (S1) The PCL-839+ requires 16 consecutive I/O addresses.
SWITCH Line Figure 2.1: S1 - Base Address Setting 2.2 Limit Switch Configuration (JP1, JP2, JP3) The PCL-839+ features 5 limit switches for additional control of the out- put. 2.2.1 EL+/ EL These are the End Limit signal inputs. When the signal of the same direc- tion as the pulse output (in direction or pulse mode) becomes active, pulse output stops immediately.
2.3 Limit Switch Polarity Setting JP1, JP2 and JP3 set the polarity for channels C, B and A respectively. When the jumper is set to LO (normal), the limit switch uses 'normally open' as default. When the jumper is set to HI, the limit switch uses' nor- mally closed' as default.
LCOM PCL-839+ +5V ~ +12V Limit switch is -- normal open type Limit switch polarity jumper (JP1,2,3) must be put to -- LO position Figure 2.3: Normally-Open Wiring PCL-839+ LCOM +5V ~ +12V EL + EL - Limit switch is -- normal close type Limit switch polarity jumper (JP1,2,3) must be put to -- HI position Figure 2.4: Normally-Closed Wiring Chapter 2...
2.3.2 Interrupt Level Selection (JP4) You have to set jumper JP4 to select the card's interrupt level (2, 4, 5, 7, 10, 11, 12 or 15), as shown below: Card interrupt (default = 7) Figure 2.5: Setting the Interrupt Level Do not select a level that is being used by another device unless you have performed special programming to share several devices on one interrupt.
2.4.1 Installing the Card in Your Computer: • Turn off the computer and all peripheral devices (such as printers and monitors). • Disconnect the power cord and any other cables from the back of the computer. Turn the chassis so that the back of the unit faces you. •...
COM : Isolated outputs common point for each channel EL+ : (+) Direction emergency stop limit switch input EL- : (-) Direction emergency stop limit switch input SD+ : (+) Direction slowdown limit switch input SD- : (-) Direction slowdown limit switch input ORG : Original (home) point limit switch input LCOM :...
EXT.VC PULSE/+dir PULSE Stepping Motor DIR/-dir Driver Figure 2.7: Non-Isolated 12 V Bias Connection The next two figures illustrate a TTL compatible output circuit connec- tion and a current-drive output connection between the PCL-839+ and the stepping motor driver. EXT.VC PULSE/+dir PULSE Stepping...
EXT.VC Stepping motor driver PULSE PULSE Figure 2.9: Current Driver Output Connection 2.5.3 Digital Input and Output Connectors (CN1, CN2) The PCL-839+ provides two 20-pin digital input and output connectors, located at CNI (digital output) and CN2 (digital input). A variety of daughter-boards can be connected to these connectors.
Page 27
PCL-839+ Software Library This chapter describes the 'C' libraries and the functions they contain. If you want to write your own applications in 'C', this chapter will give you all the information you need. Sections include: • Introduction • The PCL839P.H Header File •...
Chapter 3 PCL-839+ Software Library 3.1 Introduction On the floppy disk that came with your PCL-839+ card, there are 'C' library files. These libraries were developed in 'Turbo C', and you should be able to develop your own stepping motor applications (in 'C') using these files.
Page 29
int CH13 = 5 ; /* Channel #1 & #3 */ int CH23 = 6 ; /* Channel #2 & #3 */ int CH123 = 7 ; /* Channel #1,#2 and #3 */ int P_DIR = 0 ; /* Positive (+) dirction */ int N_DIR = 1 ;...
3.4 Function Call Descriptions This section gives a detailed description of the functions available in the library files. There are 15 functions in the PCL839 library. They are the following: 3.4.1 Function 1: set base This function sets the base address of the PCL-839+. This enables the use of multiple PCL839s, if you require doing so.
3.4.2 Function 2: set mode This function sets the output mode for a channel, or a group of channels. Prototype: int set_mode (int ch, int mode); Parameters: channel number1 for channel 1 2 for channel 2 3 for channel 3 4 for channels 1 &...
3.4.3 Function 3: set_speed This function sets the low-speed pulse output frequency, high-speed pulse output frequency and acceleration/deceleration rate for a channel. Prototype: int set_speed(int ch, int FL, int FH, int AD); Parameters: channel number (See Function 2). Low-speed frequency1 - 16382 pps. High-speed frequency1 - 16382 pps.
3.4.4 Function 4: status This function reads and returns the status of a channel. Prototype: int status(int ch); Parameters: channel number 1 - channel 1 2 - channel 2 3 - channel 3 Return values: -1: An error occurred Other: The high byte will contain the value of 'Status 1' and the low byte the value of 'Status 0'.
3.4.5 Function 5: stop This function stops channel ch. Prototype: int stop(int ch); Parameters: channel number (See Function 2). Return values: 0: No error occurred 1: An error occurred Example(s): int error_code; error_code = stop(CH123) ; Channels 1, 2 and 3 are stopped. Chapter 3...
3.4.6 Function 6: slowdown This function ramps the output frequency of channel(s) ch down to FL. Prototype: int slowdown (int ch) Parameters: channel number (See Function 2). Return values: 0: No error occurred -1: An error occurred Example(s): int error_code = slowdown(CH23) ; Channel 2 and 3's speed is ramped down to FL.
3.4.7 Function 7: sldn_stop This function ramps the output frequency of channel(s) ch down to FL. Prototype: int sldn_stop(int ch); Parameters: channel number (See Function 2). Return values: 0: No error occurred -l: An error occurred Example(s): error_code = sldn_stop(CH 12); Channels t and 2's are ramped down to FL, and then stopped.
3.4.8 Function 8: waitrdy This function checks the 'Stares0' of channel(s) ch and waits until bit 6 of 'Status0' is 0 Prototype: int waitrdy (int ch) Parameters: channel number (See Function 2). Return values: 0: No error occurred -1: An error occurred Example(s): error_code = waitrdy (CH12);...
3.4.9 Function 9: out_port This function outputs a value to the assigned port . Prototype: int out_port(int port_no, int value) ; Parameters: port_no: digital output port number 0 for port 0 (DO7-0) 1 for port 1 (DO15-8) 2 for ports 0 & l If port_no was set as “2”...
3.4.10 Function 10: in_port This function reads and returns the value of a digital input port. Prototype: int in_port (int port_no) ; Parameters: port_no: D/I port number 0 for port 0 (DI7-0) 1 for port 1 (DI15-8) 2 for ports 0 & 1 If port_no was set as “2”...
3.4.11 Function 11: org This function returns all three channels to the 'ORIGIN' point. The direc- tion and speed (frequency) that each channel has to use are supplied. Prototype: int org(int ch, int DiR1, int SPEED1, int DIR2, int SPEED2, int DIR3, int SPEED3) ;...
3.4.12 Function 12: cmove This function starts channel(s) ch in continuous mode. Channel 1 will move in DIR1 direction at SPEED1 speed, etc. The channel(s) will stay in continuous move mode until 'stop' or 'stdn_stop' is executed. Prototype: int cmove (int ch, int DIR1, int SPEED1, int DIR2, int SPEED2, int DIR3, int SPEED3);...
3.4.13 Function 13: pmove This function starts channel(s) ch in continuous mode, for a certain amount of steps. Channel 1 will move in DIR1 direction at SPEED1 speed and will stop when it has completed STEP 1 steps, etc. Prototype: int pmove (int ch, int DIR1, int SPEED1, long STEP1, int DIR2, int SPEED2, long STEP2, int DIR3, int SPEED3, long STEP3);...
3.4.14 Function 14: line If you are using two stepping motors simultaneously (in a plotter-type configuration), you can move to position (X, Y) from the current position, (0, 0). Both axes are measured in steps. Prototype: int line(int ch_plan, int X, int Y); Parameters: ch_plan channel numbers CH12 for channels 1 &2 CH13 for channels 1 &3...
3.4.15 Function 15: arc If you are using two stepper motors simultaneously (in a plotter-type con- figuration), you can "draw an arc" from (X1, Y1) to (X2, Y2) Prototype: int arc (int ch_plan, int dir, long X1, long Y1, long X2, long Y2); Parameters: ch_plan: channel numbers CH12 for channels 1&2 CH13 for channels 1&3...
Page 46
Example(s): error_code = arc (CH13, 1, 200, 50, 50, 200) ; (50,200) (200,50) (0,0) Current position Central point of ARC PCL-839+ User Manual...
Page 47
Register Programming This chapter describes the PCL-839+'s hardware registers. It also contains typ- ical operational procedures that will assist you in program design. This chapter is a good place to start getting to know and use the capabilities of the PCL-839+ to best suit your application.
Chapter 4 Register Programming 4.1 PCL-839+ Registers Several registers are used to control the PCL-839+. The PCL-839+ uses these registers to store commands, speed, mode, number of pulses etc. The following sections describe these registers in detail. 4.1.1 R0 : Down-Counter (24 bits) The down counter counts down when a pulse is output in manual mode, origin mode or preset mode.
4.1.2 R1: FL Register (13 bits) This register is used to set the FL (initial/low) speed. When started in high-speed mode, the generator starts at FL and ramps up to reach FH (Final/High speed). If the deceleration-stop command is received during high-speed operation, it ramps down to FL speed and then stops.
4.1.4 R3: Acc. / Dec. Rate Register (10 bits) This register is used to set acceleration (ramping up) and deceleration (ramping down) characteristics. During high-speed mode, the generator starts at FL and accelerates to FH. If the reference clock frequency is (TCLK)[sec], TSUD(the time required for the ramping-up/ramping-down) is: TSUD = [(R2)-(R1)]x (R3)x(TCLK) x Multiplier [sec] Alternatively, if the ramping-up/ramping-down time is known, R3 can be...
4.1.5 R4: Multiplier Register (10 bits) For the speed registers, Rl and R2, a number of steps can be selected (1 to 8191). This register (R4) is used to assign an output frequency for one step. The reference clock inputted through the CLOCK terminal is divided and multiplied by the variable frequency divider and the fre- quency multiplier, and then outputted to the PULSE OUTPUT terminal.
Page 52
The range for R5 is 0001 (hex) to FFFF (hex) (1 to 65535 in decimal). The ramping-down point is set in pulses. * Setting of the ramping-down point When determining the ramping-down point, the FL frequency, the FH frequency and the deceleration rate has to be taken into account. If an improper value is set, pulse output may be terminated halfway during ramping-down (Fig.
Page 53
Tsd [sec], the time required for the deceleration is: Tsd = [(R2)-(R1)]x(R3) x Multiplier /(CLOCK) (1) where CLOCK = 4.9152 MHz The relationship between the set value on speed register (Rf) and output frequency (F [PPS]) is: F = (Rf)x(CLOCK)/[8192x(R4)] (2) Therefore, FL output frequency FL [PPS] and FH output frequency FH [PPS] are: FL = (Rl)x(CLOCK)/[8192x(R4) ] (3)
Psd, the number of pulses during T, [sec] is represented by the area of the trapezoid A-B-C-F: Psd = {[(FL) + (FH)]*Ted}/2(5) Substitute equations (1), (3) and (4) into equation (5): Psd = {[(R2) – (R1) ] x (R3) x Multiplier } / [16384 x (R4)] When output 5 pulses at FL speed after the completion of the ramping- down, the set value of the ramping-down point register (R5) is (R5) = Psd +5...
4.2 Programming the PCL-839+ The PCL-839+ stores a selected command in a buffer. This command remains there until a new command is received. The only command that can be RESET is the 'starting mode' command. 4.3 I/O Register Control Format The following table depicts the PCL-839+ register’s I/O address map.
Page 56
Table 4.1: Register I/O Address Map Axis Offset Definition Address 0x08 Write Command Buffer Read Status0 0x09 Write Data Register (Lower°GBit7 To Bit0) Read Internal Data (Lower) 0x0A Write Data Register (Middle°GBit15 To Bit8) Read Internal Data (Middle) 0x0B Write Data Register (Upper°GBit23 To Bit16) Read Internal Data (Upper)
4.4 Command Buffers: WRO, WR4 and WR8. Each of the three channels has a command buffer that enables individual programming. Channel l's command buffer is BASE + 0, Channel 2's is BASE + 4 and Channel 3's is BASE + 8. A command can be written to any of the three buffers, and the appropriate channel will respond to the command.
4.5 Commands The following sections describe all the available commands and their parameters in detail. 4.5.1 Start-Stop Command Frequency Selection 0: Use FL frequency 1: Use FH frequency 0: Constant speed mode 1: High Speed mode 1:Start/stop control 0: Stop interrupt reset 1: Stop interrupt enable Constant speed operation with the FL register.
Page 59
Dual rate operation (ramping down). Frequency ramps down to the level of the FL. 0 (no output of INT signal at stop) 1 (output of INT signal at stop) Decelerating stop (reset command is required after stop). Frequency ramps down to the rate of the FL, then stops. Reset command.
4.5.2 Operation Mode Select Command 1: ORG signal enable 1: SD+ signal enable 1: Preset enable 0: (+)direction 1: (-)direction Manual mode. Operation initiated in the start mode continues until the stop command is transferred. Origin return mode. Operation initiated in the start mode continues until the mechanical origin signal or stop command comes.
Page 62
Ramping-Down Point Interrupt Control This bit controls whether or not the INT signal is output when the ramp- ing-down point is reached. When this bit is 1 and the preset counter value becomes smaller than the ramping-down point setting in R5, it will output an INT signal.
4.6 Read Status Users can set the standard monitor or extension monitor by the “Output mode select command” Mode Address\ RD0, RD1, RD2, RD3, RD7, Register RD4, RD5, RD6, RD11 RD10 Standard Status0 R0 lower R0 mid- R0 upper byte Monitor byte dle byte...
4.6.1 Channel Status Buffers (RD0, RD4 and RD8) There is a status buffer for each channel (status 0). These buffers are found at BASE +0, BASE +4 and BASE +8 for channel 1, channel 2 and channel 3 respectively. These buffers enable you to read the internal sta- tus of each channel, and also get certain information on input signals or conditions.
4.6.4 Data Buffers: WR3, WR4 and WR11 One data-buffer for each channel is found at BASE+3, BASE+7 and BASE+I 1, for channel 1, channel 2 and channel 3 respectively. When writing (output), these buffers contain data bits 16 -24 of the respective channels.
Monitor -PO terminal 0: Off 1: On Monitor +PO terminal 0: Off 1: On Monitor interrupt (each axis) 0: No interrupt, 1: Interrupt occurred Figure 4.4: Status 2 Bit Configuration For the value of Status3, it should be “0100-0000”, which represents the PCD4541 chipset.
4.6.5 Digital Outputs: WR12 and WR13 WR12 is the low byte of the digital output and WR13 the high byte. To write to these buffers write to BASE12 and BASE13 respectively. The bit definition is as follows: WR13 WR12 4.6.6 Digital Inputs: RD12 and RD13 RD12 is the low byte of the digital input, and RD13 the high byte.
4.6.7 Interrupt Control: WR14 WR14 is the interrupt control register for the PCL-839+, and is found at BASE +14. Only one bit, b0, of the byte is used. When b0=1, interrupts are enabled, and when b0-0, disabled, ifb0=1, and the channel-interrupt of the specific channel is also enabled (see Start-Stop command, bit 5), an interrupt will be generated when that channel reaches its 'stop position'.
4.7.4 High Speed Preset Mode Ramp dow n at set point Stop at pre- set count Execute the reset Command buffer <- 00001000(08H) command For(+)direction: command buffer <- 01000100(44H) Effect the ramping mode For(-)direction: command buffer <- 01001100(4CH) and select the direction Command Buffer <- 10000000(80H) Select the counter Register bits 7-0 <- data, low -order 8 bits...
4.7.5 Constant Speed Continuous Mode Immediate stop command Execute the reset Command buffer <- 00001000(08H) command For(+)direction: command buffer <- 01000000(40H) Effect the manual mode For(-)direction: command buffer <- 01001000(48H) and set the direction Enter the start For FL: Command Buffer <- 00010000(10H) command For FH: Command Buffer <- 00010001(11H) Enter the immediate...
4.7.6 High Speed Continuous Mode Deceleration- stop command Stop after deceleration Execute the reset Command buffer <- 00001000(08H) command For(+)direction: command buffer <- 01000000(40H) Effect the manual mode For(-)direction: command buffer <- 01001000(48H) and select the direction Enter the start For FH: Command Buffer <- 00010101(15H) command Enter the deceleration...
4.7.7 Constant Speed Origin Return Mode Stop by origin sw itch = ON Execute the reset Command buffer <- 00001000(08H) command Effect the origin return For(+)direction: command buffer <- 01000001(41H) mode and select the For(-)direction: command buffer <- 01001001(49H) direction Enter the start For FH: Command Buffer <- 00010000(10H) command...
4.7.8 High Speed Origin Return Mode Ramp dow n by SD sw itch = ON Stop by origin sw itch = ON Execute the reset Command buffer <- 00001000(08H) command Effect the origin return For(+)direction: command buffer <- 01000011(43H) mode and set the For(-)direction: command buffer <- 01001011(4BH) direction Enter the start...
Page 79
Diagrams This chapter provides diagrams for some of the major functions of PCL- 839+. Sections include: • Jumper and Switch Layout • PCL-839+ Block Diagram • Output Circuit Diagram...
Appendix B Simple St. Motor Driver Full/Half step select PULSE Power Pattern Stepping Control Encoder Motor Circuit DIRECTION DC Power of Motor DC Power of Control Circuit Figure B.1: Simple Stepping Motor Driver Block Diagram 4.7K Pulse Direction POWER CONTROL CIRCUIT HALF FULL 18CV8...
[0001] FB=1 FB=1 FB=0 FB=0 [1000] 0010 FB=0 FB=1 FB=0 FB=1 [0100] Output Pattern = [OD OC OB OA] FH = 1 in all states Figure B.3: JP1 at Full Step Control Appendix B...