Upload
others
View
4
Download
1
Embed Size (px)
Citation preview
Electric Encoder ™ Synchronous Serial Interface (SSI)
User Manual
July 2009
Electric Encoder™ ‐ SSI UM 1
Notice This guide is delivered subject to the following conditions and restrictions:
This guide contains proprietary information belonging to Netzer Precision Motion Sensors Ltd. Such information is supplied solely for the purpose of assisting users of the SSI interface with the Electric Encoder™.
Information in this document is subject to change without notice.
Document No. Electric Encoder – SSI UM Copyright ©2009 Netzer Precision Motion sensors LTD. All rights reserved.
Revision History:
Ver. 0.8 Nov 2008 for comments –I
Ver. 0.9 Jan 2009 for comments – II (SC2SSI)
Ver. 0.9.1 Jan 2009 initial release
Ver. 0.9.2 Feb 2009 initial release –WEB
Ver. 0.9.3 Jun 2009 updates
Ver.0.9.4 July 2009 updates
Netzer Precision Motion Sensors LTD Misgav Industrial Park
P.O.Box 1359 , DN Misgav
Israel 20179
Phone +972 4 999 0420
Fax +972 4 999 0432
www.netzerprecision.com
Electric Encoder™ ‐ SSI UM 2
1.0 Introduction
Synchronous Serial Interface (SSI) allows for serial transmission of absolute position data from the encoder based on a timed clock pulse train from the controller. Connection between the controller and encoder is based on two signal lines, clock and data, which are usually differential for increased noise immunity. For each sequential clock pulse of the controller, the encoder transmits one data bit from shift registers on the encoder. Figure ‐ 1 shows a typical SSI timing diagram, which shows the sequential clock pulse train from the controller and the corresponding data bits. SSI takes measurements at its fastest internal interrogation rate (length dependent) and provides information upon request.
n = total # of data bits, according to encoder resolution. T = clock period (sec). 1/T = clock frequency ~100 kHz to ~5MHz . t1 = minimum time required for encoder to freeze data and prepare shift registers
before receiving the first rising edge to prompt the MSB, (t1=T/2 recommended) t2 = data transmission delay (increases with cable length).
t3 = (mono flop time) required delay to refresh position data between subsequent
position reads. Tp – interval between pulse trains.
Electric Encoder™ ‐ SSI UM 3
The transfer of data from the encoder to the controller is initiated when the first “falling” edge (a) of the clock pulse train prompts the encoder to freeze the current absolute position data into the encoder shift registers and prepare for the coming clock pulse train from the controller. Typical SSI encoders trigger on the rising edges (as shown in Figure ‐ 1) where the first rising edge (1) on the clock prompts the encoder to set the first data bit (MSB) on the data line. The controller then latches and stores the data bit at the next “rising” edge (2), while also sending the next request for the subsequent bit. The process continues until all data bits (down to the LSB) have been clocked and stored on the controller , after which, the clock signal remains high until the next position read cycle occurs. This cycle occurs every sample period of the controller.
1.1 Configuration Synchronous Serial Interface (SSI) available by external interpolator (SC2SSI) or internally by selected encoder models please refer to the encoder datasheet.
Electric Encoder™ ‐ SSI UM 4
Electric encoder™ Functional – SSI Accuracy By Encoder Output signal latency 450 μsec Output code binary Serial output SSI Diff. RS‐422 Clock SSI Diff. RS‐422 Mono flop time 25 μsec Clock Frequency 100 kHz ‐ 5 MHz SSI data size According to encoder resolution Measurement range full rotation Maximum usable speed By Encoder
Wires color coding – Encoder side 1 GND Black 2 Coarse / Fine Gray 3 Sin out Blue 4 V ref Green 5 Cos out Yellow 6 +5VDC Red
Wires color coding (output) 1 Clock + Gray
SSI clock / NCP RX 2 Clock ‐ Blue 3 Data ‐ Yellow
SSI Data / NCP TX 4 Data + Green 5 GND Black Ground 6 +5V Red Power supply
1.1 Wiring external SC2SSI module
Wires color coding (output) 1 Clock + Gray
SSI clock / NCP RX 2 Clock ‐ Blue 3 Data ‐ Yellow
SSI Data / NCP TX 4 Data + Green 5 GND Black Ground 6 +5V Red Power supply
1.2 Wiring with internal SSI option (selected encoder models)
Electric Encoder™ ‐ SSI UM 5
1.3 Operation: By default the Electric Encoder™ with SSI output or the SC2SSI external module are in real time mode and provides position data according to the clock rate. Switching to configuration mode is by using the SSI explorer or by the host application. NOTE: First use or any mounting modifications of the encoder will need full calibration procedure. Calibration is needed ONLY in the working sector (there is no need for 360° of rotation)
Electric Encoder™ ‐ SSI UM 6
1.4 SSI – Explorer
The Electric Encoder SSI explores provides access to the major parameters via PC interface and the NCP protocol. By initiating the SSI – Explorer the Electric Encoder with SSI output or the SC2SSI external module is switched to “configuration” mode which allows set of operations. Note: The encoder or the SC2SSI will not work simultaneity in real time mode and configuration mode.
A. Real time absolute position reading
B. Encoder parameters –view.
Electric Encoder™ ‐ SSI UM 7
C. Offset calibration The SSi explorer provides a way to find the Fine offsets, Coarse offsets, CAA, and UZP (User Zero Position).These values MUST be found in order to use it for compensation of the reading values.
1.5 Configuration Commands Major Configuration commands
• Read Absolute Position • Read Electric Angle • Read Analog Channels • NM Algorithm • Change to Course • Change to Fine • Read Status • Reset • Set Parameter • Read Parameter • Write User Register • Read User Register • Read Error • Reset Error • Offset Calibration • Enter / Exit NCP (configuration) mode
Electric Encoder™ ‐ SSI UM 8
2.0 NCP ‐ Netzer Communication Protocol ‐ SSI
The NCP is one of two communication protocols available on the Netzer SSi unit. The NCP is a bidirectional serial command protocol. It assigned to get easy accesses to the absolute position and additional parameters and data of the Electric Encoder™ directly of by the external interpolator – SC2SSI. The NCP is Master Slave protocol type, which means no data is available on the bus unless the Master asks for.
The SSi unit uses RS422 as the physical interface for the SSi/NCP protocols. Each communication from the Master (Controller/PC/TE) begins with the slave address follow by the desirable command end completed with an easy to calculate XOR checksum. The end of the protocol is detected using a timeout control.
Data Format: The data on the Serial interface has the following basic format: • 1 start bit. • 8 data bits. • 1 stop bit. • Parity: none. • Bude Rate: 115200 BPS. Protocol Timing:
TS TL
Address CheckSum Data * Address Command
Figure 1
TS – Pause time between individual data packets. It must be smaller than TimeOut. TL – Bus dead time to next address detection. It must be greater than TimeOut. Checksum – XOR link of the bytes transmitted, including address and command. Address – The SSi unit as a fix address: 0xB0.
uSTimeOut BudeRate 44050 ≅≅
The NCP is controlled via a timeout protocol. The first byte after a TimeOut is interpreted as an address. * Optional, depend on the command.
Electric Encoder™ ‐ SSI UM 9
Error Response:
0xEE CheckSum Address
Figure 2 Error Handling: Commands which cannot be processed (protocol errors, command arguments or internal Encoder errors) lead to the command processing being cancelled and to respond with an error response as described above. The Error type can read out using a special command as will described later on. After Error response Use the following steps:
1. Read the error code by using 0x0E – "Read Error" command. 2. Clear the error flag by using 0x0F – "Reset Error" command.
Notes:
1. Reading the error won't clear the error flag. 2. Reading the error code is optional operation, however, the error flag should be cleared otherwise the error response will remain.
Electric Encoder™ ‐ SSI UM 10
Command Set:
Command Function TE Request Unit Response Max
Response Time
Tx Size
Rx Size
0x01 Read Absolute Position (B0)(01)(CS) (B0)(01)(AP3)(AP2)(AP1)(AP0)(CS) 5ms 3 7 0x02 Read Electric Angle (B0)(02)(CS) (B0)(02)(EA1)(EA0)(CS) 50ms 3 5 0x03 Read Analog Channels (B0)(03)(CS) (B0)(03)(SIN1)(SIN0)(COS1)(COS0)(CS) 50ms 3 7 0x04 Nm Algorithm (1) (B0)(04)(CS) (B0)(04)(N1)(N0)(CS) 800ms 3 5 0x05 Change To Coarse (2) (B0)(05)(CS) (B0)(05)(CS) 100ms 3 3 0x06 Change To Fine (2) (B0)(06)(CS) (B0)(06)(CS) 100ms 3 3 0x07 Change To Mid (2) (4) (B0)(07)(CS) (B0)(07)(CS) 100ms 3 3 0x08 Read Status (B0)(08)(CS) (B0)(08)(S1)(S0)(CS) 10ms 3 5 0x09 Reset (2) (B0)(09)(S/H)(CS) (B0)(09)(CS) 30ms 4 3 0x0A Set Parameter (3) (B0)(0A)(P)(V3)(V2)(V1)(V0)(M)(CS) (B0)(0A)(CS) 980ms 9 3 0x0B Read Parameter (B0)(0B)(P)(CS) (B0)(0B)(V3)(V2)(V1)(V0)(CS) 980ms 4 7 0x0C Write User Register (1) (B0)(0C)(29)~(0)(CS) (B0)(0C)(CS) 980ms 33 3 0x0D Read User Register (B0)(0D)(CS) (B0)(0D)(29)~(0)(CS) 980ms 3 33 0x0E Read Error (B0)(0E)(CS) (B0)(0E)(E1)(E0)(CS) 10ms 3 5 0x0F Reset Error (B0)(0F)(CS) (B0)(0F)(CS) 10ms 3 3 0x10 Offset Calibration (3) (B0)(10)(E/D)(CS) (B0)(10)(CS) 100ms 4 3 0x11 Set Permission Level (B0)(11)(25)(37)(58)(PL)(CS) (B0)(11)(PL)(CS) 10ms 7 4 0x12 Read Version (B0)(12)(CS) (B0)(12)(V3)(V2)(V1)(V0)(CS) 10ms 3 7 0x13 Enter/Exit NCP Mode (B0)(13)(58)(37)(25)(E/X)(CS) (B0)(13)(CS) 500ms 7 3
Table 1
(1) Applied from permission level 1. (2) Applied from permission level 2. (3) Applied from permission level 3. (4) For future use.
Electric Encoder™ ‐ SSI UM 11
The Commands General
The first field in all the NCP commands represents the device address, in the SSi unit it is always 0xB0. The field (CS) is the last field in all the NCP commands – this field is the Checksum of the transmitted fields. All the values inside the brackets are in hexadecimal base. In this manual we assume that Integer variable is a 16 bit size (two bytes) and Long variable is a 32 bit size (four bytes).
Read Absolute Position: –0x01 1. Summary: This command will return the encoder absolute position in counts. The return value is an unsigned long (four bytes) with the range of the Encoder resolution.
Request: (B0)(01)(CS)
)B0)(01)(AP3)(AP2)(AP1)(AP0)(CS(Response:
The field (AP3) contains the absolute position – 4th byte. The field (AP2) contains the absolute position – 3rd byte. The field (AP1) contains the absolute position – 2nd byte. The field (AP0) contains the absolute position – 1st byte.
Read Electric Angle: – 2. 0x02 Summary: This command will return the electric angle of current channel. The return value is unsigned integer (two bytes) with the range of 0~8191.
Request: (B0)(02)(CS)
Response: (B0)(02)(EA1)(EA0)(CS) The field (EA1) contains the 2nd byte of electric angle. The field (EA0) contains the 1st byte of electric angle.
Read Analog Channels: –3. 0x03 Summary: This command will return the Sin/Cos Encoder signals of the current channel (Fine/Coarse). The return value is two signed integers with the range of + 2047 to 2048.
Request: (B0)(03)(CS)
Response: (B0)(03)(SIN1)(SIN0)(COS1)(COS0)(CS) The field (SIN1) contains the 2nd byte of the Sin signal. The field (SIN0) contains the 1st byte of the Sin signal. The field (COS1) contains the 2nd byte of the Cos signal. The field (COS0) contains the 1st byte of the Cos signal.
NM Algorithm: –4. 0x04
Summary: This command will perform the NM algorithm and will return the Fine EC/R index. The return value is unsigned integer with the range of 0 to fine EC/R‐1.
Request: (B0)(04)(CS)
Response: (B0)(04)(N1)(N0)(CS) The field (N1) contains the 2nd byte of Fine pole position. The field (N0) contains the 1st byte of Fine pole position.
Change to Coarse: –5. 0x05 Summary: This command will set the Encoder to Coarse mode.
Request: (B0)(05)(CS)
Response: (B0)(05)(CS)
Change to Fine: –6. 0x06 Summary: This command will set the Encoder to Fine mode.
Request: (B0)(06)(CS)
Response: (B0)(06)(CS)
Electric Encoder™ ‐ SSI UM 13
Change to Mid: –7. 0x07 Summary: This command will set the Encoder to Mid mode. Not yet implemented – For future use.
Request: (B0)(07)(CS)
Response: (B0)(07)(CS)
Read Status: –08. 0x08 Summary: This command will return the unit status.
Request: (B0)(08)(CS)
Response: (B0)(08)(S1)(S0)(CS) The field (S1) contains 2nd byte of Status bit fields. The field (S0) contains 1st byte of Status bit fields.
Status bit table:
5 4 3 2 1 0
Error Flag: 0:No Error1:Error
Permission Level:0~6
Calibration 0:Enable1:Disable
Encoder Mode:0:Coarse1:Fine
Table 2 Note: Bits 6 to 15 are for future use.
Reset: –09. 0x09
Summary: This command will reset the unit. Request: (B0)(09)(S/H)(CS) Clearing the (S/H) field to "0" will cause a hardware reset. Setting the (S/H) field to "1" will cause a software reset.
Response: (B0)(09)(CS)
Electric Encoder™ ‐ SSI UM 14
Notes: After execute this command you must wait additional 2 seconds before using another commands. After execute this command the unit will start at the SSi protocol, use the 0x13 command to re enter to NCP mode.
Set Parameters: –10. 0x0A Summary: This command will set the unit different parameters to the volatile or non volatile memory.
Request: (B0)(0A)(P)(V3)(V2)(V1)(V0)(M)(CS) The field (P) represents the parameter type to set. The field (V3) represents the 4th byte of the parameter value. The field (V2) represents the 3rd byte of the parameter value. The field (V1) represents the 2nd byte of the parameter value. The field (V0) represents the 1st byte of the parameter value. Clearing the (M) field to "0" will set the parameter to the volatile memory only. Setting the (M) field to "1" will set the parameter to the volatile and non volatile memory.
Response: (B0)(0A)(CS) Notes: See Table 3 for parameters types. See the relevant Application Notes and User Guides for better understanding the different parameters.
Read Parameters: –11. 0x0B Summary: This command will return the desired unit parameter.
Request: (B0)(0B)(P)(CS) The field (P) represents the desired parameter to read.
Response: (B0)(0B)(V3)(V2)(V1)(V0)(CS) The field (V3) contains the desired parameter value – 4th byte. The field (V2) contains the desired parameter value – 3rd byte. The field (V1) contains the desired parameter value – 2nd byte. The field (V0) contains the desired parameter value – 1st byte.
Notes: See Table 3 for parameters types.
Electric Encoder™ ‐ SSI UM 15
See the relevant Application Notes and User Guides for better understanding the different parameters.
Parameters Table:
Notes Variable Type
Parameters Parameter No. (P)
Signed IntegerCoarse Sin Offset0 Signed Integer Coarse Cos Offset1 Unsigned Integer Coarse Ecr 2 Signed IntegerFine Sin Offset3 Signed Integer Fine Cos Offset4 Unsigned Integer Fine Ecr5 Signed IntegerCAA6 Unsigned LongUZP7
[Deg]HN
⋅⋅8192360
(H – Hysteresis register, N – Fine ECR)
Unsigned Integer Hysteresis 8
[Cnt] for Binary R
N28192⋅
[Cnt] for Decimal RN
28000⋅
(R – Resolution register, N – Fine ECR)
Unsigned Integer Resolution 9
0= Binary, 1=DecimalBooleanResolution Mode10 Read onlyUnsigned Long Firmware Version 11 Can be set from Permission Level 4 Unsigned Long Serial Number 12 Can be set from Permission Level 4Unsigned Long Identifier 13
Table 3
Write User Register: –12. 0x0C
Summary: This command will program the non volatile user memory. The unit has 30 bytes of non volatile memory for the user use.
Request: (B0)(0C)(29)~(0)(CS) The fields (29)~(0) represents the 30 user bytes to program to the non volatile memory. Response: (B0)(0C)(CS)
Electric Encoder™ ‐ SSI UM 16
Read User Register: –13. 0x0D Summary: This command will read the user non volatile memory. The unit has 30 bytes of non volatile memory for the user use.
Request: (B0)(0D)(CS)
Response: (B0)(0D)(29)~(0)(CS) The fields (29)~(0) contain the 30 bytes from the user non volatile memory.
Read Error: –14. 0x0E
Summary: This command will return the last error type, if exist, from the unit.
Request: (B0)(0E)(CS)
Response: (B0)(0E)(E1)(E0)(CS) The field (E1) contains 2nd byte of Error bit fields. The field (E0) contains 1st byte of Error bit fields.
Error bit table:
6 5 4 3 2 1 0 Command
Error NCP Error
CheckSum Error
Permission Error
Register Error
Memory Error
Encoder Signals Error
Table 4 Note: Bits 7 to 15 are for future use.
Reset Error: –15. 0x0F Summary: This command will clear the Error flag. When the unit detects an Error the Error flag is set and the Error Response is transmitted out on every command until the Error flag is cleared.
Request: (B0)(0F)(CS)
Response: (B0)(0F)(CS)
Electric Encoder™ ‐ SSI UM 17
Offset Calibration: –16. 0x10 Summary: This command will set the unit for automatic offset calibration of the current channel (Fine/Coarse). After enabling to calibration mode t rotate the encoder. The offset calibration is automatically disabled when ended and updates the sin and cos offset volatile memory parameters. To examine if the calibration process is ended the 0x 08 commands can be used. Commands 0x0A and 0x0B will save those values to the non volatile memory.
Request: (B0)(10)(E/D)(CS) Clearing the (E/D) field to "0" will disable the offset calibration. Setting the (E/D) field to "1" will enable the offset calibration.
Response: (B0)(10)(CS)
Set Permission Level: –17. 0x11 Summary: This command will set the unit permission level. Permission levels 0 ~ 3 are for the user use.
Request: (B0)(11)(25)(37)(58)(PL)(CS) The field (PL) represents the desired permission level. .
Response: (B0)(11)(PL)(CS) The field (PL) represents the current permission level.
Read Version: –18. 0x12 Summary: This command will return the firmware version. The return value is an unsigned long.
Request: (B0)(12)(CS)
Response: (B0)(12)(V3)(V2)(V1)(V0)(CS) The field (V3) contains the firmware version – 4th byte. The field (V2) contains the firmware version – 3rd byte.
Electric Encoder™ ‐ SSI UM 18
Electric Encoder™ ‐ SSI UM 19
The field (V1) contains the firmware version – 2nd byte. The field (V0) contains the firmware version – 1st byte.
Enter/Exit NCP Mode: –19. 0x13 Summary: This command will set the unit to NCP or SSi protocol. Before executing this command, to enter NCP mode, SSi communication should be stopped for 300ms.
Request: (B0)(13)(58)(37)(25)(E/X)(CS) Clearing the (E/X) field to "0" will set the unit to SSi mode. Setting the (E/X) field to "1" will set the unit to NCP mode.
Response: (B0)(13)(CS)
Note: Since the SSi mode is "alive" during the executing of this command for NCP mode (E/X = 1), the response can contain some "leftovers" of the last SSi read.