Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

2 H-Bridge and Shift Resister


  • Please log in to reply
3 replies to this topic

#1 Jardeth56

Jardeth56

    Member

  • Members
  • PipPip
  • 17 posts

Posted 28 October 2014 - 02:27 PM

Hi All,

 

I have started building a new project, and I have to control 4 motors independent of each other speed and direction.

 

I currently have 2  74HC595 Shift Registers and 2 L293D H-Bridges and I am trying to work out what would be the best way to wire them up so I could limit the number of pins I am using for the motor control and so I can control the direction and speed of each motor.

 

I would like to power the hole thing with 2 9v batteries.

 

I was hoping if any one have any advice on the best way to wire this all up.

 

I have attached my first attempt and a wiring diagram using Fritzing.

 

I haven't tried this yet as am scared I have made a mistake and am going to fry something.

 

 

Attached Files



#2 Paul Newton

Paul Newton

    Advanced Member

  • Members
  • PipPipPip
  • 724 posts
  • LocationBerkshire, UK

Posted 29 October 2014 - 09:09 AM

Hi Jardeth,

 

I think you will have trouble controlling the speed of the motors with your design.

This is because it will be quite difficult to toggle the outputs of the shift registers fast enough to give pulses of varying lengths.

 

I would recommend four changes:

  • Check if the driver chip requires you to add protection diodes, if so, add them to protect the driver circuit.
  • When using shift registers, connect them to the SPI port pins - SPCK, MOSI, and a latch pin. This will allow fast and easy writing to the shift registers. Have a look in the Wiki for some examples.
  • Have a look at the circuit diagrams for available H bridge drivers modules. These usually include an inverter logic gate that allows you to control the direction of each motor with one Netduino output. The output is taken directly to the IN1 signal, and an inverted version is taken to the IN2 signal. Then a single PWM signal is connected to the enable input to control the speed.
  • Use the four Netduino PWM outputs to control the speed (one per motor) - this will give much better speed control than driving the PWM from the shift register.

Once you only need two signals per motor (4 x PWM and 4 x direction), you might decide you don't need the shift registers after all!

 

Rather than build it myself, I have used an Ardumoto shield for driving a pair of motors. The schematic is here, showing the inverter circuit.

There are lots more shields and modules to chose from, and there will be ones that allow control of more than 2 motors.

 

One last thing, you said you wanted to use a 9V battery to power the motors - don't use a PP3 battery it won't have enough power to drive any sensible size motors. Use a pack of rechargeable cells (maybe 6 x AA NiMh, or a LIon / Lipo pack).

 

Hope this helps - Paul



#3 Jardeth56

Jardeth56

    Member

  • Members
  • PipPip
  • 17 posts

Posted 29 October 2014 - 09:50 AM

Hi Paul,

 

Thanks for you help.

 

The Main idea behind this, is to limit the number of pins I have to use to control my 4 motors and also be able to control there speed and direction.

 

I would rather not use a motor shield for this due to the fast I need to keep the weight down on the project.

 

Regarding power I was thinking 4 x 9v rechargeable square batteries in series.

 

Am really new to this so ant help would be great.

 

Regards

Iain 



#4 Paul Newton

Paul Newton

    Advanced Member

  • Members
  • PipPipPip
  • 724 posts
  • LocationBerkshire, UK

Posted 31 October 2014 - 03:26 PM

Hi Iain,

 

As far as shields go, they are often bulky, inflexible and can be expensive. Making you own board is far better - I do hope it goes well.

The main thing I was suggesting was that you have a look at the shields that are out there and check out how they wire up the driver chip - e.g. simplifying direction control and extra protection diodes.

 

Where shields and modules are good, is to help prototype a circuit and allow you to get started on the software. They allow you to wire up a system using known working parts, that you can then swap out for your own circuitry as it is built.

 

Wiring the batteries in series will give you 18 Volts, this sound a bit high - but obviously it depends on the motors you are using. The L293D has an absolute maximum rating of 36V, so 18V is not a problem to the driver chip.

Remember that wiring in series will not help deliver more current to the motors.

 

Be very careful if you decide to wire the batteries in parallel (to increase the available current), rechargeable batteries have a low internal resistance and if you try to join two batteries in parallel, any difference in charge level between them will result in current flowing from one to the other. This may cause heat and damage to the batteries.

 

My buggy uses a block of 5 rechargeable NiMh AA batteries in series, I found these are good for driving 4 modest motors. 5AA cells probably take up less space than 4 PP3 cells, and are cheaper! Obviously I don't know the actual requirements (voltage and current) for your motors.

 

I see you have another post talking about PWM, so I won't mention it here, but why are you trying to reduce the number of connections to the Netduino? I take it you have some cunning plan in mind for the other pins....

 

Have Fun - Paul






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.