Nasal hitch.nas: Update by D-NXKT and Bea Wolf
This commit is contained in:
parent
9e9c0252f7
commit
476a7bccb5
1 changed files with 26 additions and 13 deletions
|
@ -2,7 +2,7 @@
|
||||||
# TOWING NASAL CODE
|
# TOWING NASAL CODE
|
||||||
#
|
#
|
||||||
# original version by D-NXKT up to version 30.12.2014
|
# original version by D-NXKT up to version 30.12.2014
|
||||||
# updates by Benedikt Wolf and D-NXKT, version 01/2023
|
# updates by Bea Wolf and D-NXKT, version 12/2023
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# Purpose of this routine:
|
# Purpose of this routine:
|
||||||
|
@ -1315,8 +1315,20 @@ var winch = func (open){
|
||||||
if ( winch_hash.clutched.getBoolValue() ) {
|
if ( winch_hash.clutched.getBoolValue() ) {
|
||||||
|
|
||||||
if( winch_hash.type == 0 ){
|
if( winch_hash.type == 0 ){
|
||||||
# Concept: force is given
|
# Concept: force is conrolled
|
||||||
forcetow_N = force_setting;
|
|
||||||
|
towlength_new_m = towlength_m - spoolspeed * delta_t;
|
||||||
|
delta_towlength_m = distance - towlength_new_m;
|
||||||
|
var delta_spoolspeed = spool_acceleration * delta_t;
|
||||||
|
spoolspeed = spoolspeed + delta_spoolspeed ;
|
||||||
|
if ( spoolspeed > spool_max ) spoolspeed = spool_max;
|
||||||
|
|
||||||
|
if ( delta_towlength_m < 0. ) {
|
||||||
|
forcetow_N = 0.;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
forcetow_N = elastic_constant * delta_towlength_m / towlength_new_m;
|
||||||
|
}
|
||||||
|
|
||||||
} else if ( winch_hash.type == 1 ){
|
} else if ( winch_hash.type == 1 ){
|
||||||
# Concept: regulate force to reach target speed
|
# Concept: regulate force to reach target speed
|
||||||
|
@ -1328,12 +1340,11 @@ var winch = func (open){
|
||||||
forcetow_N -= acceleration_N_s * delta_t;
|
forcetow_N -= acceleration_N_s * delta_t;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
# New towlength is distance from hook to winch; previous towlength is stored in winch_hash.towlength_m
|
# New towlength is distance from hook to winch; previous towlength is stored in winch_hash.towlength_m
|
||||||
towlength_new_m = distance;
|
towlength_new_m = distance;
|
||||||
delta_towlength_m = -1 * ( distance - towlength_m );
|
delta_towlength_m = -1 * ( distance - towlength_m );
|
||||||
spoolspeed = delta_towlength_m / delta_t;
|
spoolspeed = delta_towlength_m / delta_t;
|
||||||
|
}
|
||||||
|
|
||||||
} else { # un-clutched
|
} else { # un-clutched
|
||||||
# --- experimental --- #
|
# --- experimental --- #
|
||||||
|
@ -1355,10 +1366,12 @@ var winch = func (open){
|
||||||
spoolspeed = spoolspeed - delta_spoolspeed;
|
spoolspeed = spoolspeed - delta_spoolspeed;
|
||||||
if ( spoolspeed < - unspool_max ) spoolspeed = - unspool_max;
|
if ( spoolspeed < - unspool_max ) spoolspeed = - unspool_max;
|
||||||
|
|
||||||
|
if ( delta_towlength_m < 0. ) {
|
||||||
#if ( delta_towlength_m < 0. ) {
|
forcetow_N = 0.;
|
||||||
# forcetow_N = 0.;
|
}
|
||||||
#}
|
else{
|
||||||
|
forcetow_N = elastic_constant * delta_towlength_m / towlength_new_m;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( forcetow_N > max_force_N ) {
|
if ( forcetow_N > max_force_N ) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue