This project may be useful to drive a roll shutter motor or a car electric window. It works with two buttons (S1,S2), two limit switches (FC1, FC2) and an anti-crushing safety switch (SIC). Since this was my first project using logic gates, I started from a relay based schematic, then I converted it into a logic gates diagram.
How the relay logic circuit would work
By pressing for a bit a run button the motor spins. It will be stopped by the limit switch, or by pressing any button. The double function of the buttons is performed due to the relays K1 and K2. When a button is pressed the relay K1 turns on. By releasing the button both relays are energized. In this condition, if any button is pressed, the relay K1 turns off; by releasing the button both relays are off. If the anti-crushing safety switch takes action while a button is held, the motor does not restart when the safety switch backs in normal condition: the button must be released and pressed again. The relay RES is supposed to reset the condition of the relays K1-K2, when the limit switch is activated.
The circuit you see in the video performs exactly the same function. If it is used for a roll shutter driver, the anti crushing safety switch must feature an additional contact connected to the motor.