Skip to content

Commit 20d4401

Browse files
committed
Merge pull request #152 from ev3dev/feature-new-tacho-driver-attributes
Changes to support new tacho driver updates
2 parents 13df9c6 + 9c9e8d7 commit 20d4401

File tree

1 file changed

+86
-46
lines changed

1 file changed

+86
-46
lines changed

spec.json

Lines changed: 86 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
{
22
"meta": {
3-
"version": "1.0.0",
4-
"supportedKernel": "v3.16.7-ckt21-9-ev3dev"
3+
"version": "1.1.0",
4+
"specRevision": 0,
5+
"supportedKernel": {
6+
"pattern": "{upstream_version}-{kernel}-{flavour}",
7+
"kernels": [
8+
"10-ev3dev",
9+
"10-rc1-ev3dev"
10+
]
11+
}
512
},
613
"classes": {
714
"motor": {
@@ -19,7 +26,7 @@
1926
],
2027
"docsLink": "http://www.ev3dev.org/docs/drivers/tacho-motor-class/",
2128
"systemClassName": "tacho-motor",
22-
"systemDeviceNameConvention": "motor{0}",
29+
"systemDeviceNameConvention": "*",
2330
"systemProperties": [
2431
{ "name": "Address", "systemName": "address", "type": "string", "readAccess": true, "writeAccess": false,
2532
"description": [
@@ -59,8 +66,14 @@
5966
"description": [
6067
"Returns the number of tacho counts in one rotation of the motor. Tacho counts",
6168
"are used by the position and speed attributes, so you can use this value",
62-
"to convert rotations or degrees to tacho counts. In the case of linear",
63-
"actuators, the units here will be counts per centimeter."
69+
"to convert rotations or degrees to tacho counts. (rotation motors only)"
70+
]
71+
},
72+
{ "name": "Count Per M", "systemName": "count_per_m", "type": "int", "readAccess": true, "writeAccess": false,
73+
"description": [
74+
"Returns the number of tacho counts in one meter of travel of the motor. Tacho",
75+
"counts are used by the position and speed attributes, so you can use this",
76+
"value to convert from distance to tacho counts. (linear motors only)"
6477
]
6578
},
6679
{ "name": "Driver Name", "systemName": "driver_name", "type": "string", "readAccess": true, "writeAccess": false,
@@ -78,8 +91,7 @@
7891
"description": [
7992
"Writing sets the duty cycle setpoint. Reading returns the current value.",
8093
"Units are in percent. Valid values are -100 to 100. A negative value causes",
81-
"the motor to rotate in reverse. This value is only used when `speed_regulation`",
82-
"is off."
94+
"the motor to rotate in reverse."
8395
]
8496
},
8597
{ "name": "Encoder Polarity", "systemName": "encoder_polarity", "type": "string", "readAccess": true, "writeAccess": true,
@@ -91,6 +103,13 @@
91103
"`inversed`."
92104
]
93105
},
106+
{ "name": "Full Travel Count", "systemName": "full_travel_count", "type": "int", "readAccess": true, "writeAccess": false,
107+
"description": [
108+
"Returns the number of tacho counts in the full travel of the motor. When",
109+
"combined with the `count_per_m` atribute, you can use this value to",
110+
"calculate the maximum travel distance of the motor. (linear motors only)"
111+
]
112+
},
94113
{ "name": "Polarity", "systemName": "polarity", "type": "string", "readAccess": true, "writeAccess": true,
95114
"description": [
96115
"Sets the polarity of the motor. With `normal` polarity, a positive duty",
@@ -130,6 +149,13 @@
130149
"rotations or degrees."
131150
]
132151
},
152+
{ "name": "Max Speed", "systemName": "max_speed", "type": "int", "readAccess": true, "writeAccess": false,
153+
"description": [
154+
"Returns the maximum value that is accepted by the `speed_sp` attribute. This",
155+
"may be slightly different than the maximum speed that a particular motor can",
156+
"reach - it's the maximum theoretical speed."
157+
]
158+
},
133159
{ "name": "Speed", "systemName": "speed", "type": "int", "readAccess": true, "writeAccess": false,
134160
"description": [
135161
"Returns the current motor speed in tacho counts per second. Note, this is",
@@ -139,49 +165,43 @@
139165
},
140166
{ "name": "Speed SP", "systemName": "speed_sp", "type": "int", "readAccess": true, "writeAccess": true,
141167
"description": [
142-
"Writing sets the target speed in tacho counts per second used when `speed_regulation`",
143-
"is on. Reading returns the current value. Use the `count_per_rot` attribute",
144-
"to convert RPM or deg/sec to tacho counts per second."
168+
"Writing sets the target speed in tacho counts per second used for all `run-*`",
169+
"commands except `run-direct`. Reading returns the current value. A negative",
170+
"value causes the motor to rotate in reverse with the exception of `run-to-*-pos`",
171+
"commands where the sign is ignored. Use the `count_per_rot` attribute to convert",
172+
"RPM or deg/sec to tacho counts per second. Use the `count_per_m` attribute to",
173+
"convert m/s to tacho counts per second."
145174
]
146175
},
147176
{ "name": "Ramp Up SP", "systemName": "ramp_up_sp", "type": "int", "readAccess": true, "writeAccess": true,
148177
"description": [
149178
"Writing sets the ramp up setpoint. Reading returns the current value. Units",
150-
"are in milliseconds. When set to a value > 0, the motor will ramp the power",
151-
"sent to the motor from 0 to 100% duty cycle over the span of this setpoint",
152-
"when starting the motor. If the maximum duty cycle is limited by `duty_cycle_sp`",
153-
"or speed regulation, the actual ramp time duration will be less than the setpoint."
179+
"are in milliseconds and must be positive. When set to a non-zero value, the",
180+
"motor speed will increase from 0 to 100% of `max_speed` over the span of this",
181+
"setpoint. The actual ramp time is the ratio of the difference between the",
182+
"`speed_sp` and the current `speed` and max_speed multiplied by `ramp_up_sp`."
154183
]
155184
},
156185
{ "name": "Ramp Down SP", "systemName": "ramp_down_sp", "type": "int", "readAccess": true, "writeAccess": true,
157186
"description": [
158187
"Writing sets the ramp down setpoint. Reading returns the current value. Units",
159-
"are in milliseconds. When set to a value > 0, the motor will ramp the power",
160-
"sent to the motor from 100% duty cycle down to 0 over the span of this setpoint",
161-
"when stopping the motor. If the starting duty cycle is less than 100%, the",
162-
"ramp time duration will be less than the full span of the setpoint."
163-
]
164-
},
165-
{ "name": "Speed Regulation Enabled", "systemName": "speed_regulation", "type": "string", "readAccess": true, "writeAccess": true,
166-
"description": [
167-
"Turns speed regulation on or off. If speed regulation is on, the motor",
168-
"controller will vary the power supplied to the motor to try to maintain the",
169-
"speed specified in `speed_sp`. If speed regulation is off, the controller",
170-
"will use the power specified in `duty_cycle_sp`. Valid values are `on` and",
171-
"`off`."
188+
"are in milliseconds and must be positive. When set to a non-zero value, the",
189+
"motor speed will decrease from 0 to 100% of `max_speed` over the span of this",
190+
"setpoint. The actual ramp time is the ratio of the difference between the",
191+
"`speed_sp` and the current `speed` and max_speed multiplied by `ramp_down_sp`."
172192
]
173193
},
174-
{ "name": "Speed Regulation P", "systemName": "speed_pid/Kp", "type": "int", "readAccess": true, "writeAccess": true,
194+
{ "name": "Speed P", "systemName": "speed_pid/Kp", "type": "int", "readAccess": true, "writeAccess": true,
175195
"description": [
176196
"The proportional constant for the speed regulation PID."
177197
]
178198
},
179-
{ "name": "Speed Regulation I", "systemName": "speed_pid/Ki", "type": "int", "readAccess": true, "writeAccess": true,
199+
{ "name": "Speed I", "systemName": "speed_pid/Ki", "type": "int", "readAccess": true, "writeAccess": true,
180200
"description": [
181201
"The integral constant for the speed regulation PID."
182202
]
183203
},
184-
{ "name": "Speed Regulation D", "systemName": "speed_pid/Kd", "type": "int", "readAccess": true, "writeAccess": true,
204+
{ "name": "Speed D", "systemName": "speed_pid/Kd", "type": "int", "readAccess": true, "writeAccess": true,
185205
"description": [
186206
"The derivative constant for the speed regulation PID."
187207
]
@@ -304,22 +324,6 @@
304324
}
305325
]
306326
},
307-
{
308-
"propertyName": "Speed Regulation",
309-
"values": [
310-
{ "name": "on",
311-
"description": [
312-
"The motor controller will vary the power supplied to the motor",
313-
"to try to maintain the speed specified in `speed_sp`."
314-
]
315-
},
316-
{ "name": "off",
317-
"description": [
318-
"The motor controller will use the power specified in `duty_cycle_sp`."
319-
]
320-
}
321-
]
322-
},
323327
{
324328
"propertyName": "Stop Command",
325329
"values": [
@@ -349,6 +353,7 @@
349353
},
350354
"largeMotor": {
351355
"friendlyName": "Large Motor",
356+
"systemDeviceNameConvention": "*",
352357
"description": [
353358
"EV3 large servo motor"
354359
],
@@ -359,6 +364,7 @@
359364
},
360365
"mediumMotor": {
361366
"friendlyName": "Medium Motor",
367+
"systemDeviceNameConvention": "*",
362368
"description": [
363369
"EV3 medium servo motor"
364370
],
@@ -367,6 +373,39 @@
367373
],
368374
"inheritance": "motor"
369375
},
376+
"nxtMotor": {
377+
"friendlyName": "NXT Motor",
378+
"systemDeviceNameConvention": "*",
379+
"description": [
380+
"NXT servo motor"
381+
],
382+
"driverName": [
383+
"lego-nxt-motor"
384+
],
385+
"inheritance": "motor"
386+
},
387+
"firgelli50Motor": {
388+
"friendlyName": "Firgelli L12 50 Motor",
389+
"systemDeviceNameConvention": "linear{0}",
390+
"description": [
391+
"Firgelli L12 50 linear servo motor"
392+
],
393+
"driverName": [
394+
"fi-l12-ev3-50"
395+
],
396+
"inheritance": "motor"
397+
},
398+
"firgelli100Motor": {
399+
"friendlyName": "Firgelli L12 100 Motor",
400+
"systemDeviceNameConvention": "linear{0}",
401+
"description": [
402+
"Firgelli L12 100 linear servo motor"
403+
],
404+
"driverName": [
405+
"fi-l12-ev3-100"
406+
],
407+
"inheritance": "motor"
408+
},
370409
"dcMotor": {
371410
"friendlyName": "DC Motor",
372411
"description": [
@@ -1449,3 +1488,4 @@
14491488
}
14501489
}
14511490
}
1491+

0 commit comments

Comments
 (0)