Skip to content

Commit

Permalink
do not engage solenoid during close lid and engage solenoid before op…
Browse files Browse the repository at this point in the history
…ening lid
  • Loading branch information
ahiuchingau committed Oct 24, 2024
1 parent 5ddd0be commit e323115
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -972,6 +972,8 @@ class MotorTask {
if (_lid_stepper_state.status != LidStepperState::Status::IDLE) {
return false;
}
// First release the latch
policy.lid_solenoid_engage();
if (policy.lid_read_closed_switch()) {
return start_latch_release_overdrive(response_id, policy);
}
Expand All @@ -998,8 +1000,6 @@ class MotorTask {
template <MotorExecutionPolicy Policy>
auto start_latch_release_backoff(uint32_t response_id, Policy& policy)
-> bool {
// First release the latch
policy.lid_solenoid_engage();
std::ignore = policy.lid_stepper_set_rpm(
LidStepperState::LID_DEFAULT_VELOCITY_RPM);
// Now start a lid motor movement to the endstop
Expand All @@ -1019,8 +1019,6 @@ class MotorTask {
if (_lid_stepper_state.status != LidStepperState::Status::IDLE) {
return false;
}
// First release the latch
policy.lid_solenoid_engage();
// Update velocity for this movement
std::ignore = policy.lid_stepper_set_rpm(
LidStepperState::LID_DEFAULT_VELOCITY_RPM);
Expand Down Expand Up @@ -1404,9 +1402,6 @@ class MotorTask {
_task_registry->comms->get_message_queue().try_send(
messages::HostCommsMessage(response)));
} else {
// Now that the lid is at the closed position,
// the solenoid can be safely turned off
policy.lid_solenoid_disengage();
// Turn off lid stepper current
policy.lid_stepper_set_dac(LID_STEPPER_HOLD_CURRENT);
// Movement is done
Expand Down

0 comments on commit e323115

Please sign in to comment.