Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ev3-toolbox-matlab
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Container registry
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mindstorms
ev3-toolbox-matlab
Commits
4f85a5da
Commit
4f85a5da
authored
8 years ago
by
Tim Stadtmann
Browse files
Options
Downloads
Patches
Plain Diff
Fix issue #20
Flag 'sendPowerOnSet' is now correctly set
parent
0fb15802
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
source/Motor.m
+13
-11
13 additions, 11 deletions
source/Motor.m
with
13 additions
and
11 deletions
source/Motor.m
+
13
−
11
View file @
4f85a5da
...
...
@@ -124,8 +124,8 @@ classdef Motor < handle & dynamicprops
connectedToBrick
=
false
;
% Connection to physical Brick?
sendPowerOnNextStart
=
false
;
% Indicates whether current power parameter should be sent
% to the Brick right before starting it next time
sendPowerOnSet
=
tru
e
;
% Indicates whether power parameter should be sent to the Brick
% immediately after setting it
sendPowerOnSet
=
fals
e
;
% Indicates whether power parameter should be sent to the Brick
% immediately after setting it
limitSetToZero
=
false
;
% Indicates whether limitValue has been set to zero
% (workaround for a bug, see motor.start, Note 2)
init
=
true
;
% Indicates 'init-phase' (True as long as constructor is running)
...
...
@@ -636,12 +636,15 @@ classdef Motor < handle & dynamicprops
if
limitValue
==
0
&&
motor
.
limitValue
~=
0
motor
.
sendPowerOnNextStart
=
true
;
motor
.
limitSetToZero
=
true
;
motor
.
sendPowerOnSet
=
true
;
elseif
limitValue
~=
0
&&
motor
.
limitValue
==
0
motor
.
sendPowerOnSet
=
false
;
end
end
if
limitValue
==
0
motor
.
sendPowerOnSet
=
true
;
else
motor
.
sendPowerOnSet
=
false
;
end
motor
.
limitValue
=
limitValue
;
end
...
...
@@ -736,6 +739,7 @@ classdef Motor < handle & dynamicprops
if
motor
.
init
motor
.
port
=
p
.
Results
.
port
;
end
motor
.
power
=
p
.
Results
.
power
;
motor
.
limitValue
=
p
.
Results
.
limitValue
;
motor
.
limitMode
=
p
.
Results
.
limitMode
;
motor
.
brakeMode
=
p
.
Results
.
brakeMode
;
...
...
@@ -744,9 +748,9 @@ classdef Motor < handle & dynamicprops
motor
.
smoothStart
=
p
.
Results
.
smoothStart
;
motor
.
smoothStop
=
p
.
Results
.
smoothStop
;
motor
.
sendPowerOnSet
=
false
;
motor
.
power
=
p
.
Results
.
power
;
motor
.
sendPowerOnSet
=
true
;
if
motor
.
limitValue
==
0
motor
.
sendPowerOnSet
=
true
;
end
end
%% Getter
...
...
@@ -825,11 +829,9 @@ classdef Motor < handle & dynamicprops
if
~
motor
.
connectedToBrick
error
([
'Motor::getTachoCount: Motor-Object not connected to comm handle.'
,
...
'You have to call motor.connect(commInterface) first!'
]);
elseif
~
motor
.
physicalMotorConnected
error
(
'Motor::getTachoCount: No physical motor connected to Port %s'
,
...
port2str
(
'Motor'
,
motor
.
port
));
end
% assert(motor.physicalMotorConnected==true);
assert
(
motor
.
limitValue
==
0
);
if
motor
.
speedRegulation
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment