Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

h-bridge dc motor control circuit Reworked

Status
Not open for further replies.

heathtech

New Member
I am designing a simple dc motor control circuit using a single 4013 cmos edge triggered d-style flip flop with the q-bar output fed back to the data input. The set and reset inputs are at ground potential. The clock pulse input is being used to toggle the outputs of the flip flop. Each high input changes the flip-flop output state. This is driving an H-bridge which in turn is driving a dc gearmotor. My problem is that intermittently, the optic sensor I am using is passing the "hole" on my encoder without changing the polarity to my motor. This is quite infrequent but is causing problems. I am not an experienced engineer, rather, a repair technician. I am just trying to prototype a more complex instrument and this is just part of the overall design. Does anyone have experience with this?
 
Re: h-bridge dc motor control circuit

heathtech said:
My problem is that intermittently, the optic sensor I am using is passing the "hole" on my encoder without changing the polarity to my motor.

All edge-triggered flip-flops need fast and clean rising/falling edges to work properly.

For 4013 using 5V supply, maximum allowable clock rise/fall timing is 15uS and this reduces to only 5uS at 10V supply. I'm pretty sure your optic sensor output was not switching fast enough sometimes.

To solve this problem, you need to condition the sensor output signal using a schmitt-trigger before feeding it into the clock pin of 4013. The CMOS MC14106 HEX schmitt trigger can be used to do the conditioning. Just connects two of the six triggers in series.
 
And connect the inputs of the unused Schmitt Triggers to gnd.

Otherwise excessive current may be drawn from the supply.

Len
 
I finally got the schematic posted. Take a look and make any suggestions or revisions! Thanks
 

Attachments

  • motor-pcb.gif
    motor-pcb.gif
    16.5 KB · Views: 1,933
By the way, thanks for the suggestion concerning the schmitt trigger. I added it to the circuit, but it did not seem to help much. BTW, with the motor disconnected, the logic section and h-bridge work perfectly. Can someone edit my schematic and give me an idea on filtering brush noise?
 
Hi heathtech,

It seems that the output of your optic sensor sort of required that you use 5V supply for the 4013 and the schmitt trigger. If it is not so, I would have suggested to use 78L08 instead. This higher supply voltage gives enough headroom to drive the two NTE2379 MOSFETs.

If you are stuck at 5V supply for 4013, the use of MOSFET NTE2379 which has max gate cut off voltage of 4V is a bit marginal as it may not fully turns on at 5V to drive the LB1640 properly. You should be using logic level MOSFETs like NTE2985 or NTE2987 instead. Measures the voltages at LB1640 pins IN1 and & 1N2 and confirms the MOSFETs can pull them down nicely.

Motor noise is not easy to filter out so its best to prevent it getting to the sensitive electronics in the first place. On this I have added a RC filter for the optic sensor.

One final thing that worry me is that the optic sensor could be producing multiple output pulses because the barrier is moving slowly across the sensor being driven by the geared motor. In this case, even the schmitt trigger would not help. Can't read the part numbers of the optic switch on your drawing so please provide some information on it.

I could not think of a good solution just yet maybe Len can provide some help here.
 

Attachments

  • motor-pcbx.gif
    motor-pcbx.gif
    15.2 KB · Views: 1,579
eblc1388 said:
Hi heathtech,

If you are stuck at 5V supply for 4013, the use of MOSFET NTE2379 which has max gate cut off voltage of 4V is a bit marginal as it may not fully turns on at 5V to drive the LB1640 properly. You should be using logic level MOSFETs like NTE2985 or NTE2987 instead. Measures the voltages at LB1640 pins IN1 and & 1N2 and confirms the MOSFETs can pull them down nicely.
The 4013 and 40106 can both operate on a supply of up to 15 Volt.

So an 8 Volt or even 12 Volt regulator would be feasible.

AND you need 100 nF ceramic bypass capacitors across both of the electrolytic proposed by L Chung. Electrolytics hae a relatively high impedance at high frequencies. So they need the 100 nF caps to bypass the HF noise.

Len
 
Your circuit does not include the brake state. So the motor is reversed while in motion. This must cause stress on both the motor and the LB1640.

So I suggest you modify the circuit so it passes through the brake state whenever the motor is reversed.

Len
 
optic sensor part#

The optical sensor part # is OPB 960T51. The requirement for the sensor is that the maximum voltage drop across the diode is around 1.5 volts if I remember correctly. Thus, the current limiting resistor.
 
Hi heathtech,

As expected, your optic switch power supply is rated for 5V operation only. Now you have connected it to 15V by mistake, you might have damaged it already.

Please get the datasheet of the sensor from the following site:

**broken link removed**

After careful thoughts, the use of toggle flip-flop for this particular operation is not foolproof and an extra pulse from the sensor would result in the circuit failed to operate at all.

What I propose now is using the 4013 in the set-reset mode. This has more advantage over the toggle mode as it can now survive several pulses from the sensor and still work correctly.

Circuit operates as follow:

Sensor output is normally LOW when light is blocked. Both AND gate 4081 outputs LOW. Let assume at this moment 4013 Q=LOW and /Q=HIGH. The hole of the rotating disc is opposite the sensor. C1 has already charged up to a voltage close to +5V via R3. Capacitor C2 voltage is LOW because Q is LOW.

When the hole of the disc moves across the sensor, the output of the sensor goes HIGH. U1A now ouputs HIGH and SET the flipflop so that 4013 Q=HIGH and /Q=LOW.
This switches off the AND gate U1A and extra pulses, if any, coming from the sensor has no effect on the 4013.

The motor now reverse direction and drive the hole of the disc away from the sensor. The sensor output returns to LOW.

Meanwhile, C2 now is charging up via R4. The timing of R4/C2 and R3/C1 is such that the voltage rise at the capacitor would only be high enough sometimes after the sensor output has returned to LOW. Without know the rotating speed of the disc, the value of C I put down is a wild guess but it is not critical to the operation of the circuit as long as it is completely charged up before the "hole" has moved towards the slot of the sensor.

The next time the sensor goes HIGH, a RESET operation would be carried out and the cycle repeats.

Heathtech you should be able to figure out the full schematic from the above. Remember to follow the good practice of grounding all unused CMOS gate inputs and use additional ceramic capacitors for the power supply bypass.

Good luck to you and please let us know whether the problem is solved.
 

Attachments

  • optomotor.gif
    optomotor.gif
    9.8 KB · Views: 1,483
Thank you all very much with the help with my motor control design. It was very friendly of you guys to take the time to study the schematic and suggest improvements. I would especially like to thank L. Chung for his schematics. For the next few days I will be pursuing the components I need for improving the circuit. It will take a few weeks to obtain the parts, but I will certainly post the results. Thanks again very much.
 
As I said above, I feel you should stop the motor before reversing it. Here is a suggestion.

Len
 

Attachments

  • motor_delay.gif
    motor_delay.gif
    6 KB · Views: 1,466
time delay for breaking action

Thank you Len for the schematic and time graph. I am going to add these components to the circuit as well. All very good information. I have learned a lot. I am just disappointed that my original design wasn't adequate ( I am not very experienced with the design end of electronics, so all of this is an excellent learning experience.) You guys obviously know what you are doing. Do you both (Len and L. Chung) work in the engineering field? Hobbyists? Repair techs like myself? Well, better get to work on reworking the prototype.
 
You're welcome.

I don't know how long the motor will take to stop, so I assumed 100 ms. You can increase this if you need to by increasing the capacitance values.

I've been designing circuits for longer than I care to remember.

Len
 
Hi heathtech,

I have a closer look at the data sheet of LB1640N and find out that it does not require +15V on its input pins to operate and it is TTL voltage level compatable.

Therefore, once again I would present to you a modified schematic which take care of the clock input and the motor braking as mentioned by Len. No more MOSFETs or 1.5K resistors are needed. As a furthur improvement on the clock input circuit, I use the "left over" schmitt triggers to condition the signals for the two AND gate inputs.

This circuit is not seen and commented by Len so he might has something to add. As far as I know this is now the proper "industrial grade" circuit design because the capacitor charge/discharge current is now limited to a safe level.
 

Attachments

  • lb1640x1.gif
    lb1640x1.gif
    12.4 KB · Views: 1,301
Hi heathtech,

After I posted the last circuit, Len has sent me a PM of an elegant idea he has about the circuit. I must admit that he is a master in this respect and I agree totally with his idea.

By delaying the D input logic level, additional pusles from the sensor would have no effect on the 4013 output stages. He has achieved similar circuit design with less component. Just make sure the R6/C3 time constant at the input of 40106 is sufficient for the sensor output to totally return to zero before the 40106 output voltage(4013 D input) changes.

All usual cautions like supply bypass capacitors and connecting unused gates inputs to ground applies. Len also suggest a higher voltage regulator like 78L08 or 78L12 but unfortunately the optic sensor is rated at 5V and is not an open collector type. Using 8V or 12V would require adding another zener diode so I kept the 78L05 unless Len has other comments.

Just when you thought it couldn't get any better! 8)
 

Attachments

  • lb1640z.gif
    lb1640z.gif
    14.5 KB · Views: 862
wow. How much do I owe you guys?

All I can say is that you guys must love electronics every bit as much as myself if not more! I especially like the way you both are brainstorming together. It is as if I have assembled a design team over the internet. HAHAHA. I ordered some extra components last night including the AND gate and some extra caps. However, the last design is so simple that it is brilliant, so I will try to build another board with the components I already have. I had no idea there where so many different combinations of ways to achieve the same result! I will let you both know the end result when I have reworked my PCB.
 
Hi heathtech,

Please note that direction of D1 & D2 have changed because I have removed the MOSFETs but have forgotten to also change the diode direction.

Anyway, the schematic shown is the modified one.
 
eblc1388 said:
All usual cautions like supply bypass capacitors and connecting unused gates inputs to ground applies. Len also suggest a higher voltage regulator like 78L08 or 78L12 but unfortunately the optic sensor is rated at 5V and is not an open collector type. Using 8V or 12V would require adding another zener diode so I kept the 78L05 unless Len has other comments.

I agree. I did not realise that the optical sensor was restricted th 5 Volt.

Len
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top