You are on page 1of 43

HY-TTC 500 Family

CODESYS Workshop Example Handout

D-HYTTC-TM-20-007 - V1.0
"TTTech
-
Internal"
Contents
1 Overview .......................................................................................................................................... 3
2 CODESYS workshop examples ...................................................................................................... 3
2.1 WS00 - Connection ................................................................................................................. 4
2.2 WS01 - Switch On / Off ........................................................................................................... 6
2.3 WS02a - EEPROM .................................................................................................................. 8
2.4 WS02b - EEPROM ................................................................................................................ 10
2.5 WS03 - Digital ........................................................................................................................ 12
2.6 WS04 - PWM ......................................................................................................................... 14
2.7 WS05 - PWM ......................................................................................................................... 16
2.8 WS06 - PWM PID .................................................................................................................. 18
2.9 WS07 - Safety Configuration ................................................................................................. 20
2.10 WS08 - Power Switch ............................................................................................................ 22
2.11 WS09 - Frequency ................................................................................................................. 24
2.12 WS10 - Incremental Encoder ................................................................................................ 26
2.13 WS11 - CAN 2.0b .................................................................................................................. 28
2.14 WS12 - J1939 ........................................................................................................................ 30
2.15 WS13 - CANopen .................................................................................................................. 32
2.16 WS14 - Front loader .............................................................................................................. 34
2.17 WS15 - CODESYS SIL2 Plugin ............................................................................................. 36
2.18 WS16 - CANopen Safety ....................................................................................................... 39
2.19 WS17 - Callbacks .................................................................................................................. 40
3 Legal Disclaimer ............................................................................................................................ 43

"TTTech
-
2
Internal"
1 Overview
This document specifies workshop examples for HY-TTC 500 family in combination with
TTControl’s training kit.

2 CODESYS workshop examples


Default » CAN 0
CAN Settings » 500 Kbit/s

Default » IP Address: 10.100.30.200


Ethernet » Subnet Mask: 255.255.0.0
Settings

Pins to connect » BAT+ Power (KL30-P): Pin 201 – Pin 206


» BAT+ CPU (KL30-A): Pin 246
to BAT+ Pin 207
» Terminal 15 (KL15):

Pins to connect » BAT- (GND): Pin 118 – Pin 121


Pin 142 – Pin 145
to BAT-

Application » Open your project.


download in » Double click on “Device”.
» Click on “Scan Network …”.
CODESYS 3.5 » Controller should be displayed in “Select Device” Pop-Up if controller
has been scanned successfully.
» Double click on the found controller.
» Click on “Online” – “Login” and start download.
» Click on “Debug” – “Start” to start application run.
» Click on “Online” – “Logout” and power cycle controller
» Click on “Online” – “Login”

Activating » Enable power stage by software


outputs » For PWM outputs activate corresponding safety switch (see Section
4.12.1, column Shut-Off Group of System Manual)
» To reset the controller from safe state, perform a power cycle after
downloading the application. Only after power cycle, the controller is in
safe run and able to activate the outputs

HY-TTC 500
BAT+ BAT+ BAT+
Watchdog
&

Group Group Group


C (2) B (1) A (0)

CPU
8x 14x 14x

PWM PWM PWM


28 - 35 14 - 27 0 - 13

"TTTech
-
3
Internal"
2.1 WS00 - Connection
Training Kit » None
Components

Target » Flashing CODESYS runtime system with TTC Downloader


» Using CODESYS to connect to the controller via CAN or Ethernet

Description » Before connecting over CODESYS the first time, CODESYS RTS (runtime
system) needs to be flashed to the controller
» The RTS file can be found in the bin folder of the HY-TTC 500 family release
» Restart the controller to leave the boot loader and connect over CODESYS
» Please refer to HY-TTC 500 quick start guide for more information

"TTTech
-
4
Internal"
Connection Diagram

HY-TTC 500
153
201
177
202
156
203
180
204
159
205 BAT+ 183
206 PWM / DO / DI
186
246 CPU
162
207 K15
+ 220 WAKE UP
(SSW A) 189
165
- 118
192
168
119 195
120 171
121
142
BAT- 154
143 178
144 157
145 181
160
217
230
PWM / DO / DI 184
187
243 163
244
Sensor GND (SSW B) 190
245 166
256 193
257 169
258 196
103 172
127 101
104 125
128 PWM / DO / DI / 150
105 AI 3-Mode PWD 174
129 102
106 126
130 (SSW C) 151
107 175
131 149
108 173
132 AI 2-Mode 152
109 10V 176
133 DO HS / AI / DI 155
110 179
134 158
111 182
135 251
112 238
136 AI 2-Mode 252
113 32V 239
137 DO LS / AI / DI 253
114 240
138 254
241
115
139 161
116 185
140 188
117 PVG / VOUT / 164
141 Timer In / DO / AI / DI 191
122 AI / DI 167
146 194
123 170
147
124 247
148
Sensor Supply 234
221
209 235
222 248
210 236
223 249
211 CAN 0 - 3 CAN Termination 237
224 250
212 216
225 229
213 218
226 219
214
Ethernet 231
227
CAN 4 - 6 232
215
228 242
Serial / LIN 255
233 RTC 208

"TTTech
-
5
Internal"
2.2 WS01 - Switch On / Off
Training Kit » None
Components

Target » Switching on and off controller via Terminal 15 (K15) via software

Description » Implement a counter which increments cyclically by 1 when Terminal 15 is off


» Switch off controller by software if Terminal 15 is off for 500 cycles
» Reset counter if Terminal 15 is set to on within these 500 cycles

Notes » If Terminal 15 is switched to positive supply, the controller is powered up


» If Terminal 15 is switched is set to off, keep alive function is enabled and the
controller can be shut down via software
» Keep alive function is used to perform pre-shutdown tasks like saving
EEPROM data
» Controller needs to be shut down via software after these pre-shutdown tasks

K15 Shutdown

Counter = 0 Terminal 15 = On

Counter < 500


Terminal 15 = Off
Terminal 15 = BAT+

Counter + 1

Counter >= 500

Shutdown

"TTTech
-
6
Internal"
Connection Diagram

HY-TTC 500
153
201
177
202
K15 203
156
180
204
159
205 BAT+ 183
206 PWM / DO / DI
186
246 CPU
162
207 K15
+ 220 WAKE UP
(SSW A) 189
165
- 118
192
168
119 195
120 171
121
142
BAT- 154
143 178
144 157
145 181
160
217
230
PWM / DO / DI 184
187
243 163
244
Sensor GND (SSW B) 190
245 166
256 193
257 169
258 196
103 172
127 101
104 125
128 PWM / DO / DI / 150
105 AI 3-Mode PWD 174
129 102
106 126
130 (SSW C) 151
107 175
131 149
108 173
132 AI 2-Mode 152
109 10V 176
133 DO HS / AI / DI 155
110 179
134 158
111 182
135 251
112 238
136 AI 2-Mode 252
113 32V 239
137 DO LS / AI / DI 253
114 240
138 254
241
115
139 161
116 185
140 188
117 PVG / VOUT / 164
141 Timer In / DO / AI / DI 191
122 AI / DI 167
146 194
123 170
147
124 247
148
Sensor Supply 234
221
209 235
222 248
210 236
223 249
211 CAN 0 - 3 CAN Termination 237
224 250
212 216
225 229
213 218
226 219
214
Ethernet 231
227
CAN 4 - 6 232
215
228 242
Serial / LIN 255
233 RTC 208

"TTTech
-
7
Internal"
2.3 WS02a - EEPROM
Training Kit » None
Components

Target » Reading and writing data from and to EEPROM

Description » Use EEPROM functions of lib500 to initialize EEPROM


» Read 4 bytes at EEPROM offset 0 and assign the read value to a counter
variable
» Increment this counter variable cyclically by 1
» Save counter value to EEPROM if Terminal 15 is switched off (offset 0, length
4 bytes)

Notes » Create a state machine for different EEPROM states

"TTTech
-
8
Internal"
Connection Diagram

HY-TTC 500
153
201
177
202
156
203
180
204
159
205 BAT+ 183
206 PWM / DO / DI
186
246 CPU
162
207 K15
+ 220 WAKE UP
(SSW A) 189
165
- 118
192
168
119 195
120 171
121
142
BAT- 154
143 178
144 157
145 181
160
217
230
PWM / DO / DI 184
187
243 163
244
Sensor GND (SSW B) 190
245 166
256 193
257 169
258 196
103 172
127 101
104 125
128 PWM / DO / DI / 150
105 AI 3-Mode PWD 174
129 102
106 126
130 (SSW C) 151
107 175
131 149
108 173
132 AI 2-Mode 152
109 10V 176
133 DO HS / AI / DI 155
110 179
134 158
111 182
135 251
112 238
136 AI 2-Mode 252
113 32V 239
137 DO LS / AI / DI 253
114 240
138 254
241
115
139 161
116 185
140 188
117 PVG / VOUT / 164
141 Timer In / DO / AI / DI 191
122 AI / DI 167
146 194
123 170
147
124 247
148
Sensor Supply 234
221
209 235
222 248
210 236
223 249
211 CAN 0 - 3 CAN Termination 237
224 250
212 216
225 229
213 218
226 219
214
Ethernet 231
227
CAN 4 - 6 232
215
228 242
Serial / LIN 255
233 RTC 208

"TTTech
-
9
Internal"
2.4 WS02b - EEPROM
Training Kit » None
Components

Target » Reading and writing data from and to EEPROM

Description » Define a counter variable (UDINT) using retain variables.


» Use this counter variable to implement a counter which is incremented
cyclically by 1.
» If Terminal 15 is switched off, save the retain variable and shutdown the
controller.

Notes » Use the lib500_types to check if the data is saved successfully by mapping a
variable in the System I/O Mapping at the Global EEPROM status.
» Shut down the device after being sure that data was saved successfully.

"TTTech
-
10
Internal"
Connection Diagram

HY-TTC 500
153
201
177
202
156
203
180
204
159
205 BAT+ 183
206 PWM / DO / DI
186
246 CPU
162
207 K15
+ 220 WAKE UP
(SSW A) 189
165
- 118
192
168
119 195
120 171
121
142
BAT- 154
143 178
144 157
145 181
160
217
230
PWM / DO / DI 184
187
243 163
244
Sensor GND (SSW B) 190
245 166
256 193
257 169
258 196
103 172
127 101
104 125
128 PWM / DO / DI / 150
105 AI 3-Mode PWD 174
129 102
106 126
130 (SSW C) 151
107 175
131 149
108 173
132 AI 2-Mode 152
109 10V 176
133 DO HS / AI / DI 155
110 179
134 158
111 182
135 251
112 238
136 AI 2-Mode 252
113 32V 239
137 DO LS / AI / DI 253
114 240
138 254
241
115
139 161
116 185
140 188
117 PVG / VOUT / 164
141 Timer In / DO / AI / DI 191
122 AI / DI 167
146 194
123 170
147
124 247
148
Sensor Supply 234
221
209 235
222 248
210 236
223 249
211 CAN 0 - 3 CAN Termination 237
224 250
212 216
225 229
213 218
226 219
214
Ethernet 231
227
CAN 4 - 6 232
215
228 242
Serial / LIN 255
233 RTC 208

"TTTech
-
11
Internal"
2.5 WS03 - Digital
Training Kit » Rocker Switch 1
Components » Rocker Switch 2
» Led Green

Target » Configuring digital inputs


» Configuring digital outputs
» Error detection on outputs

Description » Configure timer input pins to read Rocker Switch 1 (Pin 115) and Rocker
Switch 2 (Pin 116) in digital mode (switches close to BAT+).
» Configure output pin to control Led Green (Pin 149) in digital mode.
» If Rocker Switch 1 and Rocker Switch 2 are switched on, Led Green shall be
activated.

Notes » In order to be able to activate PWM outputs, power stage and its corresponding
safety switch need to be enabled.
» After downloading the application, a power cycle needs to be performed to
reset the controller from safe state – only after a power cycle the controller is in
safe run and able to activate outputs.
» If outputs cannot be activated, state of safety switches and diagnostic state of
safety platform need to be checked.
» Attention: To update variable values in the application, all variables mapped to
input / output signals need to be called at minimum once in the application.

"TTTech
-
12
Internal"
Connection Diagram

HY-TTC 500
153
201
177
202
156
203
180
204
159
205 BAT+ 183
206 PWM / DO / DI
186
246 CPU
162
207 K15
+ 220 WAKE UP
(SSW A) 189
165
- 118
192
168
119 195
120 171
121
142
BAT- 154
143 178
144 157
145 181
160
217
230
PWM / DO / DI 184
187
243 163
244
Sensor GND (SSW B) 190
245 166
256 193
257 169
258 196
103 172
Rocker Switch 2

Rocker Switch 1

127 101
104 125
128 PWM / DO / DI / 150
105 AI 3-Mode PWD 174
129 102
106 126
130 (SSW C) 151
107 175
131 149
108 173
132 AI 2-Mode 152
109 10V 176
133 DO HS / AI / DI 155
110 179
134 158
111 182
135 251
112 238
136 AI 2-Mode 252
113 32V 239
DO LS / AI / DI
LED Green

137 253
114 240
138 254
241
115
139 161
116 185
140 188
117 PVG / VOUT / 164
141 Timer In / DO / AI / DI 191
122 AI / DI 167
146 194
123 170
147
124 247
148
Sensor Supply 234
221
GND

209 235
222 248
210 236
223 249
211 CAN 0 - 3 CAN Termination 237
224 250
212 216
225 229
213 218
226 219
214
Ethernet 231
227
CAN 4 - 6 232
215
228 242
Serial / LIN 255
233 RTC 208

"TTTech
-
13
Internal"
2.6 WS04 - PWM
Training Kit » Pot Green
Components » Led Green

Target » Configuring 5V sensor supply


» Configuring analog inputs in voltage mode
» Configuring PWM outputs
» Error detection on digital outputs

Description » Connect Pot Green (Pin 107) to sensor supply 0 (5V) and switch it on.
» Configure input pin to read Pot Green in analog mode (voltage measurement
0 – 5000 mV).
» Configure output pin to control Led Green (Pin 153) in PWM mode.
» Switch on safety switch 0 to enable PWM output for Led Green.
» Read voltage value of Pot Green and convert it from 0 – 5000 mV to 0 – 65535.
» Use converted value as duty cycle setpoint for Led Green.

Notes » In order to be able to activate PWM outputs, power stage and its corresponding
safety switch need to be enabled.
» After downloading the application, a power cycle needs to be performed to
reset the controller from safe state – only after a power cycle the controller is in
safe run and able to activate outputs.
» If outputs cannot be activated, state of safety switches and diagnostic state of
safety platform need to be checked.
» Attention: To update variable values in the application, all variables mapped to
input / output signals need to be called at minimum once in the application.

"TTTech
-
14
Internal"
Connection Diagram

HY-TTC 500
153
201
177
202
156
203
180
204
159
205 BAT+ 183
206 PWM / DO / DI
186
246 CPU
162
207 K15
+ 220 WAKE UP
(SSW A) 189
165
- 118
192
168
119 195

LED Green
120 171
121
142
BAT- 154
143 178
144 157
145 181
160
217
230
PWM / DO / DI 184
187
243 163
244
Sensor GND (SSW B) 190
245 166
256 193
257 169
258 196
172
Pot Green

103

GND
127 101
104 125
128 PWM / DO / DI / 150
105 AI 3-Mode PWD 174
129 102
106 126
130 (SSW C) 151
107 175
131 149
108 173
132 AI 2-Mode 152
109 10V 176
133 DO HS / AI / DI 155
110 179
134 158
111 182
135 251
112 238
136 AI 2-Mode 252
113 32V 239
137 DO LS / AI / DI 253
114 240
138 254
241
115
139 161
116 185
140 188
117 PVG / VOUT / 164
141 Timer In / DO / AI / DI 191
122 AI / DI 167
146 194
123 170
147
124 247
148
Sensor Supply 234
221
209 235
222 248
210 236
223 249
211 CAN 0 - 3 CAN Termination 237
224 250
212 216
225 229
213 218
226 219
214
Ethernet 231
227
CAN 4 - 6 232
215
228 242
Serial / LIN 255
233 RTC 208

"TTTech
-
15
Internal"
2.7 WS05 - PWM
Training Kit » Inclination Sensor 1
Components » Prop Val 1

Target » Configuring analog inputs in current mode


» Configuring PWM outputs
» Error detection on PWM outputs
» Using libraries

Description » Configure input pin to read Inclination Sensor 1 (Pin 107) in analog mode
(current measurement 4 - 20 mA).
» Configure output pin to control Prop Val 1 (Pin 153) in PWM mode.
» Switch on safety switch 0 to enable PWM output for Prop Val 1.
» Read current value of Inclination Sensor 1 and convert it from 4000 - 20000 µA
to 0 – 65535.
» Use this value as duty cycle setpoint for Prop Val 1.
» Use cl_base_unsafe library to perform conversion from µA to duty cycle.

Notes » In order to be able to activate PWM outputs, power stage and its corresponding
safety switch need to be enabled.
» After downloading the application, a power cycle needs to be performed to
reset the controller from safe state – only after a power cycle the controller is in
safe run and able to activate outputs.
» If outputs cannot be activated, state of safety switches and diagnostic state of
safety platform need to be checked.
» Attention: To update variable values in the application, all variables mapped to
input / output signals need to be called at minimum once in the application.

"TTTech
-
16
Internal"
Connection Diagram

HY-TTC 500
153
201
177
202
156
203
180
204
159
205 BAT+ 183
206 PWM / DO / DI
186
246 CPU
162
207 K15
+ 220 WAKE UP
(SSW A) 189
165
- 118
192
168
119 195
120 171
121
142
BAT- 154

Prop Val 1
143 178
144 157
145 181
160
217
230
PWM / DO / DI 184
187
243 163
244
Sensor GND (SSW B) 190
245 166
256 193
257 169
258 196
103 172
127 101
104 125
Inclination Sensor 1

128 PWM / DO / DI / 150


AI 3-Mode

GND
105 PWD 174
129 102
106 126
130 (SSW C) 151
107 175
131 149
108 173
132 AI 2-Mode 152
109 10V 176
133 DO HS / AI / DI 155
110 179
134 158
111 182
135 251
112 238
136 AI 2-Mode 252
113 32V
GND

239
137 DO LS / AI / DI 253
114 240
138 254
241
115
139 161
116 185
140 188
117 PVG / VOUT / 164
141 Timer In / DO / AI / DI 191
122 AI / DI 167
146 194
123 170
147
124 247
148
Sensor Supply 234
221
209 235
222 248
210 236
223 249
211 CAN 0 - 3 CAN Termination 237
224 250
212 216
225 229
213 218
226 219
214
Ethernet 231
227
CAN 4 - 6 232
215
228 242
Serial / LIN 255
233 RTC 208

"TTTech
-
17
Internal"
2.8 WS06 - PWM PID
Training Kit » Inclination Sensor 1
Components » Prop Val 2

Target » Configuring analog inputs in current mode


» Configuring PWM outputs with PID current control loop
» Error detection on PWM outputs
» Using libraries

Description » Configure input pin to read Inclination Sensor 1 (Pin 107) in analog mode
(current measurement 4 - 20 mA).
» Configure output pin to control Prop Val 2 (Pin 156) in PWM mode with current
measurement.
» Switch on safety switch 0 to enable PWM output for Prop Val 2.
» Read current value of Inclination Sensor 1 and convert it from 4000 - 20000 µA
to 0 – 800 mA.
» Use this value as setpoint for PID current control of Prop Val 2.
» Use cl_base_unsafe library to perform conversion from µA to duty cycle and
PID controller.

Notes » In order to be able to activate PWM outputs, power stage and its corresponding
safety switch need to be enabled.
» After downloading the application, a power cycle needs to be performed to
reset the controller from safe state – only after a power cycle the controller is in
safe run and able to activate outputs.
» If outputs cannot be activated, state of safety switches and diagnostic state of
safety platform need to be checked.
» Attention: To update variable values in the application, all variables mapped to
input / output signals need to be called at minimum once in the application.

"TTTech
-
18
Internal"
Connection Diagram

HY-TTC 500
153
201
177
202
156
203
180
204
159
205 BAT+ 183
206 PWM / DO / DI
186
246 CPU
162
207 K15
+ 220 WAKE UP
(SSW A) 189
165
- 118
192
168
119 195
120 171
121
142
BAT- 154
143 178
144 157

Prop Val 2
145 181
160
217
230
PWM / DO / DI 184
187
243 163
244
Sensor GND (SSW B) 190
245 166
256 193
257 169
258 196
103 172
127 101
104 125
Inclination Sensor 1

128 PWM / DO / DI / 150


105 AI 3-Mode PWD 174
129 102

GND
106 126
130 (SSW C) 151
107 175
131 149
108 173
132 AI 2-Mode 152
109 10V 176
133 DO HS / AI / DI 155
110 179
134 158
111 182
135 251
112 238
136 AI 2-Mode 252
113 32V
GND

239
137 DO LS / AI / DI 253
114 240
138 254
241
115
139 161
116 185
140 188
117 PVG / VOUT / 164
141 Timer In / DO / AI / DI 191
122 AI / DI 167
146 194
123 170
147
124 247
148
Sensor Supply 234
221
209 235
222 248
210 236
223 249
211 CAN 0 - 3 CAN Termination 237
224 250
212 216
225 229
213 218
226 219
214
Ethernet 231
227
CAN 4 - 6 232
215
228 242
Serial / LIN 255
233 RTC 208

"TTTech
-
19
Internal"
2.9 WS07 - Safety Configuration
Training Kit » Pot Green
Components » Prop Val 2

Target » Configuring analog inputs (with safety configuration)


» Configure PWM outputs (with safety configuration) with PID current control loop
» Error detection on outputs
» Using libraries

Description » Connect Pot Green (Pin 103) to sensor supply 0 (5V) and switch it on.
» Configure input pin to read Pot Green in analog mode (voltage measurement
0 - 5000 mV) – with safety configuration enabled (lower limit 10% - upper limit
90%).
» Configure output pin to control Prop Val 2 (Pin 156) in PWM mode with current
measurement – with safety configuration enabled.
» Read voltage value of Pot Green and convert it from 0 - 5000 mV to
0 – 800 mA.
» Use this value as setpoint for PID current control of Prop Val 2.
» Use cl_base_unsafe library to perform conversion from µA to duty cycle and
PID controller.
» Enable safety configuration for analog input and PWM output.

Testing » Power cycle unit and verify that ECU is in running (no safe state).
» Put Pot Green to 0 V and verify that ECU goes to safe state (verify diagnostic
error codes).
» Power cycle unit and verify that ECU is in running (no safe state).
» Disconnect Prop Val 2 and verify that ECU goes to safe state (verify diagnostic
error codes).

Notes » In order to be able to activate PWM outputs, power stage and its corresponding
safety switch need to be enabled.
» After downloading the application, a power cycle needs to be performed to
reset the controller from safe state – only after a power cycle the controller is in
safe run and able to activate outputs.
» If outputs cannot be activated, state of safety switches and diagnostic state of
safety platform need to be checked.
» Attention: To update variable values in the application, all variables mapped to
input / output signals need to be called at minimum once in the application.

"TTTech
-
20
Internal"
Connection Diagram

HY-TTC 500
153
201
177
202
156
203
180
204
159
205 BAT+ 183
206 PWM / DO / DI
186
246 CPU
162
207 K15
+ 220 WAKE UP
(SSW A) 189
165
- 118
192
168
119 195
120 171
121
142
BAT- 154
143 178
144 157

Prop Val 2
145 181
160
217
230
PWM / DO / DI 184
187
243 163
244
Sensor GND (SSW B) 190
245 166
256 193
257 169
258 196
172
Pot Green

103
127 101
104 125
128 PWM / DO / DI / 150
105 AI 3-Mode PWD 174
129 102

GND
106 126
130 (SSW C) 151
107 175
131 149
108 173
132 AI 2-Mode 152
109 10V 176
133 DO HS / AI / DI 155
110 179
134 158
111 182
135 251
112 238
136 AI 2-Mode 252
113 32V 239
137 DO LS / AI / DI 253
114 240
138 254
241
115
139 161
116 185
140 188
117 PVG / VOUT / 164
141 Timer In / DO / AI / DI 191
122 AI / DI 167
146 194
123 170
147
124 247
148
Sensor Supply 234
221
209 235
222 248
210 236
223 249
211 CAN 0 - 3 CAN Termination 237
224 250
212 216
225 229
213 218
226 219
214
Ethernet 231
227
CAN 4 - 6 232
215
228 242
Serial / LIN 255
233 RTC 208

"TTTech
-
21
Internal"
2.10 WS08 - Power Switch
Training Kit » Inclination Sensor 1
Components » Emergency Stop
» Buzzer
» Prop Val 1
» Prop Val 2

Target » Configuring analog inputs in current mode


» Configuring digital inputs
» Configuring digital outputs
» Configuring PWM outputs
» Error detection on outputs
» Using libraries

Description » Configure input pin to read Inclination Sensor 1 (Pin 107) in analog mode
(current measurement 4 - 20 mA).
» Configure output pin to control Prop Val 1 (Pin 153) in PWM mode.
» Configure output pin to control Prop Val 2 (Pin 156) in PWM mode with current
measurement.
» Configure input pin to read Emergency Stop (Pin 115) in digital mode (switch
closes to BAT+).
» Configure output pin to control Buzzer (Pin 149) in digital mode.
» Switch on safety switch 0 to enable PWM output for Prop Val 1 and Prop Val 2.
» Read current value of Inclination Sensor 1 and convert it from 4000 - 20000 µA
to 0 – 65535.
» Use this value as duty cycle setpoint for Prop Val 1.
» Read current value of Inclination Sensor 1 and convert it from 4000 - 20000 µA
to 0 – 800 mA.
» Use this value as setpoint for PID current control of Prop Val 2.
» Use cl_base_unsafe library to perform conversion from µA to duty cycle and
PID controller.
» If Emergency Stop is pressed, activate Buzzer.
» If Emergency Stop is pressed, set setpoint of Prop Val 1 and Prop Val 2 to
0 mA and deactivate safety switch 0.
» If Emergency Stop is released again, enable safety switch 0 again.

Notes » In order to be able to activate PWM outputs, power stage and its corresponding
safety switch need to be enabled.
» After downloading the application, a power cycle needs to be performed to
reset the controller from safe state – only after a power cycle the controller is in
safe run and able to activate outputs.
» If outputs cannot be activated, state of safety switches and diagnostic state of
safety platform need to be checked.
» Attention: To update variable values in the application, all variables mapped to
input / output signals need to be called at minimum once in the application.

"TTTech
-
22
Internal"
Connection Diagram

HY-TTC 500
153
201
177
202
156
203
180
204
159
205 BAT+ 183
206 PWM / DO / DI
186
246 CPU
162
207 K15
+ 220 WAKE UP
(SSW A) 189
165
- 118
192
168
119 195
120 171
121

Prop Valve 2

Prop Valve 1
142
BAT- 154
143 178
144 157
145 181
160
217
230
PWM / DO / DI 184
187
243 163
244
Sensor GND (SSW B) 190
245 166
256 193
257 169
258 196
103 172
Rocker Switch 2

127 101
104 125
Inclination Sensor 1

128 PWM / DO / DI / 150


AI 3-Mode

GND

GND
105 PWD 174
129 102
106 126
130 (SSW C) 151
107 175
131 149
108 173
132 AI 2-Mode 152
109 10V 176
133 DO HS / AI / DI 155
110 179
134 158
111 182
135 251
112 238
136 AI 2-Mode 252
113 32V
GND

239
137 DO LS / AI / DI 253
114 240
138 254
Buzzer

241
115
139 161
116 185
140 188
117 PVG / VOUT / 164
141 Timer In / DO / AI / DI 191
122 AI / DI 167
146 194
123 170
147
124 247
148
Sensor Supply 234
221
GND

209 235
222 248
210 236
223 249
211 CAN 0 - 3 CAN Termination 237
224 250
212 216
225 229
213 218
226 219
214
Ethernet 231
227
CAN 4 - 6 232
215
228 242
Serial / LIN 255
233 RTC 208

"TTTech
-
23
Internal"
2.11 WS09 - Frequency
Training Kit » HLS100
Components » Button Blue
» Led Blue

Target » Configuring frequency inputs


» Configuring digital inputs
» Configuring digital outputs

Description » Configure input pin to read HLS100 (Pin 115) in frequency mode and read duty
cycle and frequency.
» Configure input pin to read Button Blue (Pin 139) in digital mode (switch closes
to BAT+).
» Configure output pin to control Led Blue (Pin 149) in digital mode.
» If HLS100 is active (duty cycle = 74%) and Button Blue is pressed, activate Led
Blue.
» If HLS100 is not active (duty cycle = 26%) or Button Blue is not pressed,
deactivate Led Blue.

Notes » In order to be able to activate PWM outputs, power stage and its corresponding
safety switch need to be enabled.
» After downloading the application, a power cycle needs to be performed to
reset the controller from safe state – only after a power cycle the controller is in
safe run and able to activate outputs.
» If outputs cannot be activated, state of safety switches and diagnostic state of
safety platform need to be checked.
» Attention: To update variable values in the application, all variables mapped to
input / output signals need to be called at minimum once in the application.
» HLS100 sensor sends its data in form of a PWM signal with a frequency of
50 Hz (duty cycle 74% means active, duty cycle 26% means not active).
» HLS100 sensor requires a pull-down 10 kOhm configuration in order to work
properly.

"TTTech
-
24
Internal"
Connection Diagram

HY-TTC 500
153
201
177
202
156
203
180
204
159
205 BAT+ 183
206 PWM / DO / DI
186
246 CPU
162
207 K15
+ 220 WAKE UP
(SSW A) 189
165
- 118
192
168
119 195
120 171
121
142
BAT- 154
143 178
144 157
145 181
160
217
230
PWM / DO / DI 184
187
243 163
244
Sensor GND (SSW B) 190
245 166
256 193
257 169
258 196
103 172
127 101
104 125
128 PWM / DO / DI / 150
AI 3-Mode
Button Blue

105 PWD 174


129 102
106 126
130 (SSW C) 151
107 175
131
HLS100

149
108 173
132 AI 2-Mode 152
109 10V 176
133 DO HS / AI / DI 155
110 179
134 158
111 182
135 251
112 238
136 AI 2-Mode 252
GND

113 32V 239


137 DO LS / AI / DI 253
114
LED Blue

240
138 254
241
115
139 161
116 185
140 188
117 PVG / VOUT / 164
141 Timer In / DO / AI / DI 191
122 AI / DI 167
146 194
123 170
147
124 247
148
Sensor Supply 234
221
GND

209 235
222 248
210 236
223 249
211 CAN 0 - 3 CAN Termination 237
224 250
212 216
225 229
213 218
226 219
214
Ethernet 231
227
CAN 4 - 6 232
215
228 242
Serial / LIN 255
233 RTC 208

"TTTech
-
25
Internal"
2.12 WS10 - Incremental Encoder
Training Kit » Incremental Encoder
Components » Prop Val 2

Target » Configuring frequency inputs in incremental encoder mode


» Configuring PWM outputs with PID current control loop
» Using libraries

Description » Configure input pin to read an Incremental Encoder (Pin 115 and Pin 139).
» Configure Pin 115 as Incremental Encoder input and do not apply settings to
Pin 139. Change the pull resistor of Pin 115 to Pull up 10 kOhm.
» Configure output pin to control Prop Val 2 (Pin 156) in PWM mode with current
measurement.
» Switch on safety switch 0 to enable PWM output for Prop Val 2.
» Read Incremental Encoder and increment current setpoint with each encoder
turn in clockwise direction (limit current setpoint to 800 mA).
» Read Incremental Encoder and decrement current setpoint with each encoder
turn in counterclockwise direction (limit current setpoint to 0 mA).
» Use setpoint for PID current control of Prop Val 2.

Notes » In order to be able to activate PWM outputs, power stage and its corresponding
safety switch need to be enabled.
» After downloading the application, a power cycle needs to be performed to
reset the controller from safe state – only after a power cycle the controller is in
safe run and able to activate outputs.
» If outputs cannot be activated, state of safety switches and diagnostic state of
safety platform need to be checked.
» Attention: To update variable values in the application, all variables mapped to
input / output signals need to be called at minimum once in the application.

Incremental Encoder

Sensor A Timer in 1
B
Sensor B Timer in 2

"TTTech
-
26
Internal"
Connection Diagram

HY-TTC 500
153
201
177
202
156
203
180
204
159
205 BAT+ 183
206 PWM / DO / DI
186
246 CPU
162
207 K15
+ 220 WAKE UP
(SSW A) 189
165
- 118
192
168
119 195
120 171
121
BAT-

Prop Valve 2
142 154
143 178
144 157
145 181
160
217
230
PWM / DO / DI 184
187
243 163
244
Sensor GND (SSW B) 190
245 166
256 193
257 169
258 196
103 172
127 101
104 125
128 PWM / DO / DI / 150
105 AI 3-Mode PWD 174
129 102
106 126
130 (SSW C) 151
107 175
131 149
108 173
132 AI 2-Mode 152
109 10V 176
133 DO HS / AI / DI 155
110 179
134 158
111 182
135 251
112 238
136 AI 2-Mode 252
113 32V 239
137 DO LS / AI / DI 253
114 240
138 254
Sensor A 241
115
Sensor B 139 161
116 185
140 188
117 PVG / VOUT / 164
141 Timer In / DO / AI / DI 191
122 AI / DI 167
146 194
123 170
147
124 247
148
Sensor Supply 234
221
209 235
222 248
210 236
223 249
211 CAN 0 - 3 CAN Termination 237
224 250
212 216
225 229
213 218
226 219
214
Ethernet 231
227
CAN 4 - 6 232
215
228 242
Serial / LIN 255
233 RTC 208

"TTTech
-
27
Internal"
2.13 WS11 - CAN 2.0b
Training Kit » Peak USB
Components » Pot Red
» Led Red

Target » Configuration of 5V sensor supply


» Configuration of analog inputs in voltage mode
» Configuration of PWM outputs
» Reading CAN 2.0b messages
» Writing CAN 2.0b messages
» Using libraries
» Using PCAN View

Description » Connect Pot Red (Pin 107) to sensor supply (5V) and switch it on
» Configure input pin to read Pot Red in analog mode (voltage measurement 0 –
5000 mV).
» Configure output pin to control Led Red (Pin 153) in PWM mode.
» Switch on safety switch 0 to enable PWM output for Led Red.
» Initialize CAN 1 communication with 250 Kbit/s.
» Configure CAN 1 mailbox to send CAN ID 0x100 with a length of 8 bytes and
value of Pot Red copied to byte 0 / byte 1.
» Send this message over CAN 1 and verify using PCAN View.
» Configure CAN 1 mailbox to read CAN ID 0x200 with a length of 8 bytes and
setpoint (0 – 65535) for Led Red.
» Send this message using PCAN View and verify on the controller.
» Connect PEAK USB to CAN 1 and configure it with 250 Kbit/s.
» Use cl_base_unsafe library to get functions to split and merge bytes for CAN
messages.

Notes » In order to be able to activate PWM outputs, power stage and its corresponding
safety switch need to be enabled.
» After downloading the application, a power cycle needs to be performed to
reset the controller from safe state – only after a power cycle the controller is in
safe run and able to activate outputs.
» If outputs cannot be activated, state of safety switches and diagnostic state of
safety platform need to be checked.
» Attention: To update variable values in the application, all variables mapped to
input / output signals need to be called at minimum once in the application.

"TTTech
-
28
Internal"
Connection Diagram

HY-TTC 500
153
201
177
202
156
203
180
204
159
205 BAT+ 183
206 PWM / DO / DI
186
246 CPU
162
207 K15
+ 220 WAKE UP
(SSW A) 189
165
- 118
192
168
119 195
120 171
121
142
BAT- 154
143 178

LED Red
144 157
145 181
160
217
230
PWM / DO / DI 184
187
243 163
244
Sensor GND (SSW B) 190
245 166
256 193
257 169
258 196
103 172
127 101
Pot Red

104 125
128 PWM / DO / DI / 150
AI 3-Mode

GND
105 PWD 174
129 102
106 126
130 (SSW C) 151
107 175
131 149
108 173
132 AI 2-Mode 152
109 10V 176
133 DO HS / AI / DI 155
110 179
134 158
111 182
135 251
112 238
136 AI 2-Mode 252
113 32V 239
137 DO LS / AI / DI 253
114 240
138 254
241
115
139 161
116 185
140 188
117 PVG / VOUT / 164
141 Timer In / DO / AI / DI 191
122 AI / DI 167
146 194
123 170
147
124 247
148
Sensor Supply 234
221
PEAK USB

209 235
222 248
210 236
223 249
211 CAN 0 - 3 CAN Termination 237
224 250
212 216
225 229
213 218
226 219
214
Ethernet 231
227
CAN 4 - 6 232
215
228 242
Serial / LIN 255
233 RTC 208

"TTTech
-
29
Internal"
2.14 WS12 - J1939
Training Kit » Vehicle Display Controller
Components » Prop Val 2

Target » Reading J1939 messages


» Configuring PWM outputs with PID current control loop
» Using libraries

Description » Configure output pin to control Prop Val 2 (Pin 156) in PWM mode with current
measurement.
» Switch on safety switch 0 to enable PWM output for Prop Val 2.
» Connect Vehicle Display Controller to CAN.
» Initialize CAN 1 communication with 250 Kbit/s.
» Configure CAN 1 mailbox to read J1939 message of Joystick (Source Address:
16#F1, Parameter Group Number: 16#FF03).
» If x axis is pushed to the right (rising edge detection), increment current
setpoint by 50 (limit current setpoint to 800 mA).
» If x axis is pushed to the left (rising edge detection), decrement current setpoint
by 50 (limit current setpoint to 0 mA).
» Use setpoint for PID current control of Prop Val 2.
» Use Standard library to detect a rising edge of a signal.

Notes » In order to be able to activate PWM outputs, power stage and its corresponding
safety switch need to be enabled.
» After downloading the application, a power cycle needs to be performed to
reset the controller from safe state – only after a power cycle the controller is in
safe run and able to activate outputs.
» If outputs cannot be activated, state of safety switches and diagnostic state of
safety platform need to be checked.
» Attention: To update variable values in the application, all variables mapped to
input / output signals need to be called at minimum once in the application.

"TTTech
-
30
Internal"
Connection Diagram

HY-TTC 500
153
201
177
202
156
203
180
204
159
205 BAT+ 183
206 PWM / DO / DI
186
246 CPU
162
207 K15
+ 220 WAKE UP
(SSW A) 189
165
- 118
192
168
119 195
120 171
121
BAT-

Prop Valve 2
142 154
143 178
144 157
145 181
160
217
230
PWM / DO / DI 184
187
243 163
244
Sensor GND (SSW B) 190
245 166
256 193
257 169
258 196
103 172
127 101
104 125
128 PWM / DO / DI / 150
105 AI 3-Mode PWD 174
129 102
106 126
130 (SSW C) 151
107 175
131 149
108 173
132 AI 2-Mode 152
Grayhill Vehicle Dispaly Controller

109 10V 176


133 DO HS / AI / DI 155
110 179
134 158
111 182
135 251
112 238
136 AI 2-Mode 252
113 32V 239
137 DO LS / AI / DI 253
114 240
138 254
241
115
139 161
116 185
140 188
117 PVG / VOUT / 164
141 Timer In / DO / AI / DI 191
122 AI / DI 167
146 194
123 170
147
124 247
148
Sensor Supply 234
221
209 235
222 248
210 236
223 249
211 CAN 0 - 3 CAN Termination 237
224 250
212 216
225 229
213 218
226 219
214
Ethernet 231
227
CAN 4 - 6 232
GND

215
228 242
Serial / LIN 255
233 RTC 208

"TTTech
-
31
Internal"
2.15 WS13 - CANopen
Training Kit » Inclination Sensor 2
Components » Prop Val 2

Target » Installing EDS files


» Configure CANopen master
» Configure CANopen slave
» Configure PWM outputs with PID current control loop
» Using libraries

Description » Configure CANopen master functionality and add EDS file (see USB stick) of
Inclination Sensor 2.
» Connect Inclination Sensor 2 to CAN 1.
» Configure Inclination Sensor 2:
» Add CANopen manager in CAN section
» Configure node ID, heartbeat and sync
» Install EDS file in device repository
» Add device in CANopen manager
» Configure send PDO messages
» Configure CAN1 with a baud rate of 125 Kbit/s
» Read Inclination Sensor 2 values via CANopen
» Configure output pin to control Prop Val 2 (Pin 156) in PWM mode with current
measurement.
» Switch on safety switch 0 to enable PWM output for Prop Val 2.
» Read current value of Inclination Sensor 2 and convert it from 4000 – 20000 µA
to 0 – 800 mA.
» Use this value as setpoint for PID current control of Prop Val 2.

Notes » In order to be able to activate PWM outputs, power stage and its corresponding
safety switch need to be enabled.
» After downloading the application, a power cycle needs to be performed to
reset the controller from safe state – only after a power cycle the controller is in
safe run and able to activate outputs.
» If outputs cannot be activated, state of safety switches and diagnostic state of
safety platform need to be checked.
» Attention: To update variable values in the application, all variables mapped to
input / output signals need to be called at minimum once in the application.

"TTTech
-
32
Internal"
Connection Diagram

HY-TTC 500
153
201
177
202
156
203
180
204
159
205 BAT+ 183
206 PWM / DO / DI
186
246 CPU
162
207 K15
+ 220 WAKE UP
(SSW A) 189
165
- 118
192
168
119 195
120 171
121
BAT-

Prop Valve 2
142 154
143 178
144 157
145 181
160
217
230
PWM / DO / DI 184
187
243 163
244
Sensor GND (SSW B) 190
245 166
256 193
257 169
258 196
103 172
127 101
104 125
128 PWM / DO / DI / 150
105 AI 3-Mode PWD 174
129 102
106 126
130 (SSW C) 151
107 175
131 149
108 173
132 AI 2-Mode 152
109 10V 176
133 DO HS / AI / DI 155
110 179
134 158
111 182
135 251
112 238
136 AI 2-Mode 252
113 32V 239
137 DO LS / AI / DI 253
114 240
138 254
241
115
139 161
116 185
140 188
117 PVG / VOUT / 164
141 Timer In / DO / AI / DI 191
122 AI / DI 167
146 194
123 170
147
Inclination Sensor 2

124 247
148
Sensor Supply 234
221
209 235
222 248
210 236
223 249
211 CAN 0 - 3 CAN Termination 237
224 250
212 216
225 229
213 218
226 219
214
Ethernet 231
227
CAN 4 - 6 232
GND

215
228 242
Serial / LIN 255
233 RTC 208

"TTTech
-
33
Internal"
2.16 WS14 - Front loader
Training Kit » Pot Blue
Components » Switch Blue
» Rocker Switch 1
» Led Green
» Led Red
» Prop Val 1
» Prop Val 2

Target » Configuring digital and analog inputs


» Configuring digital and PWM outputs
» Error detection on outputs
» Using libraries

Description » Configuration of components:


» Pin 107 – voltage mode – input pin to read Pot Blue (joystick)
» Pin 115 – digital mode – input pin to read Button Blue (door switch)
» Pin 139 – digital mode – input pin to read Rocker Switch 1 (mode)
» Pin 177 – PWM mode – output pin to control Led Green (unload bucket)
» Pin 180 – PWM mode – output pin to control Led Red (load bucket)
» Pin 153 – PWM mode – output pin to control Prop Val 1 (raise loader)
» Pin 156 – PWM mode – output pin to control Prop Val 2 (lower bucket)

» Logic:
» Rocker Switch 1 pressed: raise/lower mode
Rocker Switch 1 not pressed: load/unload mode
» Button Blue pressed: all front loader functions are enabled
Button Blue not pressed: all functions are disabled (setpoints = 0)
» Pot Blue is used as setpoint for “raise / lower” and “load / unload” functions
» 2.5 V: 0% setpoint
» 0.5 V – 2.3 V: 100% - 0% setpoint for lower bucket and load bucket
» 2.7 V – 4.5 V: 0% - 100% setpoint for raise bucket and unload bucket
» < 0.5 V or > 4.5 V: error state – all outputs are switched off
» “Load / unload” functions are controlled in PWM open loop mode
» “Raise / lower” functions are controlled in PWM current closed loop mode

Notes » In order to be able to activate PWM outputs, power stage and its corresponding
safety switch need to be enabled.
» After downloading the application, a power cycle needs to be performed to
reset the controller from safe state – only after a power cycle the controller is in
safe run and able to activate outputs.
» If outputs cannot be activated, state of safety switches and diagnostic state of
safety platform need to be checked.
» Attention: To update variable values in the application, all variables mapped to
input / output signals need to be called at minimum once in the application.

"TTTech
-
34
Internal"
Connection Diagram

HY-TTC 500
153
201
177
202
156
203
180
204
159
205 BAT+ 183
206 PWM / DO / DI
186
246 CPU
162
207 K15
+ 220 WAKE UP
(SSW A) 189
165
- 118
192
168
119 195
120 171
121
BAT-

Prop Valve 2

Prop Valve 1
142 154

LED Green
143 178
144 157

LED Red
145 181
160
217
230
PWM / DO / DI 184
187
243 163
244
Sensor GND (SSW B) 190
245 166
256 193
257 169
258 196
103 172
Rocker Switch 1

127
Pot Blue

101
104 125
128 PWM / DO / DI / 150
AI 3-Mode
Button Blue

GND

GND

GND

GND
105 PWD 174
129 102
106 126
130 (SSW C) 151
107 175
131 149
108 173
132 AI 2-Mode 152
109 10V 176
133 DO HS / AI / DI 155
110 179
134 158
111 182
135 251
112 238
136 AI 2-Mode 252
113 32V 239
137 DO LS / AI / DI 253
114 240
138 254
241
115
139 161
116 185
140 188
117 PVG / VOUT / 164
141 Timer In / DO / AI / DI 191
122 AI / DI 167
146 194
123 170
147
124 247
148
Sensor Supply 234
221
209 235
222 248
210 236
223 249
211 CAN 0 - 3 CAN Termination 237
224 250
212 216
225 229
213 218
226 219
214
Ethernet 231
227
CAN 4 - 6 232
215
228 242
Serial / LIN 255
233 RTC 208

"TTTech
-
35
Internal"
2.17 WS15 - CODESYS SIL2
Plugin
Training Kit » Pot Red
Components » Led Red

Target » Configuring analog inputs


» Configuring PWM outputs
» Understanding principles of SIL2 plugin:
» Safe PRG vs. unsafe PRG
» GVL vs. EVL
» SIL2 exceptions
» Using CAN in SIL2 plugin
» Using libraries

Description » Implement the example from WS11 – CAN 2.0b with CODESYS SIL2 plugin.
» Configure input pin to read Pot Red (Pin 103) in analog mode (voltage
measurement 0 – 5000 mV).
» Following safety configuration shall be used: value shall be between
10% - 90% of the sensor supply .
» If one the following conditions is met, the ECU switches to safe state:
» Pot Red is disconnected from the input pin
» Sensor ground is disconnected from Pot Red
» Sensor supply 0 is disconnected from Pot Red
» Red Pot is defective, or the set value is <10% or >90%
» Configure output pin to control Led Red (Pin 153) in PWM mode.
» Following safety configuration shall be used: current check is enabled and set
trigger to 3 A .
» If one the following conditions is met, the ECU switches to safe state
» Led Red is disconnected
» Output is shorted to ground
» Output is shorted to BAT+

SIL2 plugin » Safe vs. Unsafe PRGs


» CAN 2.0b is unsafe
» This is the reason why it needs to be executed within an unsafe PRG.
» Function Blocks (FB) and Functions (FUN) are safe.
» Applications which implement unsafe FBs or FUNs need to implement
those functions in a CODESYS library and need to add this library to the
CODESYS project.
» The library needs to have the property SIL2 set to false (see for example
cl_base_unsafe library).

» GVL vs. EVL


» Global variable lists are safe
» Exchange variable lists are unsafe
» Exchanging data between unsafe and safe PRGs is done via EVLs
» Validity checks (e. g. plausibility checks, signal range checks, ...) need to
be implemented when using EVLs in safe POUs
» GVL variables cannot be modified within unsafe POUs

"TTTech
-
36
Internal"
» SIL2 exceptions
» SIL2 exceptions trigger the "DEBUG" mode of the controller
» SIL2 exceptions are generated e. g. in case of:
» An unsafe POU tries to write a safe variable (e. g. GVL)
» An unsafe POU is called by a safe POU

» To be able to login to an ECU with SIL2 plugin enabled please perform


following steps:
» SIL2 -> Enter debug mode
(This mode forces the controller to enter into safe state and enables
download and debugging capabilities. Safety Switches and outputs are
switched off. Controller is in mode "DEBUG")
» Download an application
» Logout
» Power cycle controller
» Login
» If no SIL 2 exceptions are present, application runs in "SAFE RUN"
» If controller is in mode "DEBUG", please check SIL2 warnings in message
and log window.

Notes » In order to be able to activate PWM outputs, power stage and its corresponding
safety switch need to be enabled.
» After downloading the application, a power cycle needs to be performed to
reset the controller from safe state – only after a power cycle the controller is in
safe run and able to activate outputs.
» If outputs cannot be activated, state of safety switches and diagnostic state of
safety platform need to be checked.
» Attention: To update variable values in the application, all variables mapped to
input / output signals need to be called at minimum once in the application
» Current feedback shall be read cyclically – set the safety configuration flag
“enable_current_check” to TRUE.
» Current feedback shall be mapped to a program variable within a POU
» If this current check is not implemented, safe mode is triggered with the
diagnostic error code IO_PWM_CURRENT.

"TTTech
-
37
Internal"
Connection Diagram

HY-TTC 500
153
201
177
202
156
203
180
204
159
205 BAT+ 183
206 PWM / DO / DI
186
246 CPU
162
207 K15
+ 220 WAKE UP
(SSW A) 189
165
- 118
192
168
119 195
120 171
121
142
BAT- 154
143 178

LED Red
144 157
145 181
160
217
230
PWM / DO / DI 184
187
243 163
244
Sensor GND (SSW B) 190
245 166
256 193
257 169
258 196
103 172
127 101
Pot Red

104 125
128 PWM / DO / DI / 150
AI 3-Mode

GND
105 PWD 174
129 102
106 126
130 (SSW C) 151
107 175
131 149
108 173
132 AI 2-Mode 152
109 10V 176
133 DO HS / AI / DI 155
110 179
134 158
111 182
135 251
112 238
136 AI 2-Mode 252
113 32V 239
137 DO LS / AI / DI 253
114 240
138 254
241
115
139 161
116 185
140 188
117 PVG / VOUT / 164
141 Timer In / DO / AI / DI 191
122 AI / DI 167
146 194
123 170
147
124 247
148
Sensor Supply 234
221
PEAK USB

209 235
222 248
210 236
223 249
211 CAN 0 - 3 CAN Termination 237
224 250
212 216
225 229
213 218
226 219
214
Ethernet 231
227
CAN 4 - 6 232
215
228 242
Serial / LIN 255
233 RTC 208

"TTTech
-
38
Internal"
2.18 WS16 - CANopen Safety
Please refer to the workshop section for HY-TTC 30 family (D-HYTTC-TM-20-008) for an
example of a CANopen Safety Master with HY-TTC 580 and HY-TTC 30XS (WS16).

"TTTech
-
39
Internal"
2.19 WS17 - Callbacks
error and notification callbacks
Training Kit » Led Red
Components » Led Green
» Led Blue
» Pot Red
» Pot Green
» Pot Blue

Target » Configuring analog inputs (with safety configuration)


» Configuring PWM outputs (with safety configuration)
» Configuring error callback to handle permanent errors
» Configuring notification callback to handle fatal errors

Description » Connect Pot Red (Pin 103) to sensor supply 0 (5 V) and switch it on.
» Connect Pot Green (Pin 127) to Sensor Supply 0 (5 V) and switch it on.
» Connect Pot Blue (Pin 104) to Sensor Supply 1 (5 V) and switch it on.
» Configure input pin to read Pot Red (Pin 103) in analog mode (voltage
measurement 0 - 5000 mV) – with safety configuration enabled (lower limit
10% - upper limit 90%).
» Configure input pin to read Pot Green (PIN 127) in analog mode (voltage
measurement 0 - 5000 mV) – with safety configuration enabled (lower limit
10% - upper limit 90%).
» Configure input pin to read Pot Blue (PIN 104) in analog mode (voltage
measurement 0 - 5000 mV) – with safety configuration enabled (lower limit
10% - upper limit 90%).
» Configure output pin to control Led Red (Pin 153) in PWM mode
» Configure output pin to control Led Green (Pin 154) in PWM mode
» Configure output pin to control Led Blue (Pin 101) in PWM mode
» Read voltage value of the Pot Red / Pot Green / Pot Blue and convert it from
0 - 5000 mV to 0 – 65535.
» Use converted value as duty cycle setpoint for Led Red, Led Green, Led Blue.
» Configure error callback to disable safety switch 0 / 1 / 2 in case of signal range
check errors on analog inputs Pot Red, Pot Green, Pot Blue
(DIAG_E_ADC_RANGE).

Testing » Power cycle unit and verify that ECU is in “safe run” (no safe state).
» Put Pot Red to 0 V and verify that Led Red switches off (verify diagnostic error
codes).
» Put Pot Red back to middle position, power cycle the unit and verify that ECU
is in “safe run” (no safe state).
» Put Pot Green to 0 V and verify that Led Green switches off (verify diagnostic
error codes).
» Put Pot Green back to middle position, power cycle the unit and verify that ECU
is in “safe run” (no safe state).
» Put Pot Blue to 0 V and verify that Led Blue switches off (verify diagnostic error
codes).
» Put Pot Blue back to middle position, power cycle the unit and verify that ECU
is in “safe run” (no safe state).
» Repeat these steps by setting Pot Red / Pot Green / Pot Blue to 5 V (100%).
» Put all potentiometers to middle position, power cycle the unit and verify that
ECU is in “safe run” (no safe state).
» Disconnect one Led: verify that ECU switches to Safe State and all the LEDs
are off - the error callback function does not handle this situation (verify
diagnostic error codes), hence safe state is triggered.

"TTTech
-
40
Internal"
Notes » In order to be able to activate PWM outputs, power stage and its corresponding
safety switch need to be enabled.
» After downloading the application, a power cycle needs to be performed to
reset the controller from safe state – only after a power cycle the controller is in
safe run and able to activate outputs.
» If outputs cannot be activated, state of safety switches and diagnostic state of
safety platform need to be checked.
» Attention: To update variable values in the application, all variables mapped to
input / output signals need to be called at minimum once in the application.

"TTTech
-
41
Internal"
Connection Diagram

HY-TTC 500
153
201
177
202
156
203
180
204
159
205 BAT+ 183
206 PWM / DO / DI
186
246 CPU
162
207 K15
+ 220 WAKE UP
(SSW A) 189
165
- 118
192
168
119 195
120 171
121
142
BAT- 154
143 178

LED Red
144 157
145 181
160
217
230
PWM / DO / DI 184
187
243 163
244
Sensor GND (SSW B) 190
245 166
256 193
257 169
258 196
103 172

LED Green
127 101
Pot Red

104 125
PWM / DO / DI /

GND
128 150
105 AI 3-Mode PWD 174
129 102
106 126
130 (SSW C) 151
107 175
131 149
Pot Green

108 173
132 AI 2-Mode 152
109 10V 176
133 DO HS / AI / DI 155
110 179
134 158
LED Blue

182
GND
111
135 251
112 238
136 AI 2-Mode 252
Pot Blue

113 32V 239


137 DO LS / AI / DI 253
114 240
138 254
241
115
139 161
116 185
140 188
117 PVG / VOUT / 164
141 Timer In / DO / AI / DI 191
GND

122 AI / DI 167
146 194
123 170
147
124 247
148
Sensor Supply 234
221
209 235
222 248
210 236
223 249
211 CAN 0 - 3 CAN Termination 237
224 250
212 216
225 229
213 218
226 219
214
Ethernet 231
227
CAN 4 - 6 232
215
228 242
Serial / LIN 255
233 RTC 208

"TTTech
-
42
Internal"
3 Legal Disclaimer
This document is proprietary to TTControl GmbH and no ownership rights are hereby transferred. No
part of this document shall be used, reproduced, translated, converted, adapted, stored in an information
storage or a retrieval system, communicated or transmitted in any form or by any means (electronic or
mechanical, including photocopying, recording), for any commercial purpose, including without
limitation, sale, resale, license, rental or lease, without the prior express written consent of TTControl
GmbH.

TTControl GmbH does not make any representations, warranties or guarantees, express or implied, as
to the accuracy or completeness of the document. The information in this document is subject to change
without notice and does not represent a commitment on the part of TTControl GmbH. Users must be
aware that updates and amendments will be made from time to time to the document. It is the user’s
responsibility to determine whether there have been any such updates or amendments. Neither
TTControl GmbH nor any of its directors, officers, employees or agents shall be liable in contract, tort or
in any other manner whatsoever to any person for any loss, damage, injury, liability, cost or expense of
any nature, including without limitation incidental, special, direct or consequential damages arising out
of or in connection with the use of this document.

"TTTech
-
43
Internal"

You might also like