Change RPM to M/S
This commit is contained in:
parent
a484bc2137
commit
6a1ac72912
7 changed files with 111 additions and 15 deletions
|
@ -22,7 +22,11 @@ public:
|
|||
|
||||
void set_power(uint8_t port, double power);
|
||||
|
||||
void set_speed(uint8_t port, double speed_rpm);
|
||||
void set_speed(uint8_t port, double speed_ms);
|
||||
|
||||
void generate_step_response_data();
|
||||
|
||||
void generate_tuned_step_response_data();
|
||||
|
||||
private:
|
||||
enum ControlMode : uint8_t {
|
||||
|
|
|
@ -19,7 +19,7 @@ public:
|
|||
|
||||
std::array<int32_t, ROBOT_MOTOR_COUNT> get_positions();
|
||||
|
||||
std::array<double, ROBOT_MOTOR_COUNT> get_velocities_rpm();
|
||||
std::array<double, ROBOT_MOTOR_COUNT> get_velocities_ms();
|
||||
|
||||
private:
|
||||
Encoders() = default;
|
||||
|
@ -28,7 +28,7 @@ private:
|
|||
Cache velocity_cache{ROBOT_ENCODER_RATE_HZ};
|
||||
|
||||
std::array<int32_t, ROBOT_MOTOR_COUNT> cached_positions = {0};
|
||||
std::array<double, ROBOT_MOTOR_COUNT> cached_velocities_rpm = {0};
|
||||
std::array<double, ROBOT_MOTOR_COUNT> cached_velocities_ms = {0};
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -7,10 +7,10 @@
|
|||
#define ROBOT_IR_RATE_HZ 250
|
||||
|
||||
#define ROBOT_MOTOR_COUNT 4
|
||||
#define ROBOT_MOTOR_SPEED_CONTROL_KP 0.5
|
||||
#define ROBOT_MOTOR_SPEED_CONTROL_KI 5.0
|
||||
#define ROBOT_MOTOR_SPEED_CONTROL_KD 0.025
|
||||
#define ROBOT_MOTOR_SPEED_CONTROL_RAMP 100.0
|
||||
#define ROBOT_MOTOR_SPEED_CONTROL_KP 222.0
|
||||
#define ROBOT_MOTOR_SPEED_CONTROL_KI 2110.0
|
||||
#define ROBOT_MOTOR_SPEED_CONTROL_KD 2.22
|
||||
#define ROBOT_MOTOR_SPEED_CONTROL_RAMP 0.2
|
||||
#define ROBOT_MOTOR_SPEED_CONTROL_RATE_HZ 250
|
||||
|
||||
#define ROBOT_ODOMETRY_CONTROLLER_RATE_HZ 250
|
||||
|
@ -22,6 +22,7 @@
|
|||
#define ROBOT_ENCODER_RATE_HZ 250
|
||||
|
||||
#define ROBOT_WHEEL_CIRCUMFERENCE_MM (71.0 * M_PI)
|
||||
#define ROBOT_WHEEL_CIRCUMFERENCE_M (ROBOT_WHEEL_CIRCUMFERENCE_MM / 1000.0)
|
||||
#define ROBOT_TICKS_PER_TURN (27.7 * 100.0)
|
||||
#define ROBOT_ARBOR_LENGTH_MM 139.0
|
||||
#define ROBOT_ARBOR_LENGTH_M (ROBOT_ARBOR_LENGTH_MM / 1000.0)
|
||||
|
|
Reference in a new issue