Skip to content
Snippets Groups Projects
Select Git revision
  • Sprint/2021-19
  • master default protected
  • dev protected
  • Issue/3003-stsInstitute
  • gitkeep
  • Issue/2449-GuidPidSlugToProjectSettings
  • Issue/2309-docs
  • Fix/xxxx-updateDependencies
  • Issue/2364-testingKpiParser
  • Issue/2287-guestRole
  • Test/xxxx-pipelineTriggers
  • Issue/2102-gitLabResTypeRCV
  • Issue/2278-gitlabToS
  • Issue/2101-gitLabResTypeUi
  • Issue/1788-extractionCronjob
  • Issue/2183-kpiGeneratorResource
  • Issue/2222-resourceDateCreated
  • Issue/2221-projectDateCreated
  • Issue/1321-pidEnquiryOverhaul
  • Issue/1999-gitlabResourcesLib
  • Issue/1951-quotaImplementation
  • v2.22.0
  • v2.20.0
  • v2.19.1
  • v2.19.0
  • v2.18.0
  • v2.17.0
  • v2.16.2
  • v2.16.1
  • v2.16.0
  • v2.15.0
  • v2.14.0
  • v2.13.0
  • v2.12.1
  • v2.12.0
  • v2.11.1
  • v2.11.0
  • v2.10.1
  • v2.10.0
  • v2.9.1
  • v2.9.0
41 results

Program.cs

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    Motor.m 52.27 KiB
    classdef Motor < MaskedHandle & dynamicprops      
        % High-level class to work with motors.
        %
        % This class is supposed to ease the use of the brick's motors. It is possible to set all
        % kinds of parameters, request the current status of the motor ports and of course send 
        % commands to the brick to be executed on the respective port. 
        %
        % Notes:
        %     * You don't need to create instances of this class. The EV3-class automatically creates
        %       instances for each motor port, and you can work with them via the EV3-object. 
        %     * The Motor-class represents motor ports, not individual motors!
        %     * If you start a motor with power=0, the internal state will still be set to
        %       'isRunning'
        %     * When an input argument of a method is marked as optional, the argument needs to be 
        %       'announced' by a preceding 2nd argument, which is a string containing the name of the argument. 
        %       For example, Motor.setProperties may be given a power-parameter. The syntax would be as
        %       follows: *brickObject.motorA.setProperties('power', 50);*
        %
        % Attributes:
        %    power (numeric in [-100, 100]): Power level of motor in percent. *[WRITABLE]*
        %    speedRegulation (bool): Speed regulation turned on or off. When turned on, motor will 
        %        try to 'hold' its speed at given power level, whatever the load. In this mode, the
        %        highest possible speed depends on the load and mostly goes up to around 70-80 (at 
        %        this point, the Brick internally inputs 100% power). When turned off, motor will 
        %        constantly input the same power into the motor. The resulting speed will be 
        %        somewhat lower, depending on the load. *[WRITABLE]*
        %    smoothStart (numeric s. t. smoothStart+smoothStop < limitValue): Degrees/Time 
        %        indicating how far/long the motor should smoothly start. Depending on limitMode, 
        %        the input is interpreted either in degrees or milliseconds. The first 
        %        {smoothStart}-milliseconds/degrees of limitValue the motor will slowly accelerate 
        %        until reaching its defined speed. See also :attr:`limitValue`, :attr:`limitMode`. *[WRITABLE]*
        %    smoothStop (numeric s. t. smoothStart+smoothStop < limitValue): Degrees/Time 
        %        indicating how far/long the motor should smoothly stop. Depending on limitMode, the 
        %        input is interpreted either in degrees or milliseconds. The last 
        %        [smoothStop]-milliseconds/degrees of limitValue the motor will slowly slow down 
        %        until it has stopped. See also :attr:`limitValue`, :attr:`limitMode`. *[WRITABLE]*
        %    limitValue (numeric>=0): Degrees/Time indicating how far/long the motor should run.
        %        Depending on limitMode, the input is interpreted either in degrees or 
        %        milliseconds. See also :attr:`limitMode`. *[WRITABLE]*
        %    limitMode ('Tacho'|'Time'): Mode for motor limit. See also :attr:`limitValue`. *[WRITABLE]*
        %    brakeMode ('Brake'|'Coast'): Action done when stopping. If 'Coast', the motor will (at 
        %        tacholimit, if ~=0) coast to a stop. If 'Brake', the motor will stop immediately 
        %        (at tacholimit, if ~=0) and hold the brake. *[WRITABLE]*
        %    debug (bool): Debug turned on or off. In debug mode, everytime a command is passed to 
        %        the sublayer ('communication layer'), there is feedback in the console about what 
        %        command has been called. *[WRITABLE]*
        %    isRunning (bool): True if motor is running. *[READ-ONLY]*
        %    tachoCount (numeric): Current tacho count in degrees. *[READ-ONLY]*
        %    currentSpeed (numeric): Current speed of motor. If speedRegulation=on this should equal power, 
        %        otherwise it will probably be lower than that. See also :attr:`speedRegulation`. *[READ-ONLY]*
        %    type (DeviceType): Type of connected device if any. *[READ-ONLY]*
        
        
        properties  % Standard properties to be set by user
            % power (numeric in [-100, 100]): Power level of motor in percent. [WRITABLE]
            power;
            
            % speedRegulation (bool): Speed regulation turned on or off. [WRITABLE]
            %     When turned on, motor will try to 'hold' its speed at given power level, whatever
            %     the load. In this mode, the highest possible speed depends on the load and mostly 
            %     goes up to around 70-80 (at this point, the Brick internally inputs 100% power). 
            %     When turned off, motor will constantly input the same power into the motor. The 
            %     resulting speed will be somewhat lower, depending on the load. 
            speedRegulation;
            
            % smoothStart (numeric s. t. smoothStart+smoothStop < limitValue): Degrees/Time indicating how far/long the motor should smoothly start. [WRITABLE] 
            %     Depending on limitMode, the input is interpreted either in degrees or 
            %     milliseconds. The first {smoothStart}-milliseconds/degrees of limitValue the 
            %     motor will slowly accelerate until reaching its defined speed. 
            % See also MOTOR.LIMITVALUE, MOTOR.LIMITMODE