Changeset 659

Show
Ignore:
Timestamp:
07/14/09 21:08:02 (4 years ago)
Author:
atorf
Message:
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • branches/atorf/NXC/MotorControl2/MotorControl20.nxc

    r657 r659  
    629629                 
    630630                    //ResetErrorCorrection(port); 
     631                    //TODO check if motor is ready 
    631632                    MotorCmdSingleReset(port, power, angle, speedreg); 
    632633 
  • trunk/mfiles/@NXTMotor/NXTMotor.m

    r654 r659  
    4040%           once the |TachoLimit| (which must not be 0) is reached, forcing a hard 
    4141%           stop at precisely the desired position (+/- some degrees) 
    42 % 
    43 % * |TurnRatio| - integer from -100 to 100 (default is 0) which shifts the load ratio 
    44 %           between motors when driving synchronized (i.e. when adressing 2 
    45 %           motors). 0 means equal load between motors, 50 means one motor 
    46 %           is stopped with the other turning, and 100 should let both 
    47 %           motors spin in opposite directions. Negative values from -100 
    48 %           to 0 reverse the direction of turning. Use in conjunction with 
    49 %           a positive value of |Power|. 
    50 %           
    5142% 
    5243%   For a list of valid methods, see the "See also" section below. 
     
    7970% Signature 
    8071%   Author: Aulis Telle, Alexander Behrens, Linus Atorf (see AUTHORS) 
    81 %   Date: 2008/10/22 
     72%   Date: 2009/07/14 
    8273%   Copyright: 2007-2008, RWTH Aachen University 
    8374% 
     
    267258        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    268259 
    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             else 
    274                 error('MATLAB:RWTHMindstormsNXT:InvalidTurnRatio',... 
    275                     'TurnRatio must be a numeric scalar and an integer in the range [-100, 100].'); 
    276             end 
    277         end 
     260%         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 
    278269        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    279270         
  • trunk/mfiles/@NXTMotor/display.m

    r655 r659  
    4343        '         TachoLimit: '    infoStrTachoLimit(obj.TachoLimit)    '\n' ... 
    4444        ' ActionAtTachoLimit: '    infoStrActionAtTachoLimit( obj.ActionAtTachoLimit) '\n' ... 
    45         '          TurnRatio: '    infoStrTurnRatio(obj.TurnRatio)         '\n' ... 
    4645        '\n']); 
    4746else 
     
    135134end %% END FUNCTION INFOSTRACTIONATTACHOLIMIT 
    136135 
    137 function s = infoStrTurnRatio(b) 
    138     s = num2str(b); 
    139     if b == 0  
    140         s = [s, '           (straight: same direction, same speed)']; 
    141     elseif abs(b) > 0 && abs(b) < 50 
    142         s = [s, blanks(12 - length(s)), '(same direction, different speeds)']; 
    143     elseif abs(b) == 50          
    144         s = [s, blanks(12 - length(s)), '(one motor stopped, one rotating)']; 
    145     elseif abs(b) == 100                  
    146         s = [s, blanks(12 - length(s)), '(opposite directions, same speed)']; 
    147     else 
    148         s = [s, blanks(12 - length(s)), '(opposite directions, different speeds)']; 
    149     end%ff 
    150      
    151 end %% END FUNCTION INFOSTRTURNRATIO 
     136% 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 
    152151 
    153152function s = infoStrPower(b) 
  • trunk/mfiles/NXC_ResetErrorCorrection.m

    r655 r659  
    162162     
    163163    for j = 1 : length(port) 
    164         NXTMOTOR_State(Port(j)+1).LastMsgToNXCSentTime = tic(); 
     164        NXTMOTOR_State(port(j)+1).LastMsgToNXCSentTime = tic(); 
    165165    end%for 
    166166