motor interfacing questions

Ruzzy

New Member
Firstly, I must say that this is a school project and hence I can't simply purchase pre-made PCBs.
I want my motor to be controlled with PWM (I'm using a 28X1) but the motor is connected to an H-bridge circuit. It's actually a pair of 3V motors connected in series. I had a look at the PICAXE manual and found this.

I figured it made sense to use that, but I get the feeling there's the possibility of that capacitor somehow screwing up any use of PWM. Is that right? Furthermore, since the motors will be connected to a H-bridge circuit, I assumed I would connect it as follows.

The H-bridge PCB has two input pins which i would then connect to two PICAXE outputs. Lastly, I can't seem to find an IRF530 in Australia. Is there a common substitute for it?
Thanks in advance.
 

BeanieBots

Moderator
The H-Bridge is all you need. IT does the PWM drive to the motor. No need for any other power switching device.
Which H-Bridge are you using?
Most have an enable pin which you can use for PWM control.

The manual shows how to wire up an L293D type H-Bridge.

The cap on the motor will not be a problem for a properly designed H-Bridge.
It might be an issue for a sloppy homebrew but one which can't cope with a small capacitive load is unlikely to cope with ANY motor noise either.
 

hippy

Ex-Staff (retired)
The circuits on Page 5 of PICAXE Manual 3 describe simple on-off ( and PWM ) control of a motor using a transistor and FET respectively.

If you look on Page 6 you will find the circuit of an H-bridge (L293D). The H-bridge connects directly to the PICAXE output pins. You don't need ( or want ) the FET circuit from the Page 5.

Whether you can connect your choice of H-bridge directly to a PICAXE depends on what you are using. You may require some interfacing but that will not be what is shown on Page 5.
 

BeanieBots

Moderator
Then just apply your PWM signal to one of the inputs A or B whilst holding the other input low depending on which way you want the motor to go.
 

Ruzzy

New Member
That sounds like a really good idea. You mean I can ignore that interfacing circuit, have the + and - of the H-bridge connected by battery(or whatever) and have a PWM pin connected to each of the inputs (that control flow direction) on the H-bridge? If so, is the capacitor still suitable?
 

inglewoodpete

Senior Member
In a recent project that I was involved with, we used the big brother of the L293 (the L298) to drive a 12v motor. (Actually there were 36 PICAXEs driving 36 L298s driving 72 motors!)

We used 2 output pins for the direction control and connected the PICAXE's PWM pin to the Enable input of the H-bridge. With 72 motors, we didn't have any failures.

Every motor had a non-polarised capacitor across its pins. They also used a single loop of the motor wire through a ferrite bead to calm things down. Each motor pulled 1.5A under load, which may be why we had to used the ferrite beads.

Peter
 

BeanieBots

Moderator
That's the whole idea of a H-Bridge.
If this is for school work, you really need to have a full understanding of how that circuit works. At the moment it is far too obvious that it is something you have simply 'pinched'.

You only get marks for what you can demonstrate that you understand.

Simply apply power to the H-Bridge circuit and also connect the 0v of the H-Bridge and the 0v of your PICAXE circuit together.
Then apply PWM to the inputs A & B as described above.

It's still a good idea to have some capacitance across the motor to reduce noise.
 

Ruzzy

New Member
Thanks. Just making sure I interpreted that correctly. Interestingly I only fully understood the H-bridge after I had built it, and by that time I found it near-embarrassed that I hadn't picked up the simplicity of it before hand. Thanks alot! inglewoodpete I'll keep that in mind for something I'm building when my school is over :D
 
Top