I have written a simple program that controls two motors (outputs) each with two states ( positive, negative) with an Arduino. The motors states based on the status of four buttons (inputs) (Up, Down, Right, Left). Only one button can be active at a time.
if( up ) {
motor1 = positive ; // +
motor2 = negative ; // -
} else if ( down ) {
motor1 = negative ; // -
motor2 = positive ; // +
} else if ( left ) {
motor1 = negative ; // -
motor2 = negative ; // -
} else if ( right ) {
motor1 = positive ; // +
motor2 = positive ; // +
}
The logic table
| Motor1 | Motor2 |
-------------------------
Right | + | + |
Left | - | - |
Up | + | - |
Down | - | + |
The program seems simple enough that I think I should be able make a circuit instead of using a micro controller. Using a micro controller seems like a wast for just a simple application.
I have designed the right and left circuit and the up and down circuit separability trying to simplify it. Now I have to merge these two circuits together.
I assume that I will have to use few relays and a "OR transistor" to make the merged circuit. But I am not sure where to start.
Suggestions, comments or diagrams would be greatly appreciated.
Note: These motors are going to be used in a CoreXY table. I created these diagrams with CircuitLab