2020-02-13, 08:42 PM
What ohm value is your poti? Nee another with 1k for these looong cables. The same with the one Wire sensors. Many on the same bus work better with 2k pullup resistor.
Holger
Holger
(2020-02-13, 09:30 PM)McNugget Wrote: [ -> ]Regarding sanity checking: You are right. Most of the stuff get’s sanity checked. I should take that back.
In my version, and I don’t remember if your’s does that same, a steering command still starts to be executed even if min or max is already reached. It stops immediately, but some of the motion is done. In my case, that means the hydraulic pump as well as the hydraulic cylinder runs against a wall and get’s slightly stuck. I can drive put of that, though, but it means an improperly tuned controller runs into the wall all the time.. I want to change that to not allow any motion into an already maxed out direction.
if(value > 2000);
// unused range, invalid!!!
// ignored
else if(flags & (OVERTEMP_FAULT | OVERCURRENT_FAULT | BADVOLTAGE_FAULT));
// no command because of overtemp or overcurrent or badvoltage
else if((flags & (PORT_PIN_FAULT | MAX_RUDDER_FAULT)) && value > 1000)
stop();
// no forward command if port fault
else if((flags & (STARBOARD_PIN_FAULT | MIN_RUDDER_FAULT)) && value < 1000)
stop();
// no starboard command if port fault
else {
command_value = value;
engage();
}