Projekt

Allgemein

Profil

TDT-Protocol on CAN » Historie » Version 35

Maximilian Seesslen, 19.01.2023 11:38

1 12 Maximilian Seesslen
h1. Intro
2 1 Maximilian Seesslen
3 17 Maximilian Seesslen
With the TDT-Protocol sensors can just send their values on the BUS without complex object catalogue.
4
An monitor-software is able to display values without knowing anything about the sensors or their configuration.
5 24 Maximilian Seesslen
The CANId of sensors is actually their configurable ID or an global command.
6 1 Maximilian Seesslen
7 35 Maximilian Seesslen
CAN 2.0A: 0..0x7FF
8
CANOpen: 4 Bit Function code, 7 Bit Node-ID
9
Node-Id: 0..0x7F
10
Function-Code Mask: 0x780
11 1 Maximilian Seesslen
12 35 Maximilian Seesslen
Function code:
13
|_. Code |_. Decription    |_. Examples             |
14
| 0      | NMT             |                        |
15
| 1      | Alarms          |                        |
16
| 8      | System commands | Set Date, illumination |
17
| 15     | Sensor values   | Temperature            |
18
19
20 34 Maximilian Seesslen
|_. Size |_. Decription |_. Examples                                                       |
21 17 Maximilian Seesslen
| 1      | Sub-Id;      | Futher index; Sub-Sensor or more specifi kind of thing to be set |
22 35 Maximilian Seesslen
| 1      | Command      | Plain Sensor value; Set illumination                             |
23 17 Maximilian Seesslen
| 1      | Data type    | Int, Float, Time, Date, Percent, Promil, Multipacket-String      |
24 1 Maximilian Seesslen
| 1      | Unit         | Hz, °C, Time, Date, PWM, CAN-ID, Name, Description, Room         |
25 2 Maximilian Seesslen
| 4      | Value        | 32Bit                                                            |
26 28 Maximilian Seesslen
27
h2. Values
28
29
* Date: year 2B, month 1B, day 1B
30
* Time: hour 1B, minute 1B, second 1B, subsecond 1B
31 12 Maximilian Seesslen
32
h2. Device behaviour
33 1 Maximilian Seesslen
34
All devices should shut down after 5 hours when no master-heartbeat is received.
35
36 12 Maximilian Seesslen
h1. IDs, ranges and commands
37 17 Maximilian Seesslen
38 29 Maximilian Seesslen
h2. CAN IDs
39
40
* 11-Bit-Identifier, (CAN 2.0A); 2048; 0x800
41 2 Maximilian Seesslen
* 29-Bit-Identifier, (CAN 2.0B); 0x20000000
42 1 Maximilian Seesslen
43 10 Maximilian Seesslen
|_. Range      |_. Decription           |_. Examples              |
44 2 Maximilian Seesslen
| 0x010-0x0FF  | Alarms                 | Devices have an issue   |
45
| 0x100-0x1FF  | Control commands       | Set global actuator     |
46 9 Maximilian Seesslen
| 0x200-0x2FF  | Sensors/actors fixed   |                         |
47
| 0x300-0x6FF  | Sensors/actors dynamic |                         |
48
| 0x6FF-0x7FF  | Low priority boradcast | Power on devices        |
49 2 Maximilian Seesslen
50
h2. Global actuator
51 1 Maximilian Seesslen
52 14 Maximilian Seesslen
Global means that all actuators of an type is addressed and not one concrete partipiant.
53 2 Maximilian Seesslen
An specific partipiant can be specified when sending the target CAN-Id in the value.
54
In this way the message is still high priority other than the "Remote Transmission Request"
55 3 Maximilian Seesslen
56
|_. ID         |_. global actuator    |_. Decription                                  |
57 6 Maximilian Seesslen
| 0x100        | System command       | Perform system command; e.g. reboot, poweroff |
58 8 Maximilian Seesslen
| 0x101        | Date/Time            | Set date/time of all actuator                 |
59 1 Maximilian Seesslen
| 0x102        | Illumination         | Set brightness of lamps                       |
60 14 Maximilian Seesslen
| 0x103        | Powerswitch          | Power on devices                              |
61 8 Maximilian Seesslen
| 0x104        | Plant watering pump  | Automatically watering indoor plants          |
62 12 Maximilian Seesslen
63 1 Maximilian Seesslen
h2. System commands
64
65 12 Maximilian Seesslen
|_. Sub-ID     |_. Type              |
66
| 0x0          | Shutdown            |
67
| 0x1          | Heartbeat           |
68
69
h2. Illumination commands
70 13 Maximilian Seesslen
71
|_. Sub-ID     |_. Type                    |
72
| 0x0          | Set ambient light         |
73
| 0x1          | Get ambient light         |
74
| 0x2          | Set ambient light, fading |
75
| 0x3          | Get ambient light, fading |
76 1 Maximilian Seesslen
| 0x4          | Set plant light           |
77
| 0x5          | Get plant light           |
78
79
h2. Powerswitch commands
80
81
|_. Sub-ID     |_. Type                         |
82
| 0x0          | Set powerline for multimedia   |
83 17 Maximilian Seesslen
| 0x1          | Get powerline for multimedia   |
84
85
86
h1. Multipacket-Strings
87
88
|_. Address |_. Type          |
89
| 0x0       | Package count   |
90
| 0x1       | Package number  |
91
| 0x2..0x3  | Data            |
92
93
h1. Actuator introduction
94 1 Maximilian Seesslen
95 18 Maximilian Seesslen
When introduction is requested by system command, each device must send description for each subid.
96
97
h1. Example
98 23 Maximilian Seesslen
99
h2. Turn on the lights
100 27 Maximilian Seesslen
101
|_.Data   |_.Size   |_.Description                 |
102
|0x100    | 29 Bits | CAN-Id: Global command       |
103
|0x0      | 1 Byte  | Message-Type: Global command |
104
|0x0 	  | 1 Byte  | Sub-Id: Set ambient light    |
105
|0x1      | 1 Byte  | Data-Type: Integer           |
106
|0x1      | 1 Byte  | PWM: PWM permilli            |
107
|1000     | 4 Byte  | Value: Full Brightness       |
108 15 Maximilian Seesslen
109
110
h1. Usecases
111
112
* simple actors can filter message to "Global actuator" messages, at least "system commands"
113 25 Maximilian Seesslen
* There are 14 or 28 Filters on STM32Fs
114
115
h1. ID Assigning
116
117
Some STM32 have an internal 96-bit unique ID.
118
119
h1. V2
120
121
|_. Size |_. Decription |_. Examples                                                       |
122
| 1      | Packet type  | Standard TDT packet                                              |
123
| 1      | Sub-Id;      | Futher index; Sub-Sensor or more specifi kind of thing to be set |
124
| 1      | Data type    | Int, Float, Time, Date, Percent, Promil, Multipacket-String      |
125
| 1      | Unit         | Hz, °C, Time, Date, PWM, CAN-ID, Name, Description, Room         |
126
| 4      | Value        | 32Bit                                                            |
127
128
h2. Multimessage package
129 30 Maximilian Seesslen
130 31 Maximilian Seesslen
There should be the posssibillity to write the complete SPI-Flash even if it takes forever.
131
Not every slave needs to be able to send super big blocks. But every slave should be able to
132 30 Maximilian Seesslen
send e.g. descriptions.
133 32 Maximilian Seesslen
134
* Is order of messages an issue? Multiple Mailboxes.
135 25 Maximilian Seesslen
136
|_. Size |_. Decription |_. Examples                                                       |
137
| 1      | Packet type  | Multimessage package                                             |
138
| 1      | count        | Number of packages                                               |
139
| 1      | number       | 0: value=data length in bytes                                    |
140
| 4      | Value        | 32Bit                                                            |
141
142
|_. Size |_. Decription |_. Examples                                                       |
143
| 1      | Packet type  | Multimessage package 2                                           |
144
| 1      | id           | Mailbox                                                          |
145
| 1      | number       | 0: value=data length in bytes                                    |
146
|        |              | 1: value=number of messages                                      |
147 31 Maximilian Seesslen
|        |              | 2..x: data                                                       |
148 30 Maximilian Seesslen
| 4      | Value        | 32Bit                                                            |
149
150 1 Maximilian Seesslen
h2. Diagnose