Merge branch 'devel' into Endstops

This commit is contained in:
Paul Guenette
2019-04-23 21:48:43 +02:00
52 changed files with 1008 additions and 371 deletions
+10 -1
View File
@@ -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;