A DC motor with an encoder, run in speed control. The application sets the target speed of the output shaft and reads back its angle and speed. The backend decides what the motor is:
More...
#include <dc_motor.h>
A DC motor with an encoder, run in speed control. The application sets the target speed of the output shaft and reads back its angle and speed. The backend decides what the motor is:
Call step() once per simulation step.
◆ OutputType
◆ DCMotor()
◆ angle()
| real_t bitsim::actuators::DCMotor::angle |
( |
| ) |
const |
|
inline |
- Returns
- The angle of the output shaft [rad]
◆ backend_ptr()
◆ backend_type_str()
| const std::string & bitsim::actuators::DCMotor::backend_type_str |
( |
| ) |
const |
|
inlinenoexcept |
◆ create_simulated()
A motor with a SIM_DCMotorBackend.
◆ encoder_angle()
| real_t bitsim::actuators::DCMotor::encoder_angle |
( |
| ) |
const |
|
inline |
◆ is_ready()
| bool bitsim::actuators::DCMotor::is_ready |
( |
| ) |
const |
|
inline |
◆ max_speed()
| real_t bitsim::actuators::DCMotor::max_speed |
( |
| ) |
const |
|
inlinenoexcept |
◆ name()
| const std::string & bitsim::actuators::DCMotor::name |
( |
| ) |
const |
|
inlinenoexcept |
◆ output_type()
| OutputType bitsim::actuators::DCMotor::output_type |
( |
| ) |
const |
|
inlinenoexcept |
- Returns
- How the motor couples to a physics engine
◆ set_max_speed()
| void bitsim::actuators::DCMotor::set_max_speed |
( |
real_t | max_speed | ) |
|
Limit the target speed to [-max_speed, max_speed].
◆ set_speed()
| void bitsim::actuators::DCMotor::set_speed |
( |
real_t | speed | ) |
|
Set the target speed of the output shaft [rad/s]. It is clamped to the maximum speed.
◆ speed()
| real_t bitsim::actuators::DCMotor::speed |
( |
| ) |
const |
|
inline |
- Returns
- The speed of the output shaft [rad/s]
◆ step() [1/2]
| void bitsim::actuators::DCMotor::step |
( |
real_t | dt | ) |
|
|
inline |
Advance the motor by dt. A model moves its own shaft.
◆ step() [2/2]
Advance the motor by dt, with the shaft moved by a physics engine.
◆ target_speed()
| real_t bitsim::actuators::DCMotor::target_speed |
( |
| ) |
const |
|
inlinenoexcept |
- Returns
- The target speed of the output shaft [rad/s]
◆ torque()
| real_t bitsim::actuators::DCMotor::torque |
( |
| ) |
const |
|
inline |
- Returns
- The torque the motor puts on the output shaft [N m], if the backend knows it
The documentation for this class was generated from the following files: