move inertia to controller

This commit is contained in:
Oskar Weigl
2018-12-02 18:24:38 -08:00
parent 3113aedf08
commit 1df442fd9d
5 changed files with 10 additions and 7 deletions
+3
View File
@@ -1,6 +1,9 @@
# Unreleased Features
Please add a note of your changes below this heading if you make a Pull Request.
### Changed
* Moved `traptraj.A_per_css` to `controller.inertia`
# Releases
## [0.4.7] - 2018-11-28
### Added
+1 -1
View File
@@ -113,7 +113,7 @@ bool Controller::update(float pos_estimate, float vel_estimate, float* current_s
TrapezoidalTrajectory::Step_t traj_step = axis_->trap_.eval(t);
pos_setpoint_ = traj_step.Y;
vel_setpoint_ = traj_step.Yd;
current_setpoint_ = traj_step.Ydd * axis_->trap_.config_.A_per_css;
current_setpoint_ = traj_step.Ydd * config_.inertia;
}
anticogging_pos = pos_setpoint_; // FF the position setpoint instead of the pos_estimate
}
+3 -1
View File
@@ -32,6 +32,7 @@ public:
float vel_limit_tolerance = 1.2f; // ratio to vel_lim. 0.0f to disable
float vel_ramp_rate = 10000.0f; // [(counts/s) / s]
bool setpoints_in_cpr = false;
float inertia = 0.0f; // [A/(count/s^2)]
};
Controller(Config_t& config);
@@ -107,7 +108,8 @@ public:
make_protocol_property("vel_limit", &config_.vel_limit),
make_protocol_property("vel_limit_tolerance", &config_.vel_limit_tolerance),
make_protocol_property("vel_ramp_rate", &config_.vel_ramp_rate),
make_protocol_property("setpoints_in_cpr", &config_.setpoints_in_cpr)
make_protocol_property("setpoints_in_cpr", &config_.setpoints_in_cpr),
make_protocol_property("inertia", &config_.inertia)
),
make_protocol_function("set_pos_setpoint", *this, &Controller::set_pos_setpoint,
"pos_setpoint", "vel_feed_forward", "current_feed_forward"),
+1 -3
View File
@@ -7,7 +7,6 @@ public:
float vel_limit = 20000.0f; // [count/s]
float accel_limit = 5000.0f; // [count/s^2]
float decel_limit = 5000.0f; // [count/s^2]
float A_per_css = 0.0f; // [A/(count/s^2)]
};
struct Step_t {
float Y;
@@ -25,8 +24,7 @@ public:
make_protocol_object("config",
make_protocol_property("vel_limit", &config_.vel_limit),
make_protocol_property("accel_limit", &config_.accel_limit),
make_protocol_property("decel_limit", &config_.decel_limit),
make_protocol_property("A_per_css", &config_.A_per_css)
make_protocol_property("decel_limit", &config_.decel_limit)
)
);
}
+2 -2
View File
@@ -265,13 +265,13 @@ In the above image blue is position and orange is velocity.
<odrv>.<axis>.trap_traj.config.vel_limit = <Float>
<odrv>.<axis>.trap_traj.config.accel_limit = <Float>
<odrv>.<axis>.trap_traj.config.decel_limit = <Float>
<odrv>.<axis>.trap_traj.config.A_per_css = <Float>
<odrv>.<axis>.controller.config.inertia = <Float>
```
`vel_limit` is the maximum planned trajectory speed. This sets your coasting speed.<br>
`accel_limit` is the maximum acceleration in counts / sec^2<br>
`decel_limit` is the maximum deceleration in counts / sec^2<br>
`A_per_css` is a value which correlates acceleration (in counts / sec^2) and motor current. It is 0 by default. It is optional, but can improve response of your system if correctly tuned. Keep in mind this will need to change with the load / mass of your system.
`controller.config.inertia` is a value which correlates acceleration (in counts / sec^2) and motor current. It is 0 by default. It is optional, but can improve response of your system if correctly tuned. Keep in mind this will need to change with the load / mass of your system.
All values should be strictly positive (>= 0).