|
|
|
|
@ -80,7 +80,7 @@ void do_taenzer(){
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Force regualtion */
|
|
|
|
|
if(kraftsensor_valid && taenzer_state.active && taenzer_state.homed && taenzer_state.pos >= 0 && taenzer_state.pos < 500000){
|
|
|
|
|
if(kraftsensor_valid && taenzer_state.active && taenzer_state.homed && taenzer_state.pos >= 0){
|
|
|
|
|
int16_t err = (kraftsensor_value - taenzer_state.force_setpoint);
|
|
|
|
|
|
|
|
|
|
double pid_out = pid(®ler, err);
|
|
|
|
|
@ -90,7 +90,7 @@ void do_taenzer(){
|
|
|
|
|
OCR4A = ICR4/2;
|
|
|
|
|
|
|
|
|
|
if(kraftsensor_valid && notaus_state == POWER_ON){
|
|
|
|
|
if(out < -TAENZER_KRAFT_HYST/2 /* && taenzer_state.pos < 300000UL*/){
|
|
|
|
|
if(out < -TAENZER_KRAFT_HYST/2 && taenzer_state.pos < 970000UL){
|
|
|
|
|
set_Output(MOTOR_TAENZER_DIR, 0); // direction: down
|
|
|
|
|
TCCR4B |= _BV(CS41); //TURN ON
|
|
|
|
|
}
|
|
|
|
|
|