mirror of
https://github.com/odriverobotics/ODrive.git
synced 2026-08-20 22:14:34 +08:00
Merge branch 'devel' into Endstops
This commit is contained in:
@@ -56,6 +56,15 @@ void Controller::move_to_pos(float goal_point) {
|
||||
axis_->trap_.config_.decel_limit);
|
||||
traj_start_loop_count_ = axis_->loop_counter_;
|
||||
config_.control_mode = CTRL_MODE_TRAJECTORY_CONTROL;
|
||||
goal_point_ = goal_point;
|
||||
}
|
||||
|
||||
void Controller::move_incremental(float displacement, bool from_goal_point = true){
|
||||
if(from_goal_point){
|
||||
move_to_pos(goal_point_ + displacement);
|
||||
} else{
|
||||
move_to_pos(pos_setpoint_ + displacement);
|
||||
}
|
||||
}
|
||||
|
||||
void Controller::start_anticogging_calibration() {
|
||||
@@ -195,8 +204,8 @@ bool Controller::update(float pos_estimate, float vel_estimate, float* current_s
|
||||
Iq += vel_integrator_current_;
|
||||
|
||||
// Current limiting
|
||||
float Ilim = std::min(axis_->motor_.config_.current_lim, axis_->motor_.current_control_.max_allowed_current);
|
||||
bool limited = false;
|
||||
float Ilim = axis_->motor_.effective_current_lim();
|
||||
if (Iq > Ilim) {
|
||||
limited = true;
|
||||
Iq = Ilim;
|
||||
|
||||
Reference in New Issue
Block a user