0% found this document useful (0 votes)
32 views15 pages

Man 10V EN

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views15 pages

Man 10V EN

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

YAPSC : 10V

Users' manual

Yet Another dsPic Servo Controller – 10V Page 1/15


Table Of Content
1 Introduction - before you start.................................................................................................3
2 Features...................................................................................................................................4
3 Physical Description.................................................................................................................4
3.1 Status LEDs......................................................................................................................4
3.1.1 +12V.........................................................................................................................5
3.1.2 -12V..........................................................................................................................5
3.1.3 5V.............................................................................................................................5
3.1.4 ERR...........................................................................................................................5
3.1.4.1 Power up............................................................................................................5
3.1.4.2 FAULT.................................................................................................................5
3.1.4.3 Max. error exceeded..........................................................................................5
3.1.4.4 Firmware fatal error...........................................................................................5
3.2 Power inputs.....................................................................................................................5
3.2.1 K1.............................................................................................................................6
3.2.1.1 +5V...................................................................................................................6
3.2.1.2 M.......................................................................................................................6
3.2.1.3 10/16V...............................................................................................................6
3.2.2 K2.............................................................................................................................6
3.2.2.1 +12V.................................................................................................................6
3.2.2.2 -12V...................................................................................................................6
4 Interface with the servo amp...................................................................................................6
4.1 Outputs............................................................................................................................7
4.1.1 CMD Output..............................................................................................................7
4.1.2 OUT output...............................................................................................................7
4.1.2.1 Enable/Reset......................................................................................................7
4.2 Inputs...............................................................................................................................7
4.2.1 FLT input...................................................................................................................7
4.2.2 IN1 input...................................................................................................................8
5 Interface with the computer....................................................................................................8
5.1 HE10................................................................................................................................8
5.1.1 RS232 port................................................................................................................8
5.1.2 ICSP..........................................................................................................................8
5.1.3 STEP/DIR/ENABLE......................................................................................................9
5.1.4 Power........................................................................................................................9
5.2 STEP/DIR/ENABLE.............................................................................................................9
5.2.1 ENABLE.....................................................................................................................9
5.2.2 STEP........................................................................................................................10
5.2.3 DIR..........................................................................................................................10
6 Encoder connection...............................................................................................................10
6.1 Differential link encoder.................................................................................................11
6.2 TTL Encoder...................................................................................................................11
7 Configuring the board............................................................................................................12
7.1.1 PID gains.................................................................................................................12
7.1.2 Maximal error..........................................................................................................12
7.1.3 Maximum output.....................................................................................................13
7.1.4 STEP input multiplier...............................................................................................13
8 Annex....................................................................................................................................13
8.1 YTT (YAPSC Tuning Tool)..................................................................................................13
8.2 YAPSC.............................................................................................................................13
8.3 dspic-servo.....................................................................................................................13
8.4 Licence...........................................................................................................................13
8.5 Contact...........................................................................................................................14

Page 2/15 Yet Another dsPic Servo Controller – 10V


1 Introduction - before you start
YAPSC:10V allows the use of analog-operated servo amplifiers, either torque or speed
controlled. This board takes STEP/DIR position command from the PC (MACH3, EMC etc.),
position feedback from a quadrature encoder, and outputs an analog command to the servo
amp.
Please note the difference between YAPSC and YAPSC:10V. These two projects share a part
of the dsPic's source code but the manuals are different! YAPSC is a board WITH a power stage
to control DC servos; whereas YAPSC:10V has no power stage and cannot drive a servomotor
without a servo power amplifier.
If you are looking for the DC servomotor controller, this is not the right manual you are looking
into! You will find links at the end of this document for each versions of YAPSC.
Below are the two big scheme of YAPSC:10V application:

Yet Another dsPic Servo Controller – 10V Page 3/15


2 Features
• Takes position feedback from quadrature encoder on the servo (resolvers cannot be
used directly but some amps can output quadrature signals from the resolver feedback)
• Compatible with both torque and speed controlled amps
• Takes STEP/DIR command from PC
• ENABLE signal from PC can disable the amp
• Output amplitude can be selected from +/-0V to +/-10V, to feed +/-10V or +/-5V amps
• Jumper selected TTL or differential quadrature encoder input
• FAULT input from the servo amp
• Reset/ENABLE output to the servo amp
• One additional input for future use
• Programmable max error limit : 0 (disabled) to 32768
• PID tuning program for linux, windows (and probably Mac OS) : YTT (under
development)
• STEP/DIR input multiplier (allows faster speed)
• 1MHz max step and encoder rate!

3 Physical Description

3.1 Status LEDs


There are 4 LEDs on the board:

Page 4/15 Yet Another dsPic Servo Controller – 10V


3.1.1 +12V
Green LED. Lit when the OpAmp +12V supply is present.

3.1.2 -12V
Green LED. Lit when the OpAmp -12V supply is present.

3.1.3 5V
Green LED. Lit when the dsPIC +5V is present

3.1.4 ERR
This LED is dark under normal operation.

3.1.4.1 Power up

During power up, ERR LED is lit during he power-up procedure. If the ERR led is stuck and the
amplifier is disabled, connect the Prog. Key and open a serial terminal. Cycle the power OFF
and ON. You should read the initialization status and see where the process blocks.

3.1.4.2 FAULT

Under FAULT condition, ERR LED is lit.

3.1.4.3 Max. error exceeded

The ERR LED blinks (~2Hz, ON-ON-OFF-OFF)

3.1.4.4 Firmware fatal error

Depending on the error trap the firmware felt into, the blinking can be different (ex: ON-OFF-
OFF-OFF). Look at the source code to learn more about it.

3.2 Power inputs


At least 2 voltages are required: +12V and -12V. Both logic and OpAmp needs power supply for
the board to work.

3.2.1 K1
K1 is the logic power supply input.

Yet Another dsPic Servo Controller – 10V Page 5/15


3.2.1.1 +5V

Logic +5V supply. You can connect it directly to a 5V power source, or use the regulated voltage
from 10 to 16V input to supply 5V to other logic/boards. The board's power consumption is
maximum 300mA plus encoder consumption (generally ~10-20mA)

3.2.1.2 M

Common ground

3.2.1.3 10/16V

Input to the LM7805 voltage regulator. 10 to 16V, max 300mA + encoder consumption

3.2.2 K2
K2 is the OpAmp supply voltage input.

3.2.2.1 +12V

12 to 16V positive supply. 30mA max consumption

3.2.2.2 -12V

-16 to -12V negative supply. 30mA max consumption

4 Interface with the servo amp

4.1 Outputs

4.1.1 CMD Output


The analog output (CMD) controls an amplifier for servo-motor working in torque mode (torque
at the motor shaft proportional to CMD) or speed mode (RPM of the motor proportional to
CMD). CMD output of the YAPSC:10V board must be connected to the analog input of the
amp.
Don't forget to wire the ground! In case the analog input of the amp is differential, connect

Page 6/15 Yet Another dsPic Servo Controller – 10V


CMD to the + (positive) input and the ground M on the – (negative) input of the amp. For
differential input amp, you must use two wires, one for the ground M and the other for CMD.
Those two cables must be at least twisted, but it's better to have them twisted and shielded.
You must, independently of those two wires, link a cable (min. 0,5mm² section area) between M
and the amp's ground

4.1.2 OUT output


The “OUT” output is an open-collector output, designed to drive 0-30V 100mA loads, such as
relays etc.
To come : example schematics

4.1.2.1 Enable/Reset

Under running conditions (i.e motor is powered and YAPSC taking STEP/DIR commands), OUT is
forced low.
If YAPSC is disabled (see section 5.2.1), the OUT output is floating.
If a FAULT condition is detected (look in section 4.2.1), then OUT will be floating and the ERROR
led will blink.

4.2 Inputs
There are two Schmitt-trigger (digital) inputs which can be configured.
By changing the values of (R17,R20) and (R18/R21) the two inputs can work with 5V, 12V or
24V logic:

5V logic 24V logic


R17 = R18 = 1KΩ R17 = R18 = 39,2KΩ
R20 = R21 = 47KΩ R20 = R21 = 10KΩ
Low level : L = 2,5V Low level : L = 12V
High level : H = 3V High level : H = 15V

4.2.1 FLT input


This input is the feedback from the servo amp. In case that a problem (overtemp,
overvoltage, ...) is detected by the amp, it can notify YAPSC. On a FAULT condition, YAPSC:10V
goes into disabled mode : CMD=0 and the STEP/DIR commands are ignored.
FLT input can be configured either to be active-low or active high:

Polarity : Active high Active low


K3 strap position: 1–2 2–3
Fault operation: If FLT is High, FAULT condition If FLT is Low, FAULT condition
If FLT is Low, normal operation If FLT is High, normal operation

Yet Another dsPic Servo Controller – 10V Page 7/15


Illustration:

The FLT input is pulled down, so when not connected FLT is low. If the amp does not have an
output to be linked to FLT, K3 should be placed 1-2 and FLT left unconnected.

4.2.2 IN1 input


Schmitt-trigger input.
Reserved for future use.

5 Interface with the computer

5.1 HE10

HE10 connector P3 provides all the following:

5.1.1 RS232 port


For configuring YAPSC:10V via a serial port terminal (I.e hyperterminal on Windows) or via YTT
(read section 8.1).
Pin 6 (RXD) : data in
Pin 5 (TXD) : data out
Port configuration : 9600bps, 8n, 1stop, no flow control.

The RS232 pins are NOT optoisolated! For maximum security, please use the
optoisolated USB prog. key.

5.1.2 ICSP
The dsPIC30F4012 can be programmed via an ICD2, pickit2 or other programming tool. The
program can also be debugged under operation with Microchip's ICD2/3 (or other compatible
tools).
Pin 2 : MCLR Master Clear

Page 8/15 Yet Another dsPic Servo Controller – 10V


Pin 9 : PGC
Pin 10 : PGD

MCLR, PGC and PGD are NOT optoisolated! Please be aware that any power
failure could be fatal to the programmer and your computer!

5.1.3 STEP/DIR/ENABLE
The control signals are available on P3 to link directly with a control card which is already
protected (optoisolated, …); or you can monitor the input signals to test the optocouplers, etc.
These 3 inputs are pulled-up with a 4K7 resistor to +5V, and are reversed polarity compared to
the optoisolated inputs.

5.1.4 Power
Ground (pin 4) and +5V (pin 3) are available to power the prog. Key's optoisolators, and for the
ICD to monitor +5V voltage.

5.2 STEP/DIR/ENABLE

The command input are optoisolated and provide minimum 600V insulation. The diodes
requires at least 2mA to work properly.
Below is the STEP input schematic, which is the same for DIR and ENABLE inputs.
Note: The + mark on the silk screen represents the cathode connection (ex: pin2 of P1)

PHTRANS is a 6N137 fast rate (10Mbps) optocoupler. Il can be replaced by the 6N136 but with a
reduced maximum stepping rate of 300KHz.

5.2.1 ENABLE
When the ENABLE input is powered state, the YAPSC:10V performs the PID calculation, takes
the STEP commands and outputs the command to the servo amp, unless a FAULT condition
occurs (s. 4.2.1).
If ENABLE is left open (or lead shorted), the board won't read the STEP commands, won't
perform PID calculation and CMD output will be at 0V : the board is disabled.

Yet Another dsPic Servo Controller – 10V Page 9/15


5.2.2 STEP
If the board is enabled (s. 4.2.1 & 5.2.1), on rising edge of STEP input the position command is
increased or decreased depending on the state of the DIR input.
If the board is disabled, (s. 4.2.1 & 5.2.1), the input state and changes of STEP are ignored.
Maximum stepping rate : 1MHz
Minimum pulse width = 500ns

5.2.3 DIR
The DIR command sets the direction of the pulse:
If DIR is powered, each pulse on STEP decreases the position command; Otherwise, the position
command is increased on each pulse on STEP.

6 Encoder connection
The encoder input has 3 inputs for a quadrature encoder : A, B and index pulse (called I, C or Z
depending on the manufacturer).
It can be configured either for differential link or single-end (TTL) signals, depending on the
encoder's link type. A male 9 pins sub-D connector can be plugged on the board's connector
X2, whose pinout is represented below.

Page 10/15 Yet Another dsPic Servo Controller – 10V


6.1 Differential link encoder

• Remove P7, P8 and P9


• Link A+/A- to the A output of the encoder, B+/B- to the B output of the encoder
• Link I+/I- to the index output C (can be called Z or I) of the encoder, if present
• Link the ground (or negative supply) of the encoder to the sub-D9's pin number 6
• Depending on the supply voltage required by the encoder, link the +5V or +12V (sub-
D9's pins 1 or 9) to the positive supply of the encoder
• Once the encoder cord is fully linked, you can plug the connector onto YAPSC:10V's X2
connector.
You should note that:
• If the encoder allows it (check the corresponding datasheet), link a 120Ohms resistor
between A+ and A-; between B+ and B- and between I+ and I- as close as possible to
the sub-D9 plug used to make the encoder cord. This will help noise immunity.
• Contrary to +5V supply, the +12V supply is NOT a regulated voltage. It comes directly
from K1 connector, so you should check that this voltage meets the encoder's
specifications.

6.2 TTL Encoder

• Place P7, P8 et P9
• Link A+ th the A output of the encoder, B+ to the B output of the encoder. A- and B-
are not linked
• Link I+ to the index output of the encoder (Called C, I or Z) if present on the encoder. I-
is not linked
• Link the ground (or negative supply) of the encoder to the sub-D9's pin number 6
• Depending on the supply voltage required by the encoder, link the +5V or +12V (sub-
D9's pins 1 or 9) to the positive supply of the encoder
• Once the encoder cord is fully linked, you can plug the connector onto YAPSC:10V's X2

Yet Another dsPic Servo Controller – 10V Page 11/15


connector.

Do NEVER link a differential link encoder while P7, P8 or P9 are in position! The
encoder could be damaged if that was the case!

Note:
• You may have to place capacitors (100uF+1uF electro +100nF ceramic) between the
encoder's ground and positive supply if the cables between the encoder and YAPSC:10V
is long, and more generally if the encoder is sensitive to electrical noise.
• If the encoder needs a very precise +5V regulated power supply, do not use the 5V
output (pin 1) but rather use a LM7805 type regulator and its capacitors as close to the
encoder as possible. This regulator will be powered by the +12V (pin9).

7 Configuring the board


Each commands are sent trough the RS232 port and validated by pressing the [ENTER] key
(serial port sends “\r\n” to the board).
This section refers to RS232-terminal configuration; A dedicated software called YTT (YAPSC
Tuning Tool) eases the configuration of the board (look in section 8).
Here are the available commands:

7.1.1 PID gains


P sets the P gain (usally P=0,001 to 0,1)
I sets the I gain (usally I=0,0001 to 0,01)
D sets the D gain (usally P=0,0001 to 0,01)
EXAMPLE:

P0,001
I0,0001
D0

7.1.2 Maximal error


This parameter is the error (in pulses; ie lines *4) over which the amp is disabled (no torque).
Send the L command :

L1024
Sets the max. error to 1024 pulses (=256 lines)

NOTE: following command disables the max error monitoring. Please do not use this mode
unless you are absolutely sure of what you are doing!

L0

NOTE: When the maximum error is reached, the ERROR led blinks and the error is reported on
the serial port. To reset the board, you have to cycle power OFF and ON or to reset the board
(short MCLR and GND pins, see section 5.1.2)

Page 12/15 Yet Another dsPic Servo Controller – 10V


7.1.3 Maximum output
To match the output swing to any type of amplifier, the output swing can be limited. The output
swing is expressed in percent of 10,5V:

M50
Will set the output swing to +5,25/-5,25V

M95
Sets the output swing to +10V/-10V

7.1.4 STEP input multiplier


For fast displacements, the 1MHz STEP limit of the interpolator's maximum STEP rate (ex:
MACH3 is limited to ~30-40KHz on the parallel port) may not be enough. If the resolution can
be reduced, you can set the multiplier to a higher value than 1.
EXAMPLE:

X2
Multiply the STEP inputs by 2. Each pulse on STEP will move the motor's position of 2 pulses (½
line)
EXEMPLE:

X-1
Inverts the direction. It is equivalent to invert the DIR input.

8 Annex

8.1 YTT (YAPSC Tuning Tool)


YTT is currently under development and has no web page. Check the YAPSC:10V tread for latest
news.

8.2 YAPSC
The first version of YAPSC is a DC servomotor controller equipped with a power stage.
Links:
• Original tread on the French forum usinages.com : www.usinages.com/carte-servos-a-
dspic-t648.html
• YAPSC-related stuff on my web page (French) : http://max-mod-shop.com/index.php?
option=com_content&view=category&id=17:-yapsc&Itemid=4&layout=default
• dspic-servo tread on cnczone.com : http://www.cnczone.com/forums/showthread.php?
t=40940

8.3 dspic-servo
This is the original work from Lawrence Glaister I based YAPSC on. It is located at
http://www.members.shaw.ca/swstuff/dspic-servo.html

8.4 Licence
Unless specified, the project files are released under GPL3. Read the included file gpl-3.0-
standalone.html

Yet Another dsPic Servo Controller – 10V Page 13/15


This manual is NOT under GPL, I (Charles-Henri Maximilien MOUSSET) reserve all right on it.
Copying or modifying in any way (partially or entirely) this manual's content is forbidden unless
I explicitly authorize you to do so.
You can freely distribute this manual under the same condition, unmodified and without any
material of financial compensation.

8.5 Contact
Maximilien MOUSSET
[email protected]
PM “MaX-MoD” on cnczone,com
PM “MaX-MoD” on usinages.com

Page 14/15 Yet Another dsPic Servo Controller – 10V


Document Rev

Date Description
04/04/09 Corrected board silkscreen on power input connector

Yet Another dsPic Servo Controller – 10V Page 15/15

You might also like