rr2039 / RR-2020-InfiniteRecharge

Codebase for Infinite Recharge
2 stars 1 forks source link

Hopper System Requirements #8

Closed dawsynth closed 1 month ago

dawsynth commented 4 years ago

Overview of Requirements The Hopper Subsystem should not be constantly running. Therefore, to solve this there will be two sensors at each end of the hopper queue to detect when balls are entering and leaving to know when and when not to run the motor. A simple state system will aid in detecting these changes.

Requirements stateMachine The diagram above provides an idea of what the system should do in terms of when to change the states. In the initial state, the system should be waiting for a ball to enter to change to the Hot state. This should be done through signal edge detection in which a shadow variable will constantly be checked against the sensor reported data, and if the sensor is rising edge, or changing from low to high / false to true, the system will change state to Hot and increase the ball count variable. The system will also change state from initial to hot if the ball count is known to be greater than zero. Then, from hot to armed requires sensor two to be rising edge (from false to true). At which point, the system will turn the motor off and wait for user input to shoot the ball. Once the button is pressed to shoot the ball, sensor two will be in falling edge and repeat the cycle. Altogether, an enumeration will most likely be useful in setting these constant states and comparing the states to properly set the motor.

dawsynth commented 4 years ago

Disregard the entire system in the overview above. As the balls continue to smash destroy each other, a new way in conserving when the queue is run is needed. So, just as before when a button is pressed the intake arm will extend and the wheels will run to guide the ball to the queue. If the queue is full (4 balls), the intake wheels should stop running. After a ball is detected, the queue should then turn on until the photoeye is inactive, or the queue is known to be full. Similar to before, there will be four 'states,' but now they will be less distinguished. When there are no balls in the system, nothing should be done. When there is a ball sensed, it will turn on the queue until the photoeye is inactive. Then it will reenter the 'No Ball' state. At that point, it will bounce back and forth between these 'states' until the ball count is 4, and the state will turn to 'Full'. Then, the intake should be turned off, and after further testing we will know if the intake should also be retracted. The only way this can leave 'Full' should be if the operator triggers shoot, and it will do the same as before in functionality, wait for the motors to spin up and move the ball up into the turret. However, the No Ball state should be able to enter the shoot state as well, but now the ball will have to be moved up into the armed position as well.