Σύστημα μετάδοσης κίνησης#

Εισαγωγή#

The drivetrain class controls how a robot drives and turns. A drivetrain is made of motors and wheels that work together to move the robot.

A drivetrain does not use an Inertial Sensor or Gyro Sensor for heading-based or rotation-based turns. It can drive forward or reverse and turn left or right, but it cannot turn to a specific heading or rotation. For heading-based and rotation-based turns, use the smartdrive class.

Παράγωγες Κλάσεις#

The drivetrain class serves as a base class for the following derived classes:

  • smartdrive - This class adds Inertial Sensor or Gyro Sensor support to enable heading-based and rotation-based turns.

Κατασκευαστές κλάσεων#

1 - Creates a drivetrain using existing motor_group objects for the left (&l) and right (&r) sides.

drivetrain(
    motor_group      &l,
    motor_group      &r,
    double           wheelTravel = 320,
    double           trackWidth = 320,
    double           wheelBase = 130,
    distanceUnits    unit = mm,
    double           externalGearRatio = 1.0 );

2 - Creates a drivetrain using existing motor objects for the left (&l) and right (&r) sides.

drivetrain(
    motor            &l,
    motor            &r,
    double           wheelTravel = 320,
    double           trackWidth = 320,
    double           wheelBase = 130,
    distanceUnits    unit = mm,
    double           externalGearRatio = 1.0 );

Καταστροφέας κλάσης#

Destroys the drivetrain object and releases associated resources.

virtual ~drivetrain();

Παράμετροι#

Παράμετρος

Τύπος

Περιγραφή

&l / &r

motor_group / motor

The left and right motors or motor groups. Both parameters must use the same type: either two motor_group objects or two motor objects.

wheelTravel

double

The circumference of the drivetrain wheels. The default is 320.

trackWidth

double

The distance between the left and right wheels. The default is 320.

wheelBase

double

The distance between the front and back wheels. The default is 130.

unit

distanceUnits

The unit for wheelTravel, trackWidth, and wheelBase: mm (millimeters, default) or inches.

externalGearRatio

double

The gear ratio used to adjust drive distances if gears are used. The default is 1.0.

Παράδειγμα#

// Create the left and right motor objects
motor leftMotor = motor(PORT1, false);
motor rightMotor = motor(PORT9, true);

// Create the drivetrain object
drivetrain myDrivetrain = drivetrain(
    leftMotor,  // left motor object
    rightMotor, // right motor object
    259.34,     // wheelTravel
    320,        // trackWidth
    40,         // wheelBase
    mm,         // unit
    1.0 );      // externalGearRatio

Συναρτήσεις Μελών#

There are many ways to code the drivetrain. Below is a list of all drivetrain member functions:

Ενέργειες - Μετακίνηση και περιστροφή του ρομπότ.

  • drive - Moves the robot forward or reverse forever.

  • driveFor - Moves the robot forward or reverse for a specific distance.

  • turn - Turns the robot left or right forever.

  • turnFor - Turns the robot left or right for a specific number of degrees.

  • stop - Stops the robot’s movement.

Μεταλλαγμένοι - Προσαρμόστε τις ρυθμίσεις του συστήματος μετάδοσης κίνησης.

  • setDriveVelocity - Tells the robot how fast to drive.

  • setTurnVelocity - Tells the robot how fast to turn.

  • setStopping - Tells how the robot will stop moving: by braking, coasting, or holding.

  • setTimeout - Sets how many seconds the robot will try to finish a movement.

Getters - Ελέγξτε την κατάσταση της κίνησης.

  • isDone - Returns whether the robot is finished moving, as a Boolean value.

  • isMoving - Returns whether the robot is moving, as a Boolean value.

  • velocity - Returns how fast the robot is driving.

  • current - Returns how much electrical current the drivetrain is using.

  • power - Returns how quickly the drivetrain is using energy.

  • torque - Returns how much torque the drivetrain is using.

  • efficiency - Returns how efficiently the drivetrain is using power.

  • temperature - Returns how warm the drivetrain is.

  • voltage - Returns the electrical voltage supplied to the drivetrain.

Before calling any drivetrain member functions, a drivetrain object must be created, as shown below:

/* This constructor is required when using VS Code.
Drivetrain configuration is generated automatically
in VEXcode using the Device Menu. Replace the values
as needed. */

// Create the left and right motor objects
motor leftMotor = motor(PORT1, false);
motor rightMotor = motor(PORT9, true);

// Create the drivetrain object
drivetrain myDrivetrain = drivetrain(
    leftMotor,  // left motor object
    rightMotor, // right motor object
    259.34,     // wheelTravel
    320,        // trackWidth
    40,         // wheelBase
    mm,         // unit
    1.0 );      // externalGearRatio

Ενέργειες#

οδηγώ#

drive moves the robot forward or reverse forever. The robot will continue to move until it is given another action, like turning or stopping. For RPM or DPS, the limit is changed by the gear ratio of the drivetrain.

Available Functions

1 - Οδηγεί χρησιμοποιώντας την τρέχουσα ρυθμισμένη ταχύτητα οδήγησης.

void drive(
    directionType dir );

2 - Οδηγεί με την καθορισμένη ταχύτητα.

void drive(
    directionType dir,
    double        velocity,
    velocityUnits units );

Parameters

Παράμετρος

Τύπος

Περιγραφή

dir

directionType

The direction the robot moves: forward or reverse.

velocity

double

The velocity to drive with from 0% to 100% when using velocityUnits::pct, from 0 to 600 rpm when using rpm, or from 0 to 3600 degrees per second when using dps. If no velocity is provided, the robot drives at the current drive velocity.

units

velocityUnits

The velocity unit: velocityUnits::pct (percent), rpm (rotations per minute), or dps (degrees per second).

Return Values

Αυτή η συνάρτηση δεν επιστρέφει τιμή.

Notes
  • drive is non-waiting; the project will continue executing the next line of code immediately after the call.

  • The drivetrain will continue moving until stop is called or another drivetrain movement function (such as driveFor or turn) is executed.

  • Functions such as isDone and isMoving are not applicable to drive, since it does not use target-based movement (doesn’t have a distance parameter).

Examples
// Drive forward and back
myDrivetrain.drive(forward);
wait(2, seconds);
myDrivetrain.drive(reverse, 25, rpm);
wait(2, seconds);
myDrivetrain.stop();

driveFor#

driveFor moves the robot forward or reverse for a specific distance. The project will wait until the robot is done moving before the next line of code runs by default. For RPM or DPS, the limit is changed by the gear ratio of the drivetrain.

Available Functions

1 - Οδηγεί στην καθορισμένη κατεύθυνση για μια απόσταση χρησιμοποιώντας την τρέχουσα ρυθμισμένη ταχύτητα οδήγησης.

bool driveFor(
    directionType dir,
    double        distance,
    distanceUnits units,
    bool          waitForCompletion = true );

2 - Οδηγεί σε μια κατεύθυνση που εξαρτάται από την απόσταση χρησιμοποιώντας την τρέχουσα ρυθμισμένη ταχύτητα οδήγησης.

bool driveFor(
    double        distance,
    distanceUnits units,
    bool          waitForCompletion = true );

3 - Οδηγεί σε κατεύθυνση που εξαρτάται από την απόσταση με την καθορισμένη ταχύτητα.

bool driveFor(
    double        distance,
    distanceUnits units,
    double        velocity,
    velocityUnits units_v,
    bool          waitForCompletion = true );

4 - Οδηγεί στην καθορισμένη κατεύθυνση για μια απόσταση με την καθορισμένη ταχύτητα.

bool driveFor(
    directionType dir,
    double        distance,
    distanceUnits units,
    double        velocity,
    velocityUnits units_v,
    bool          waitForCompletion = true );

Parameters

Παράμετρος

Τύπος

Περιγραφή

dir

directionType

The direction the robot moves: forward or reverse.

distance

double

Η απόσταση που διανύει το ρομπότ.

units

distanceUnits

The distance unit: mm (millimeters), inches, or cm (centimeters).

velocity

double

The velocity to drive with from 0% to 100% when using velocityUnits::pct, from 0 to 600 rpm when using rpm, or from 0 to 3600 degrees per second when using dps. If no velocity is provided, the robot drives at the current drive velocity.

units_v

velocityUnits

The velocity unit: velocityUnits::pct (percent), rpm (rotations per minute), or dps (degrees per second).

waitForCompletion

bool

true (default) makes the project wait until the robot is done moving before the next line of code runs. false makes the next line of code run right away.

Return Values

Επιστρέφει εάν το ρομπότ έφτασε στην απόσταση-στόχο, ως λογική τιμή.

  • true - The robot reached the target distance.

  • false - The robot did not finish the movement, or the function returned before the movement completed because waitForCompletion was set to false.

Notes
  • Executing another drivetrain movement function (such as drive or turnFor) while driveFor is in progress will interrupt the current movement.

  • Because driveFor is target-based (uses a distance parameter), functions such as isDone and isMoving work with driveFor.

Examples
// Drive 200 mm, then back 200 mm
myDrivetrain.driveFor(forward, 200, mm);
myDrivetrain.driveFor(reverse, 200, mm);

σειρά#

turn turns the robot left or right forever. The robot will continue to turn until it is given another action, like driving or stopping. For RPM or DPS, the limit is changed by the gear ratio of the drivetrain.

Available Functions

1 - Στροφές χρησιμοποιώντας την τρέχουσα ρυθμισμένη ταχύτητα στροφής.

void turn(
    turnType dir );

2 - Στρέφεται με την καθορισμένη ταχύτητα.

void turn(
    turnType     dir,
    double       velocity,
    velocityUnits units );

Parameters

Παράμετρος

Τύπος

Περιγραφή

dir

turnType

The direction the robot turns: left or right.

velocity

double

The velocity to turn with from 0% to 100% when using velocityUnits::pct, from 0 to 600 rpm when using rpm, or from 0 to 3600 degrees per second when using dps. If no velocity is provided, the robot turns at the current turn velocity.

units

velocityUnits

The velocity unit: velocityUnits::pct (percent), rpm (rotations per minute), or dps (degrees per second).

Return Values This function does not return a value. Notes
  • turn is non-waiting; the project will continue executing the next line of code immediately after the call.

  • The drivetrain will continue turning until stop is called or another drivetrain movement function (such as turnFor or drive) is executed.

  • Functions such as isDone and isMoving are not applicable to turn, since it does not use target-based movement (doesn’t have an angle parameter).

Examples
// Turn right, then left, then stop
myDrivetrain.turn(right);
wait(2, seconds);
myDrivetrain.turn(left);
wait(2, seconds);
myDrivetrain.stop();

στροφήΓια#

turnFor turns the robot left or right for a specific number of degrees. The turn is relative to the current position of the robot. The project will wait until the robot is done turning before the next line of code runs by default. For RPM or DPS, the limit is changed by the gear ratio of the drivetrain.

Available Functions

1 - Στροφές για την καθορισμένη γωνία χρησιμοποιώντας την τρέχουσα ρυθμισμένη ταχύτητα στροφής.

bool turnFor(
    double        angle,
    rotationUnits units,
    bool          waitForCompletion = true );

2 - Στρέφεται στην καθορισμένη κατεύθυνση για μια γωνία χρησιμοποιώντας την τρέχουσα ρυθμισμένη ταχύτητα στροφής.

bool turnFor(
    turnType      dir,
    double        angle,
    rotationUnits units,
    bool          waitForCompletion = true );

3 - Στρέφεται για την καθορισμένη γωνία με την καθορισμένη ταχύτητα.

bool turnFor(
    double        angle,
    rotationUnits units,
    double        velocity,
    velocityUnits units_v,
    bool          waitForCompletion = true );

4 - Στρέφεται προς την καθορισμένη κατεύθυνση για μια γωνία με την καθορισμένη ταχύτητα.

bool turnFor(
    turnType      dir,
    double        angle,
    rotationUnits units,
    double        velocity,
    velocityUnits units_v,
    bool          waitForCompletion = true );

Parameters

Παράμετρος

Τύπος

Περιγραφή

dir

turnType

The direction the robot turns: left or right.

angle

double

Η γωνία περιστροφής του ρομπότ.

units

rotationUnits

The turn unit: deg (degrees), rev (revolutions), or raw (raw units). One revolution is equal to 360 degrees.

velocity

double

The velocity to turn with from 0% to 100% when using velocityUnits::pct, from 0 to 600 rpm when using rpm, or from 0 to 3600 degrees per second when using dps. If no velocity is provided, the robot turns at the current turn velocity.

units_v

velocityUnits

The velocity unit: velocityUnits::pct (percent), rpm (rotations per minute), or dps (degrees per second).

waitForCompletion

bool

true (default) makes the project wait until the robot is done turning before the next line of code runs. false makes the next line of code run right away.

Return Values

Επιστρέφει εάν το ρομπότ έφτασε στη γωνία-στόχο, ως λογική τιμή.

  • true - The robot reached the target angle.

  • false - The robot did not finish the turn, or the function returned before the turn completed because waitForCompletion was set to false.

Notes
  • Executing another drivetrain movement function (such as turn or drive) while turnFor is in progress will interrupt the current movement.

  • Because turnFor is target-based (uses an angle parameter), functions such as isDone and isMoving work with turnFor.

Examples
// Turn right then left
myDrivetrain.turnFor(right, 90, degrees);
wait(1, seconds);
myDrivetrain.turnFor(left, 90, degrees);

στάση#

stop stops the robot’s movement. If a stopping mode is provided, it controls how the robot stops for this function call.

Available Functions

1 - Σταματάει το σύστημα μετάδοσης κίνησης χρησιμοποιώντας την τρέχουσα διαμορφωμένη λειτουργία διακοπής.

void stop();

2 - Σταματά το σύστημα μετάδοσης κίνησης χρησιμοποιώντας την καθορισμένη λειτουργία πέδησης.

void stop(
    brakeType mode );

Parameters

Παράμετρος

Τύπος

Περιγραφή

mode

brakeType

How the robot will stop:

  • brake - Stops immediately.
  • coast - Slows to a stop.
  • hold - Stops immediately and holds the wheels’ position.

Return Values

Αυτή η συνάρτηση δεν επιστρέφει τιμή.

Examples
// Drive forward, then coast to a stop
myDrivetrain.setDriveVelocity(100, percent);
myDrivetrain.drive(forward);
wait(2, seconds);
myDrivetrain.stop(coast);

Μεταλλάκτες#

setDriveVelocity#

setDriveVelocity tells the robot how fast to drive. A higher percentage makes the robot drive faster and a lower percentage makes the robot drive slower. For RPM or DPS, the limit is changed by the gear ratio of the drivetrain.

Κάθε έργο ξεκινά με το ρομπότ να κινείται με ταχύτητα 50% από προεπιλογή.

Σημείωση: Μια υψηλότερη ταχύτητα κάνει το ρομπότ να κινείται πιο γρήγορα, αλλά μπορεί να είναι λιγότερο ακριβές. Μια χαμηλότερη ταχύτητα κάνει το ρομπότ να κινείται πιο αργά, αλλά μπορεί να είναι πιο ακριβές.

Available Functions
void  setDriveVelocity(
  double velocity,
  velocityUnits units );

Parameters

Παράμετρος

Τύπος

Περιγραφή

velocity

double

The velocity to drive with from 0% to 100% when using velocityUnits::pct, from 0 to 600 rpm when using rpm, or from 0 to 3600 degrees per second when using dps.

units

velocityUnits

The velocity unit: velocityUnits::pct (percent), rpm (rotations per minute), or dps (degrees per second).

Return Values

Αυτή η συνάρτηση δεν επιστρέφει τιμή.

Notes
  • The drive velocity applies to all subsequent drivetrain movement functions (such as drive and driveFor) unless a specific velocity is provided in the function call.

Examples
// Drive forward, then coast to a stop
myDrivetrain.setDriveVelocity(100, percent);
myDrivetrain.drive(forward);
wait(2, seconds);
myDrivetrain.stop(coast);

setTurnVelocity#

setTurnVelocity tells the robot how fast to turn. A higher percentage makes the robot turn faster and a lower percentage makes the robot turn slower. For RPM or DPS, the limit is changed by the gear ratio of the drivetrain.

Κάθε έργο ξεκινά με το ρομπότ να περιστρέφεται με ταχύτητα 50% από προεπιλογή.

Σημείωση: Μια υψηλότερη ταχύτητα κάνει το ρομπότ να περιστρέφεται πιο γρήγορα, αλλά μπορεί να είναι λιγότερο ακριβής. Μια χαμηλότερη ταχύτητα κάνει το ρομπότ να περιστρέφεται πιο αργά, αλλά μπορεί να είναι πιο ακριβής.

Available Functions
void  setTurnVelocity(
  double velocity,
  velocityUnits units );

Parameters

Παράμετρος

Τύπος

Περιγραφή

velocity

double

The velocity to turn with from 0% to 100% when using velocityUnits::pct, from 0 to 600 rpm when using rpm, or from 0 to 3600 degrees per second when using dps.

units

velocityUnits

The velocity unit: percent or pct (percent), rpm (rotations per minute), or dps (degrees per second).

Return Values

Αυτή η συνάρτηση δεν επιστρέφει τιμή.

Notes
  • The turn velocity applies to all subsequent drivetrain turning functions (such as turn and turnFor) unless a specific velocity is provided in the function call.

Examples
// Try default, slow, then fast
myDrivetrain.turnFor(right, 360, degrees);
wait(1, seconds);
myDrivetrain.setTurnVelocity(20, percent);
myDrivetrain.turnFor(right, 360, degrees);
wait(1, seconds);
myDrivetrain.setTurnVelocity(100, percent);
myDrivetrain.turnFor(right, 360, degrees);

setStopping#

setStopping sets how the robot will stop moving: by braking, coasting, or holding.

Available Functions
void setStopping(
  brakeType mode );

Parameters

Παράμετρος

Τύπος

Περιγραφή

mode

brakeType

How the robot will stop:

  • brake - Stops immediately.
  • coast - Slows to a stop.
  • hold - Stops immediately and holds the wheels’ position.

Return Values

Αυτή η συνάρτηση δεν επιστρέφει τιμή.

Notes
  • The stopping mode applies to all subsequent stop calls unless a specific stopping mode is provided in the function call.

ορισμός χρονικού ορίου#

setTimeout sets how many seconds the robot will try to finish a movement. If the robot cannot finish in that time, it will stop trying and move on to the next line of code. This keeps the robot from getting stuck on a movement.

Available Functions
void  setTimeout(
  int32_t time,
  timeUnits units );

Parameters

Παράμετρος

Τύπος

Περιγραφή

time

int32_t

Ο χρόνος που μπορεί να προσπαθήσει το ρομπότ για να ολοκληρώσει μια κίνηση. Αυτός θα πρέπει να είναι ένας θετικός ακέραιος αριθμός.

units

timeUnits

The unit of time: sec (seconds) or msec (milliseconds).

Return Values

Αυτή η συνάρτηση δεν επιστρέφει τιμή.

Notes
  • The timeout only applies to target-based drivetrain movement functions (such as driveFor and turnFor).

Examples
// Start turning if driving takes too long
myDrivetrain.setTimeout(1, seconds);
myDrivetrain.driveFor(forward, 25, inches);
myDrivetrain.turnFor(right, 90, degrees);

Αποκτητές#

είναιΟλοκληρωμένο#

isDone returns whether the robot is finished moving, as a Boolean value. This can be used to control the timing of other behaviors based on the robot’s movement.

Available Functions
bool isDone( void );

Parameters

Αυτή η συνάρτηση δεν δέχεται καμία παράμετρο.

Return Values
  • true - The robot is finished moving.

  • false - The robot is still moving.

Notes
  • isDone is compatible with target-based drivetrain movements (functions that move to a target, such as driveFor and turnFor).

  • isDone is not compatible with functions such as drive and turn, since they do not use target-based movement.

Μετακινείται#

isMoving returns whether the robot is moving, as a Boolean value. This can be used to control the timing of other behaviors based on the robot’s movement.

Available Functions
virtual bool isMoving( void );

Parameters

Αυτή η συνάρτηση δεν δέχεται καμία παράμετρο.

Return Values
  • true - The robot is moving.

  • false - The robot is not moving.

Notes
  • isMoving is compatible with target-based drivetrain movements (functions that move to a target, such as driveFor and turnFor).

  • isMoving is not compatible with functions such as drive and turn, since they do not use target-based movement.

ταχύτητα#

velocity returns how fast the robot is driving.

Μια θετική τιμή σημαίνει ότι το ρομπότ κινείται προς τα εμπρός. Μια αρνητική τιμή σημαίνει ότι το ρομπότ κινείται προς τα πίσω.

Available Functions
double velocity(
  velocityUnits units );

Parameters

Παράμετρος

Τύπος

Περιγραφή

units

velocityUnits

The velocity unit: percent or pct (percent), rpm (rotations per minute), or dps (degrees per second).

Return Values

Returns the drivetrain velocity as a double in the selected unit.

Examples
// Show velocity before and during motion
Brain.Screen.print("Resting: %f", myDrivetrain.velocity(percent));
myDrivetrain.drive(forward, 100, velocityUnits::pct);
wait(1, seconds);
Brain.Screen.newLine();
Brain.Screen.print("Moving: %f", myDrivetrain.velocity(percent));
myDrivetrain.stop();

ρεύμα#

current returns how much electrical current the drivetrain is using. Current is the amount of electricity flowing through the drivetrain. It can be returned in amps (amperes) or as a percentage, depending on the unit.

Μια υψηλότερη τιμή ρεύματος σημαίνει ότι το σύστημα μετάδοσης κίνησης χρησιμοποιεί περισσότερο ηλεκτρικό ρεύμα. Αυτό μπορεί να συμβεί όταν το ρομπότ πιέζει ένα αντικείμενο ή προσπαθεί να κινηθεί όταν αυτό έχει κολλήσει.

Αυτό μπορεί να χρησιμοποιηθεί για να ελέγξετε εάν το σύστημα μετάδοσης κίνησης παρουσιάζει δυσκολίες κατά τη διάρκεια μιας κίνησης. Εάν το ρεύμα παραμείνει υψηλό, το σύστημα μετάδοσης κίνησης μπορεί να θερμανθεί ή να χρησιμοποιήσει την ισχύ λιγότερο αποτελεσματικά.

Available Functions

1 - Επιστρέφει το ηλεκτρικό ρεύμα του συστήματος μετάδοσης κίνησης σε αμπέρ.

double current(
    currentUnits units = currentUnits::amp );

2 - Επιστρέφει το ηλεκτρικό ρεύμα του συστήματος μετάδοσης κίνησης ως ποσοστό του μέγιστου.

double current(
    percentUnits units );

Parameters

Παράμετρος

Τύπος

Περιγραφή

units

currentUnits

The unit to return current in: amp (amps, default).

units

percentUnits

The unit to return current in: percent or pct.

Return Values

Returns the drivetrain current as a double in the selected unit.

εξουσία#

power returns how much power the drivetrain is using, measured in watts. Power shows how quickly the drivetrain is using energy.

Μια υψηλότερη τιμή ισχύος σημαίνει ότι το σύστημα μετάδοσης κίνησης χρησιμοποιεί ενέργεια πιο γρήγορα. Αυτό μπορεί να συμβεί όταν το ρομπότ πιέζει ένα αντικείμενο ή προσπαθεί να κινηθεί όταν αυτό έχει κολλήσει.

Αυτό μπορεί να χρησιμοποιηθεί για να συγκρίνετε κινήσεις ή να ελέγξετε αν το σύστημα μετάδοσης κίνησης παρουσιάζει δυσκολίες. Εάν η ισχύς παραμείνει υψηλή, το σύστημα μετάδοσης κίνησης μπορεί να θερμανθεί ή να χρησιμοποιήσει την ενέργεια λιγότερο αποτελεσματικά.

Available Functions
double power(
  powerUnits units = powerUnits::watt );

Parameters

Παράμετρος

Τύπος

Περιγραφή

units

powerUnits

The power unit: watt (watts, default).

Return Values

Returns drivetrain power as a double in watts.

ροπή#

Η ροπή δείχνει πόσο δυνατά μπορεί να σπρώξει ή να τραβήξει το σύστημα μετάδοσης κίνησης ενώ οι τροχοί σπινάρουν.

torque returns how much torque the drivetrain is using, measured in Newton-meters (Nm) or inch-pounds (InLb).

Μια υψηλότερη τιμή ροπής σημαίνει ότι το σύστημα μετάδοσης κίνησης πιέζει ή τραβάει πιο δυνατά. Αυτό μπορεί να συμβεί όταν το ρομπότ πιέζει ένα αντικείμενο ή προσπαθεί να κινηθεί όταν αυτό έχει κολλήσει.

Αυτό μπορεί να χρησιμοποιηθεί για να ελεγχθεί εάν το σύστημα μετάδοσης κίνησης δυσκολεύεται ή για να συγκριθεί η ώθηση που χρειάζονται οι διαφορετικές κινήσεις.

Available Functions
double torque(
  torqueUnits units = torqueUnits::nm );

Parameters

Παράμετρος

Τύπος

Περιγραφή

units

torqueUnits

The unit to return torque in: Nm (newton meters, default) or InLb (inch pounds).

Return Values

Returns drivetrain torque as a double in the selected unit.

αποδοτικότητα#

efficiency returns how efficiently the drivetrain is using power, as a percentage from 0% to 100%.

Η απόδοση δείχνει πόση από την ισχύ του συστήματος μετάδοσης κίνησης χρησιμοποιείται για κίνηση. Μια υψηλότερη τιμή απόδοσης σημαίνει ότι περισσότερη από την ισχύ του συστήματος μετάδοσης κίνησης χρησιμοποιείται για κίνηση. Μια χαμηλότερη τιμή απόδοσης μπορεί να συμβεί όταν το σύστημα μετάδοσης κίνησης λειτουργεί σκληρά αλλά δεν κινείται πολύ, όπως όταν το ρομπότ έχει κολλήσει ή πιέζει ένα αντικείμενο.

Αυτό μπορεί να χρησιμοποιηθεί για τη σύγκριση κινήσεων ή για τον έλεγχο εάν το σύστημα μετάδοσης κίνησης σπαταλά ενέργεια αντί να τη χρησιμοποιεί για κίνηση.

Available Functions
double efficiency(
  percentUnits units = percentUnits::pct );

Parameters

Παράμετρος

Τύπος

Περιγραφή

units

percentUnits

The unit to return efficiency in: percent or pct (default).

Return Values

Returns drivetrain efficiency as a double in the selected unit.

θερμοκρασία#

temperature returns the average temperature of the drivetrain as a percentage from 0% to 100%.

Η θερμοκρασία δείχνει πόσο ζεστοί είναι οι κινητήρες του συστήματος μετάδοσης κίνησης. Μια υψηλότερη θερμοκρασία σημαίνει ότι οι κινητήρες θερμαίνονται ενώ λειτουργούν. Οι κινητήρες θα πρέπει να παραμένουν κάτω από τους 55°C για να συνεχίσουν να λειτουργούν σε πλήρη απόδοση.

Εάν οι κινητήρες υπερθερμανθούν, θα μειώσουν το μέγιστο ρεύμα τους για να προστατευτούν. Στους 70°C, οι κινητήρες θα σταματήσουν να λειτουργούν μέχρι να κρυώσουν.

Αυτό μπορεί να χρησιμοποιηθεί για να ελέγξετε εάν το σύστημα μετάδοσης κίνησης υπερθερμαίνεται κατά τη διάρκεια επαναλαμβανόμενων κινήσεων, μεγάλων διαδρομών ή όταν πιέζει ένα αντικείμενο.

Available Functions
double temperature(
  percentUnits units );

Parameters

Παράμετρος

Τύπος

Περιγραφή

units

percentUnits

The unit to return temperature in: percent or pct.

Return Values

Returns the average drivetrain temperature as a double in the selected unit.

Notes
  • A returned value of 50% indicates that the average motor temperature is approximately 45°C (113°F).

  • The typical operating temperature range for the drivetrain is approximately 20°C (68°F) to 70°C (158°F).

δυναμικό#

voltage returns the electrical voltage supplied to the drivetrain.

Η τάση είναι η ηλεκτρική πίεση που παρέχεται στους κινητήρες του συστήματος μετάδοσης κίνησης. Αυτή μπορεί να χρησιμοποιηθεί με τιμές ρεύματος και ισχύος για να κατανοηθεί ο τρόπος με τον οποίο το σύστημα μετάδοσης κίνησης χρησιμοποιεί την ηλεκτρική ενέργεια.

Available Functions
double  voltage(
  voltageUnits units = voltageUnits::volt );

Parameters

Παράμετρος

Τύπος

Περιγραφή

units

voltageUnits

The unit to return voltage in: volt (volts, default) or voltageUnits::mV (millivolts).

Return Values

Returns drivetrain voltage as a double in the selected unit.