Changeset 659
- Timestamp:
- 07/14/09 21:08:02 (4 years ago)
- Files:
-
- 4 modified
-
branches/atorf/NXC/MotorControl2/MotorControl20.nxc (modified) (1 diff)
-
trunk/mfiles/@NXTMotor/NXTMotor.m (modified) (3 diffs)
-
trunk/mfiles/@NXTMotor/display.m (modified) (2 diffs)
-
trunk/mfiles/NXC_ResetErrorCorrection.m (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/atorf/NXC/MotorControl2/MotorControl20.nxc
r657 r659 629 629 630 630 //ResetErrorCorrection(port); 631 //TODO check if motor is ready 631 632 MotorCmdSingleReset(port, power, angle, speedreg); 632 633 -
trunk/mfiles/@NXTMotor/NXTMotor.m
r654 r659 40 40 % once the |TachoLimit| (which must not be 0) is reached, forcing a hard 41 41 % stop at precisely the desired position (+/- some degrees) 42 %43 % * |TurnRatio| - integer from -100 to 100 (default is 0) which shifts the load ratio44 % between motors when driving synchronized (i.e. when adressing 245 % motors). 0 means equal load between motors, 50 means one motor46 % is stopped with the other turning, and 100 should let both47 % motors spin in opposite directions. Negative values from -10048 % to 0 reverse the direction of turning. Use in conjunction with49 % a positive value of |Power|.50 %51 42 % 52 43 % For a list of valid methods, see the "See also" section below. … … 79 70 % Signature 80 71 % Author: Aulis Telle, Alexander Behrens, Linus Atorf (see AUTHORS) 81 % Date: 200 8/10/2272 % Date: 2009/07/14 82 73 % Copyright: 2007-2008, RWTH Aachen University 83 74 % … … 267 258 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 268 259 269 function obj = set.TurnRatio(obj, val)270 % TurnRatio must be a scalar, be numeric, be an integer and in the range [-100 100]271 if isscalar(val) && isnumeric(val) && abs(val) <= 100 && all(rem(val,1) == 0)272 obj.TurnRatio = val;273 else274 error('MATLAB:RWTHMindstormsNXT:InvalidTurnRatio',...275 'TurnRatio must be a numeric scalar and an integer in the range [-100, 100].');276 end277 end260 % function obj = set.TurnRatio(obj, val) 261 % % TurnRatio must be a scalar, be numeric, be an integer and in the range [-100 100] 262 % if isscalar(val) && isnumeric(val) && abs(val) <= 100 && all(rem(val,1) == 0) 263 % obj.TurnRatio = val; 264 % else 265 % error('MATLAB:RWTHMindstormsNXT:InvalidTurnRatio',... 266 % 'TurnRatio must be a numeric scalar and an integer in the range [-100, 100].'); 267 % end 268 % end 278 269 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 279 270 -
trunk/mfiles/@NXTMotor/display.m
r655 r659 43 43 ' TachoLimit: ' infoStrTachoLimit(obj.TachoLimit) '\n' ... 44 44 ' ActionAtTachoLimit: ' infoStrActionAtTachoLimit( obj.ActionAtTachoLimit) '\n' ... 45 ' TurnRatio: ' infoStrTurnRatio(obj.TurnRatio) '\n' ...46 45 '\n']); 47 46 else … … 135 134 end %% END FUNCTION INFOSTRACTIONATTACHOLIMIT 136 135 137 function s = infoStrTurnRatio(b)138 s = num2str(b);139 if b == 0140 s = [s, ' (straight: same direction, same speed)'];141 elseif abs(b) > 0 && abs(b) < 50142 s = [s, blanks(12 - length(s)), '(same direction, different speeds)'];143 elseif abs(b) == 50144 s = [s, blanks(12 - length(s)), '(one motor stopped, one rotating)'];145 elseif abs(b) == 100146 s = [s, blanks(12 - length(s)), '(opposite directions, same speed)'];147 else148 s = [s, blanks(12 - length(s)), '(opposite directions, different speeds)'];149 end%ff150 151 end %% END FUNCTION INFOSTRTURNRATIO136 % function s = infoStrTurnRatio(b) 137 % s = num2str(b); 138 % if b == 0 139 % s = [s, ' (straight: same direction, same speed)']; 140 % elseif abs(b) > 0 && abs(b) < 50 141 % s = [s, blanks(12 - length(s)), '(same direction, different speeds)']; 142 % elseif abs(b) == 50 143 % s = [s, blanks(12 - length(s)), '(one motor stopped, one rotating)']; 144 % elseif abs(b) == 100 145 % s = [s, blanks(12 - length(s)), '(opposite directions, same speed)']; 146 % else 147 % s = [s, blanks(12 - length(s)), '(opposite directions, different speeds)']; 148 % end%ff 149 % 150 % end %% END FUNCTION INFOSTRTURNRATIO 152 151 153 152 function s = infoStrPower(b) -
trunk/mfiles/NXC_ResetErrorCorrection.m
r655 r659 162 162 163 163 for j = 1 : length(port) 164 NXTMOTOR_State( Port(j)+1).LastMsgToNXCSentTime = tic();164 NXTMOTOR_State(port(j)+1).LastMsgToNXCSentTime = tic(); 165 165 end%for 166 166
