PIC-SERVO 3PH Motor Control Board For 3-Phase Brushless & Brush-type DC Motors

____ PIC-SERVO 3PH Motor Control Board _________ J R KERR For 3-Phase Brushless & Brush-type DC Motors AUTOMATION ENGINEERING The PIC-SERVO 3PH Moto...
Author: Harry Barrett
1 downloads 1 Views 63KB Size
____ PIC-SERVO 3PH Motor Control Board _________ J R KERR

For 3-Phase Brushless & Brush-type DC Motors

AUTOMATION ENGINEERING The PIC-SERVO 3PH Motor Control board is a full-function servo control system with the following features: • PIC-SERVO CMC chipset providing servo control of DC motors with incremental encoders, including trapezoidal, velocity profiling and support for coordinated multi-axis motions. The PIC-SERVO board may also be used with the standard PIC-SERVO chipset. • On-board amplifier for 3-Phase brushless motors (with 3 hall effect sensors) or conventional brush-type motors. Advanced commutation reduces 3-phase torque ripple. • 10 amp maximum current, 12 to 48vdc supply voltage (36 max. recommended). Complete overcurrent, undervoltage, and thermal protection. • RS485 serial interface allows up to 32 controllers to be controlled from a single serial port. Connects to an RS232 port through commonly available full-duplex adapters or using the Z232485 converter board. • Two general purpose I/O bits for limit switch inputs or control outputs. Encoder index input. • Small size (3.1" x 3.1") allows it to be mounted near motors, reducing noise and simplifying wiring. • Windows test software provided including Windows 95/98/NT DLL and C source code. DOS based C code and Basic code are also available.

1. Quick Start What you will need: PIC-SERVO 3PH Motor Control Board Z232-485 Converter Board (or equivalent)

Brushess Motor, 3-phase with hall effect sensors and incremental encoder -orConventional DC brush motor with incremental encoder Motor power supply (12v min. - 36vdc max. recommended) Logic power supply (10 - 16vdc, 500 ma) Note: a 9 to 12vdc unregulated supply may be used Motor & encoder cables 10 pin flat ribbon cable with standard IDC socket connectors at both ends Straight DB9 male / DB9 female cable to PC COM port PC compatible computer running Windows Test software - NMCTest for Windows95/98/2000/NT (available for download from http://www.jrkerr.com) CAUTION The PIC-SERVO 3PH Motor Control Board does not incorporate safeguards for fail-safe operation. As such, this board should not be used in any device which could cause injury, loss of life, or property damage. J.R. Kerr makes no warranties whatsoever regarding the performance, operation, or fitness of this board for any particular purpose. J R KERR

A U T O M A T I O N ENGINEERING

• www.jrkerr.com

Most of the cables are available from computer or electronics stores. However, you will probably have to make your own motor/encoder cable to connect to your particular motor. Refer to Section 2.1 for the connector pin definitions. To start off, connect your encoder to connector P3 and your hall effect sensors to connector P5. If you are using a brush-type DC motor, do not connect anything to connector P5. Your motor leads will connect to the three-position screw terminals marked P2. If you are using a brush-type motor, you will connect the leads to just the first two positions on this screw terminal. Because there is not standard for the exact order of phase commutation, you will most likely have to re-arrange your motor leads by trial and error once you start testing. Even with brush-type motors, there is a 50-50 chance you will have to reverse the motor leads to get the polarity right. Interconnections and Jumpers: Basic interconnections and jumpers are shown in Figure 1 for both a single controller and for a multiple controller configuration. On the Z232-485 converter, jumpers JP3 and JP4 are installed in the 1-2 position for use as a simple converter. (Please refer to the Z232-485 documentation for use with the optional standalone processor cards.) Jumper JP5 is installed to distribute logic power to the controller boards over the communications cable. Logic power (10 - 16vdc) is supplied on connector JP6. (If you are using a different type of serial port adapter, you may supply power to connector JP8 on the PIC-SERVO 3PH board.) On the PIC-SERVO 3PH controller board, jumpers JP6 and JP7 are installed to connect logic power supplied by the communications cable to the board’s logic supply. In the single controller configuration, the three jumpers labeled JP3, JP4 and JP5 should be installed as shown. In the multiple controller configuration, these jumpers should only be installed on last controller, furthest from the PC host. On all intermediate controllers, jumpers at JP3, JP4 and JP5 should be left uninstalled. Jumper JP9 should be in the 1-2 position. Motor power should be connected to the two position screw terminals, P1, with 12 - 36vdc connected to the terminal towards the upper edge of the board and GND connected to the terminal towards the center as shown in Figure 1. Caution: Please read Section 3.3, Motor Power Supply before proceeding to prevent damage to your board. Because the logic power supply, the motor power supply, and your host computer are all connected with a common ground, we recommend that your motor power supply and your logic power supply have floating outputs to avoid ground loops. Loading and Running Software: First unzip NMCTEST.ZIP into a single directory. Before starting up the test code, make sure all of your jumpers and interconnections are as shown in Figure 1. Also make sure you have logic power supplied to the Z232-485 converter. Run the program NMCTest.exe. Select the correct COM port when prompted (leaving the default baud rate at 19200 for now). If you are using a different COM port, you will get an error message saying no modules were found. If this is the case, click on the Reset Network button and set the COM port to the correct value. The program will attempt to locate controllers on the RS485 network and will respond with the number of controllers found. If the number of 2 J R KERR A U T O M A T I O N ENGINEERING • www.jrkerr.com

controllers reported does not match the number connected, re-check the interconnections, jumpers and power, and then try again. The list box on the left side of the window will display the list of motors found. Module 1 will be the last controller which is furthest from the host PC. Clicking on different controllers will display the status and controls for that particular motor. Click on the PIC-SERVO module you are testing and spin the motor shaft by hand. See that the position changes accordingly in the status panel. Before testing the servo, make sure that the motor is disconnected from any mechanism so that it is able to spin freely. To test the servo, first turn on the motor power. Next, click on the Enable Amplifier box in the Motion Command panel. You should see the Motor Power box checked in the status panel when both the motor power is on and the amplifier is enabled. Next, you will need verify that your brushless motor leads are connected in the proper order, and rearrange them if they not. (Skip to the next paragraph if you are using a brush motor.) Select PWM mode, type in a value of 64 (about 25% of full voltage), and click on the GO button. If the motor does not spin, click the Motor Off button and try a different arrangement of the motor leads (there are a total of 6 possible arrangements). If the motor does spin, try entering a value of -64, and see if the motor spins at approximately the same speed in the opposite direction. If it does not, you still don’t have it right - try a different lead arrangement. When the motor is connected correctly, it will spin smoothly with equal ease in both directions. At this point, the commutation is correct, but the motor still may be rotating backwards in relation to the encoder. You can check this by looking at the motor velocity when you run in PWM mode with a PWM value of +64: the velocity reading should be negative. If the velocity value reads positive, the polarity is reversed and you have two choices for fixing it: 1) you can swap the encoder Channel A and Channel B wires, effectively making the encoder count in the other direction, or 2) rearrange both the hall effect sensor wires and the motor lead wires until the commutation is correct and the polarity with respect to the encoder is correct. (For brush motors, you can simply reverse the encoder wires or reverse the motor leads to correct any polarity mismatch.) Finally, click on the STOP! button to enable the position servo. Try turning the motor shaft by hand. (If the motor jerks and stops, or spins out of control, you probably still have the motor and encoder polarities reversed.) The motor should attempt to hold a fixed position. If it does, click on Pos mode, type in a position value of 1000, and then click on GO. The motor should move to position 1000 (or close to it, depending on how the gains are set). Try moving to several different positions until you are satisfied that the motor is moving as it should. (Note that if your motor has a gearhead, the motion of 1000 counts may produce an imperceptibly small motion, and you should use a larger number instead.) The control gains, and maximum velocities and accelerations are set to default values which are reasonable for most small motors. Please refer to the PIC-SERVO datasheet for details on the values for the gains, velocities and accelerations. The online help also has a great deal of information about the PIC-SERVO controller.

J R KERR

A U T O M A T I O N ENGINEERING

• www.jrkerr.com

3

Single Controller Configuration PIC-SERVO 3PH Motor Controller

12-48VDC Z232-485 Converter

GND JP1

JP2

JP5

Straight M/F to PC COM Port

1 JP3

1 JP4

P4 P3

JP7 JP6

JP1 10 wire ribbon cable

To Motor

JP5

JP3 DB9

Phase 1 Phase 2 Phase 3

JP4

+9v JP6 GND

P5

JP8 JP2

Multiple Controller Configuration NMC Control Module JP1 JP4

JP7

JP3

JP5

JP8 JP6 JP2

JP1 JP4

JP7

JP3

JP5

JP8 JP6 JP2 Z232-485 Converter JP1

JP2

+9v JP6 GND DB9

JP4

JP7

JP3

JP5 JP1

JP5

JP8 JP6

Straight M/F to PC COM Port

1 JP3

1 JP4

10 wire ribbon cable

JP2

CAUTION: Connecting communications cables incorrectly, or installing jumpers JP3, JP4 and JP5 (on the PIC-SERVO board) in the wrong location may damage the PIC-SERVO or other NMC controller chip! Figure 1 - Basic Interconnections. J R KERR

A U T O M A T I O N ENGINEERING

• www.jrkerr.com

4

2. Connectors and Jumpers 2.1 Pinouts Motor Power Connector P1 Pin Definition 1 Motor Power Supply 12 - 36vdc (48v absolute max.) - near top edge of board 2 Motor Power Supply Ground (connected internally to logic ground) Logic Power Connector JP8 (1x2 pin header - 0.100” spacing) (Use only if logic power is not supplied via the network communications cable.) Pin Definition 1 10 - 16vdc (towards the lower edge of the board) Note: a 9 to 12vdc unregulated supply may be used 2 Ground Motor Connector P2 (3 position screw terminals) Pin Definition 1 Phase 1 for 3-phase motors, M+ for brush-type motors 2 Phase 2 for 3-phase motors, M- for brush-type motors 3 Phase 3 for 3-phase motors Hall Effect Sensor Connector P5 (1x5 pin header - 0.100” spacing) Pin Definition 1 +5v output 2 Hall sensor 1 3 Hall sensor 2 4 Hall sensor 3 5 Ground Encoder Connector P3 (1x5 pin header - 0.100” spacing) Pin Definition 1 +5v output 2 Channel A 3 Channel B 4 Index 5 Ground Limit Switch Connector P4 (1x5 pin header - 0.100” spacing) Pin Definition 1 +5v output 2 Limit switch 1 3 Limit 1 return (Ground) 4 Limit switch 2 5 Limit 1 return (Ground)

J R KERR

A U T O M A T I O N ENGINEERING

• www.jrkerr.com

5

Network Connectors JP1, JP2 (2x5 pin header - 0.100” spacing) Pin Definition 1 RCV+ 2 RCV3 XMT+ 4 XMT5 ADDR_IN on JP1, ADDR_OUT on JP2 6 Ground 7 Logic power (10 - 16vdc) 8 Ground 9 Logic power (10 - 16vdc) 10 Ground 2.2 Jumpers Jumper Description JP3 Connects ADDR_IN to GND. Insert jumper for the last controller board on the network (or if only 1 controller is used) JP4, Enables termination resistors on RX and TX. Insert these jumpers for the last JP5 controller on the network (or if only 1 controller is used). JP6,JP7 Logic power interconnection. Inserting JP6 connects logic power to network connector JP2. Inserting JP7 connects logic power to JP1. These are used to control the distribution of logic power over the network cables. Normally both these jumpers are installed. JP9 Install this jumper in the 1-2 position (jumper towards bottom edge of board) to enable 12 step commutation (default). Install in the 2-3 position to use 6 step commutation only. 2.3 Ordering Information Part Number Description KAE-T0V5-BD3PHV1 PIC-SERVO 3PH Motor Controller Board with PIC-SERVO CMC KAE-T0V4-BD3PHV1 PIC-SERVO 3PH Motor Controller Board with standard PIC-SERVO

3. PIC-SERVO Motor Control Board Description The PIC-SERVO 3PH Motor Control board is a complete motor servo control system including a servo controller, amplifier, serial communications interface, optical encoder interface, limit switch inputs, and an auxiliary analog input with pre-amplifier. The board is designed so that up to 32 controllers can be connected directly to a single standard serial port (using an RS232-RS485 converter if necessary). 3.1 PIC-SERVO CMC Chipset The PIC-SERVO CMC chip set forms the core of the controller. The PIC-ENC performs the time critical encoder counting task, while the PIC-SERVO executes the servo control, the communications interface, and outputs a 20 KHz PWM and Direction signal to the amplifier. Please refer to the PIC-SERVO and PIC-SERVO CMC chipset data sheets for complete details on J R KERR

A U T O M A T I O N ENGINEERING

• www.jrkerr.com

6

the theory of operation of the servo control and motion profiling algorithms. You should also refer to the PIC-SERVO Programmer's Application Note for details on sending commands and receiving data from the PIC-SERVO. The PIC-SERVO CMC provides support for coordinated motion control. For simpler applications not requiring coordinated motion, the PIC-SERVO 3PH board may also be used with the standard PIC-SERVO chipset. 3.2 Communications Interface The PIC-SERVO 3PH uses an RS485 multi-drop interface for allowing multiple control modules to communicate over the same RS485 communication port. The host computer sends commands out over a dedicated pair of transmit wires, and all data comes back over a shared pair of receive wires. Because the host has a dedicated transmit line, a standard RS232 serial port can be used with simple RS242-RS485 converter. With multiple controllers on a single network, each controller must have a unique address for sending commands. Rather than using dip switches or jumpers to assign addresses, the PICSERVO 3PH uses a method of daisy-chaining an ADDR_IN signal and an ADDR_OUT signal for dynamically assigning addresses. With the controllers interconnected as shown in Figure 1, the ADDR_OUT signal of one board is connected to ADDR_IN of the next board. The very last board has ADDR_IN jumpered to GND. On power-up, all boards with ADDR_IN held high will have their communications disabled. Therefore, only the last board will be able to communicate with a default address of 0. To initialize the network, a command is sent to the last controller (with address 0) to change its address to a value of 1. This has the side effect of causing its ADDR_OUT to lower, enabling communications with the next controller. The next command sent to address 0 will now be sent to the second-to-last controller. This process of assigning addresses is repeated until all controllers have been given a unique address. 3.3 Amplifier The amplifier on the PIC-SERVO 3PH board is capable of driving 3-phase brushless motors or conventional brush-type DC motors. The commutation circuitry will check to see if hall effect sensors are connected at connector P5. If they are, it commutates the motor as a 3-phase brushless motor. If nothing is connected to P5, the commutator will only drive pins 1 and 2 of the motor connector P2 to work with a regular 2-wire brush-type DC motor. The transistors of the amplifier are connected to an aluminum heat-sink bar. If you are driving more than 3 amps continuously, this bar should be attached to an additional heat-sinking surface. Overcurrent & Thermal Protection The amplifier is capable of driving up to 7 amps continuously and 10 amps maximum,* with a supply current of 12 to 48vdc (36v recommended). It uses self-protecting transistors which will *

The 7 amp continuous current limit is imposed by the current sense resistor, which only draws current while the PWM signal is HIGH. This resistor can handle 10 amps for about a minute. Therefore, only applications which run at full current and at high speeds for long periods need adhere to the 7 amp limit, and the PIC-SERVO’s current limit parameter should be set accordingly.

J R KERR

A U T O M A T I O N ENGINEERING

• www.jrkerr.com

7

limit the current to 10 amps and with automatic thermal shutdown. If you attempt to drive more than 10 amps, the transistors will go into “linear” mode, effectively increasing their resistance to keep the current at a maximum of 10 amps. The transistors will heat up very quickly in this mode, and automatic thermal shutdown will take place after a few seconds. Thermal shutdown will also take place if the heat sinking is insufficient, even at currents less than 10 amps. Once the transistors cool, they will resume normal operation automatically. The amplifier also has undervoltage protection. Motor Power Supply The PIC-SERVO 3PH amplifier does not have over-voltage protection, so you must take care that your power supply does not exceed the rated voltage. The recommended supply voltage of 36v max. will allow you to mostly ignore the finer points of power supply regulation. The absolute maximum supply voltage rating is 48v. If you do need to use a supply voltage in the 36 to 48v range, the use of a linear power supply with a regulated output is recommended. If you are using an unregulated power supply, you must ensure that the peak voltage does not rise above 48v. If the output does rise above 48v, the amplifier’s drive transistors may be damaged. You should also note that whenever your motor decelerates, it acts as a generator pumping current into your power supply. Many switching power supplies are not designed for sinking current, and will not regulate the output adequately. Linear power supplies with insufficient output capacitance will also have difficulty regulating the voltage while decelerating. If you are unsure of your power supply’s ability to sink current, you should attach transient voltage suppressors between each of your motor’s leads and to the power supply ground. (The cathode of each suppressor should go to the motor lead, with the anodes connected to ground.) The voltage rating for the transient voltage suppressor should be just above your maximum power supply voltage. Lastly, because the logic power supply, the motor power supply, and your host computer are all connected with a common ground, we recommend that your motor power supply and your logic power supply have floating outputs to avoid ground loops. Current Sensing Current sensed by the amplifier is read through the PIC-SERVO chip’s A/D input. The current sense value is somewhat non-linear, depending on your motor winding constants and your supply voltage. It is provided mostly for use with the PIC-SERVO’s software current limiting feature for protecting the motor. (The amplifier is self-protected against overcurrent and is self-limiting to 10 amps). The following is a rough guide for setting the PIC-SERVO’s current limit parameter: Current 3 amps 4 5 6 7 8 9 10 J R KERR

Current limit setting 3 5 9 13 17 21 25 0 (no software limiting) A U T O M A T I O N ENGINEERING

• www.jrkerr.com

8

For more accurate current limiting values for your particular motor and supply voltage, measure the peak current across the 0.10 ohm current sense resistor, R7, with an oscilloscope. Look at the corresponding A/D value as various loads are placed on the motor. Note the current limit value should always be odd (1,3, 5, etc.) or set to 0 to disable current limiting altogether. 12 Step Commutation The 3-phase commutation circuit has an internal velocity estimator which can be used to introduce 6 intermediate commutation steps into the standard 6 step commutation to produce a 12 step commutation sequence. This 12 step sequence can reduce the theoretical torque ripple from 13.4% to less than 4%, smoothing the motion and reducing the excitation of mechanical resonances. The 12 step commutation will only be performed over a limited velocity range, and only if the velocity varies by less than 25% between changes in the hall sensor states. Normal 6 step commutation is used otherwise. 12 step commutation is enabled by placing jumper JP9 in the 1-2 position, or disabled by placing it in the 2-3 position. 12 Step Commutation Velocity Range: Minimum hall sensor transition frequency: Maximum hall sensor transition frequency:

2.4 Hz ( 0.2 rev/sec for a 4 pole motor) 153 Hz (12.75 rev/sec for a 4 pole motor)

3.4 Limit Switch Inputs Inputs for 2 limit switches appear on connector P4. They connect directly to the PIC-SERVO chip’s limit switch inputs and have 4.7K pull-up resistors. The limit switch inputs can be connected to mechanical switches, or to electronic sensors which have TTL or open collector type outputs. 3.5 Physical Dimensions .051

4-40 THD 2 places

.156 6 places

3.250 3.000 .935

2.300

3.100

.685

1.800

.150

.200

.150 2.450 3.100

Figure 2 - PIC-SERVO 3PH Motor Control Board Dimensions

J R KERR

A U T O M A T I O N ENGINEERING

• www.jrkerr.com

9

4. Contact Information Additional information may be found from these sources: J R Kerr Automation Engineering www.jrkerr.com Data sheets, application notes and test code may be downloaded from: “http://www.jrkerr.com/docs.html”. Technical support is provided via e-mail. Send your questions to “[email protected]”. HdB Electronics www.hdbelectronics.com Distributor of PIC-SERVO products. Phone: 1-800-287-9432, Fax: 1-650-368-1347, Phone from outside US: 1-650-368-1388.

J R KERR

A U T O M A T I O N ENGINEERING

• www.jrkerr.com

10

P1

F1 +24v

1 2 10 AMP

U6 VCC

5 14 4 3 15 16

20MHz CH_B CH_A

+12

18 17 2 1

U5 13 12 11 10 9 8 7 6

RB7 RB6 RB5 RB4 RB3 RB2 RB1 RB0

CH_B CH_A ENC_RES ENC_SEL

28 27 26 25 24 23 22 21 20 19 18 17 16 15

VCC

PIC-ENC

VCC 1 2 3 4 5 6 7 8 9 10 11 12 13 14

RB7 MCLR RB6 CUR_SENS RB5 ADDR_OUT RB4 LIMIT1 RB3 ADDR_IN RB2 INDEX RB1 LIMIT2 RB0 GND VCC OSC1 GND OSC2 RX DIR TX AMP_EN XMT_EN PWM ENC_RES ENC_SEL

VCC

7408

JP9

NC R

B RE DE

10

Z D

9 13 8

Y NC NC

GND GND

CUR_SENSE

17 18 1 2

S1 S2

VCC

OSC1 OSC2 RA4/RTCC MCLR VCC GND

AMP_EN

6 7 8 9 10 11 12 13 S3

12

4

1 2 3 4

6 5 7408

U11A

4

R11

VCC

OUT

GND

NC

1

20MHz

9

8 7408

U11B

6

SN7414

T4

120 ohm

D3

VNP10N07

5 SN7414

VCC IN SD GND

8 7 6 5

Vb HO Vs LO

C3 0.22uf R2 120 ohm IRFZ24

IR2104

4

T6

3 R6

R16 20K

SN7414 C13 0.1uf

20 Mhz

1 2 3 4

T5

1N4148

U4

U10C

+24v

U11C 2

P2

120 ohm VNP10N07

120 ohm

LIM2

VCC 1 2 3 4 5

S1 S2 S3

VCC

LIM1

JP6

COM R1 R2 R3 R4 R5 R6 R7 R8 R9

P5 2 4 6 8 10

P3 1 2

U7 1

C10

C9

0.1uf

0.1uf

C8 0.1uf

Vin

C1 10uf

VCC

GND

+12

Vout

3 C2 10uf

C11 0.1uf

C12 0.1uf

C14 0.1uf

C15 0.1uf

C16 0.1uf

C17 0.1uf

VCC 1 2 3 4 5

1.0K C6

SD101C D5

0.22uf

D4

1N4148

D6 1N4148

R7 0.1 ohm, 3 watt

U11D 9

8 SN7414

11U11E U11F 13

CH_A

10 CH_B SN7414 12 INDEX

7805

2

JP8

4.7K

1 2 3 4 5 6 ADDR_IN 7 S1 8 S2 9 S3 10

JP2 1 3 5 7 9

2.7K

R9 20K

COM R1 R2 R3 R4 R5

RN2

RN1

ADDR_OUT

R13 1.0K

R8

LIM1

1 2 3 4 5 6

JP7

VCC 1 2 3 4 5

SD1 SD2 SD3 AMP_STAT AMP_EN

JP3

P4 2 4 6 8 10

LIM2

JP1 1 3 5 7 9

ADDR_IN

1 2 3

IRFZ24

R1 +12

10

1

R3 120 ohm

IR2104

R15 100K 5

8 7 6 5

Vb HO Vs LO

C4 0.22uf

U10D

7408

U9

VCC IN SD GND

SD2 SD3

13

6 7

VNP10N07 T3

1N4148

U3

U10B

11

5

120 ohm

D2

SD1

AMP_STAT

3 4

8

IRFZ24 T2

+12

AMP_RES

120 ohm JP5

RB0 RB1 RB2 RB3 RB4 RB5 RB6 RB7

PIC16C710

2

VCC

R4 120 ohm

R5

RA0 RA1 RA2 RA3

16 15 3 4 14 5

DIR

R12

1

R10

8 7 6 5

Vb HO Vs LO

U1

20MHz

LTC491 JP4

VCC IN SD GND

C5 0.22uf

IR2104

U8 VCC A

1 2 3 4

3 2

1.0K

11

C7 330uf

T1

1N4148

U2

U10A

1 ADDR_OUT LIM1 ADDR_IN INDEX LIM2

20MHz

PIC-SERVO

VCC 14 12

D1

PWM

GND VCC MCLR RTCC OSC2 OSC1

SN7414

PIC-SERVO Brushless Motor Controller J.R. Kerr Automation Engineering www.jrkerr.com [email protected]

Figure 3 - PIC-SERVO 3PH Motor Control Board Schematic

Drawing Number Version Sheet

1 1 1

of

1