DIY Dual H-Bridge to control a Pen Plotter

In my previous post I pulled apart an old pen plotter revealing it to be controlled by two brushed DC motors.  In order to power each DC motor a H-bridge was required but I had none on hand. However it turns out a H bridge can be constructed from a few transistors as can be seen in this useful guide.

What I came up with uses a Darlington array (ULN2003) to serve as the NPN transistors for both H-Bridges while 2N3906 transistors are used for the PNP side. These PNP transistors are switched using PN5856 NPN transistors so that the positive voltage output of the Arduino can be used. Its powered by 12V DC running at around 150mA (300mA stall current).

Throw in a few LED’s so that its clear when each direction is activated and the pen plotter now has bidirectional control for the x and y axis. Video of it in action below:

Please note this design was only thrown together to make use of what I had on hand and there are far more effective ways of building an H-bridge.

In the video you can see the two 5kOhm potentiometers. When connected to the ADC on the Arduino they give a full scale range of 726 (256 to 982). With the largest travel distance being 260mm for the x axis this gives an upper resolution limit of approximately 0.36mm. It seems likely that mechanical limitations would limit the resolution to a value far greater than this technical upper limit.

By writing a sketch to record each pot’s value and then pulse the motors until this value is reached it is quite simple to instruct the pen plotter to move to a position and then hold there.

To take this one step further I added two external potentiometers and used them to turn the pen plotter into an overly complicated Etch A Sketch.

You can find a copy of the sketch used to control the plotter here.

I might have a go some time at using the Arduino maths library to get the pen plotter to draw some interesting shapes.

Advertisements

About Richard

I am a PhD candidate in Materials Engineering located in Melbourne, Australia.
This entry was posted in A Reprap Project and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s