Skip to content
Snippets Groups Projects
Commit 25b1dd83 authored by Tim Stadtmann's avatar Tim Stadtmann
Browse files

Fix issue #24

smoothStart/Stop will now be included in limitValue
parent e7b90ab9
Branches
Tags
No related merge requests found
......@@ -217,10 +217,16 @@ classdef Motor < handle & dynamicprops
fprintf('(DEBUG) Motor::start: Called outputStart on Port %s\n', port2str('Motor', motor.port));
end
else
limit = motor.limitValue - (motor.smoothStart + motor.smoothStop);
if limit < 0
error(['Motor::start: smoothStart/Stop invalid. ' ,...
'smoothStart + smoothStop has to be smaller than limitValue.']);
end
if strcmpi(motor.limitMode, 'Tacho')
if motor.speedRegulation
motor.commInterface.outputStepSpeed(0, motor.port, motor.power,...
motor.smoothStart, motor.limitValue, motor.smoothStop,...
motor.smoothStart, limit, motor.smoothStop,...
motor.brakeMode_);
if motor.debug
......@@ -229,7 +235,7 @@ classdef Motor < handle & dynamicprops
end
else
motor.commInterface.outputStepPower(0, motor.port, motor.power,...
motor.smoothStart, motor.limitValue, motor.smoothStop,...
motor.smoothStart, limit, motor.smoothStop,...
motor.brakeMode_);
if motor.debug
......@@ -240,7 +246,7 @@ classdef Motor < handle & dynamicprops
elseif strcmpi(motor.limitMode, 'Time')
if motor.speedRegulation
motor.commInterface.outputTimeSpeed(0, motor.port, motor.power,...
motor.smoothStart, motor.limitValue, motor.smoothStop,...
motor.smoothStart, limit, motor.smoothStop,...
motor.brakeMode_);
if motor.debug
......@@ -249,7 +255,7 @@ classdef Motor < handle & dynamicprops
end
else
motor.commInterface.outputTimePower(0, motor.port, motor.power,...
motor.smoothStart, motor.limitValue, motor.smoothStop,...
motor.smoothStart, limit, motor.smoothStop,...
motor.brakeMode_);
if motor.debug
......@@ -587,10 +593,10 @@ classdef Motor < handle & dynamicprops
error('Motor::set.smoothStart: Smooth start steps are out of bounds.');
end
if ~isempty(motor.limitValue) && steps>motor.limitValue
warning(['Motor::set.smoothStart: Smooth start steps are greater than ',...
'limitValue.']);
end
% if ~isempty(motor.limitValue) && steps>motor.limitValue
% warning(['Motor::set.smoothStart: Smooth start steps are greater than ',...
% 'limitValue.']);
% end
motor.smoothStart = steps;
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment