I am making a kinetic sculpture and the movement of it requires a reciprocating motion. I have made the designed such that a dc motor powers the movement of the sculpture, and a rotating beam that hits a DPDT switch. What I want is that when the beam hits the DPDT switch, it will reverse the direction of the motor, and it will go until the beam hits the DPDT switch from the other side. The mechanical design is all fine, but I have encountered a problem. When the beam hits the DPDT switch, it momentarily switches the motor off, and sometimes, the inertia of the motor is not enough to push it further so it reverses the switch.
I am not the best at electronics, but I have tried putting a bipolar capacitor across the motor:
The idea is to have the capacitor store a residual voltage that will power the motor for a few moment when the DPDT switch is at the off/middle position; however, it did not seem to work. I do not know if this is because of the fact that the polarity is reversed. If that is the case, I might try putting two series of diode and capacitor in parallel, each facing the other direction:
I have also bought a 555 IC but I do not know how to incorporate it with a reversing polarity like this.
Any help with the circuit design would be much appreciated. The motor runs on 9V, and I need the motor to run when it is disconnected from the switch for approximately 0.5 to 1 second. I also prefer the circuit to be small since I want the circuit to fit inside the base of the kinetic sculpture.