Simple Motor controller and R/C signal interpreter
What I Have here is a relatively simple way to control 2 low to mid current motors with no fancy integrated circuits. This is just a nothing special H-bridge design, but I haven't seen much on the subject here, hence the post!
Excuse the "Paint" schematic
This H-bridge I have coupled with a Parallax BS2 to interpret a PWM (Pulse Width Modulated) signal coming from a Radio Control Receiver ( Will post code tomorrow, on a floppy at my school :D ) and spit out a combination of four outputs to engage the relays in a certain combination, reversing the polarity on one side of the motor at a time. The output states are as follows:
0000 - Stop
1010 - Left
0101 - Right
For every One you see, the corresponding relay in engaged, providing contact to the Normally Open ( NO) contact point, therefore allowing current flow to the motor, putting it in one direction. Each motor is tied to two of the outputs (the Common pins on the relays) Motor One in tied to outA and outB, motor two is tied to outC and outD.
For simle operation of one motor you have 4 logic states:
11 (not used, no need!)
When inA in low, outA is connected to ground, When inB is high, outB is connected to the positive, therefore the motor will turn in one direction. The same is true with motor 2.
Here is a picture of the finished board
^^Reverse emf protection diodes across the coil
Here is the Stamp I am using to interpret the PWM signal
I will post the exact code after the Holiday recess, but I can explain the operation!
Basically (hehe, its in pbasic, basically, get it? .......Crickets) The stamp is sampling the signal using the PULSIN command, it then stores the width valued in as a decimal value in a word variable. Then there are some conditional inequalites that say "if word var 1 is >700 then FWDsub". When the reciever is recieving a signal for a dead stick, it is receiving a pulse that has a value of ~750 microsec, it stays there as long as you don touch the stick, if you push one channel forward, the value decreases, and visa versa. So Four conditional statements control the program path, 2 per channel, one for fwd and reverse. GOT IT??? I know its not plug and play, but the satisfaction of doing it yourself is so much better than buying a motor controller... for me any way.
Code coming soon!
**Schematic fixed, thanks for catching!
x var word
Channel2 VAR word
Channel1 VAR word
PULSIN 12,1, Channel1
PULSIN 10,1, Channel2
If Channel2 < 700 then Forward_direction
If Channel2 > 850 then Reverse_direction
If Channel1 < 700 then Left_turn
If Channel1 > 850 then Right_turn