Browse Source

slower up driving for model

master
interfisch 5 months ago
parent
commit
a981a1f1ae
  1. 12
      src/main.cpp

12
src/main.cpp

@ -94,7 +94,7 @@ struct blindmodel
float speedfactorLow=1; //how much position units (mm) per second at pwm=100. speedfactorLow for position at 0
float speedfactorHigh=1; //speedfactorHigh for position at 1000 mm. gets extrapolated above
float speedfactor_factor_updirection=1; //when moving up, how much to change the estimated position change (speed). when going slower in up direction, choose value below 1.0
float speedfactor_factor_updirection=1.0; //when moving up, how much to change the estimated position change (speed). when going slower in up direction, choose value below 1.0
int sense_clear_lower; //adc value lower limit for clear part. clear is around 70
int sense_clear_upper; //adc value upper limit for clear part
@ -212,7 +212,7 @@ void setup() {
blind1.sense_end_upper=1024;
blind1.speedfactorLow=28.7;
blind1.speedfactorHigh=25.3;
blind1.speedfactor_factor_updirection=0.97; //down: 2306mm in 94s ,up: 97s
blind1.speedfactor_factor_updirection=0.80; //down: 2306mm in 94s ,up: 97s
blind1.start_first_clear=27;
blind1.simulated_acc_dec=-120;
blind1.simulated_acc_inc=200;
@ -231,7 +231,7 @@ void setup() {
blind2.sense_end_upper=1024;
blind2.speedfactorLow=27.6;
blind2.speedfactorHigh=23.5;
blind2.speedfactor_factor_updirection=0.97;
blind2.speedfactor_factor_updirection=0.8;
blind2.start_first_clear=27;
blind2.simulated_acc_dec=-120;
blind2.simulated_acc_inc=200;
@ -280,11 +280,17 @@ void loopHandler() {
//Manual movement by button
//TODO: button handler. long press both, double press. etc.
//hold button down at startup for failsafe mode (manual drive by button press. ignore sensors)
//normal operation: Hold button for 5sec - reset & find end
// tap button once - drive up until pressed again
// tap button twice - drive down until pressed again (for left and right blind resp.)
manualMoveHandler(button1, blind1);
manualMoveHandler(button2, blind2);
//Read sensor/encoder
if (millis() > last_sensor_read + SENSOR_READ_INTERVAL/2) {
int rawsensorvalue=analogRead(PIN_SENSE);

Loading…
Cancel
Save