A practical application for the H-Bridge

In fischertechniks Hobby4, Band 3 models book I found a suitable model from page 54 to test the built H-Bridge modules. The construction of this model is shown to the right. A “workpiece” (see detail photo below) is placed on a beam that can be moved in both directions by a mini-motor, after which it will be automatically positioned between the two photo resistors. The distance between the two L-shaped light guides is exactly 30 mm. Unless the workpiece is already directly placed purely in the center, one of the two light-sensitive resistors will initially be blocked. This blockage can be removed by moving the beam in the correct direction.

complete1

Here, differential amplifier modules “read” the light sensors and control the relays that determine whether and in what direction the beam moves. Thus controlled, the mini-motor M1 (right in the picture) will move the beam with the workpiece towards the center point between the sensors. As soon as both LDRs are illuminated again, the workpiece (27.5 mm wide) is exactly in the center and this movement stops. So the starting direction of movement of the beam depends on which sensor is blocked first and the motor must be able to turn in both directions. A nice job for an H-Bridge!

The model includes a second motor (the gray 'classic' motor on the left in the photo) which is used to drive a shaft through a hole in the workpiece once it has come to a stop exactly in the middle between the two light guides. A rotation of this second motor M2, on which an egg wheel is mounted, then pushes the 'drill' outward. In the original model, this 'drill' motor simply rotates as soon as both photoresistors are illuminated (again) with the light from the bulb diffused through the two light guides. In the original text it is left as a challenge to the builder to perfect the arrangement so that only a single revolution (working stroke) is performed after the workpiece is positioned in the middle in front of the ejector.

detail-no-object detail-object detail-back

In the original booklet, the idea given for this purpose is to reset the entire control and thus the process. I solved it with an AND gate and a Flip-Flop module. No manual reset is then required and motor M2 neatly turns just a single revolution each time after the “work piece” is positioned. The original circuit diagram using the Relay Bausteine can be found in the original description (Figure 55.1 in the original documentation), the alternative circuit diagram using the homebrew H-Bridge 'Silberling' described above is shown below. The ENA and ENB 'enable' inputs should always be enabled in this model, so these are connected with jumpers to the +. In contrast, the Vm jumper was removed precisely so that an external DC adaptor can be connected to power the motors. Until it is connected, the control can be tested with the optional LED indicator discussed later.

automatic-positioning

detail2

To detect light interruption, the two photoresistors FW1 and FW2 are each connected to their own Grundbaustein. As soon as no more light falls on a photoresistor, the uninverted output of the corresponding Grundbaustein is LOW or '0'. Since the 'Silberlingen' work with negative logic, the output voltage is then around 9 volts. Because the H-Bridge module works with positive logic, these signals can be used directly as a HIGH, or '1', signal for the rotation direction inputs IN1 and IN2. Motor M1 will rotate in the corresponding direction, eventually positioning the workpiece midway between the photo resistors. At this point, both sensors are again illuminated with light and motor M1 stops. Now that the workpiece is positioned, the AND/NAND module gives a clock pulse to the Flip-Flop. This activates motor M2. After a full revolution, this motor activates a switch that resets the Flip-Flop, stopping the motor again.

The original manual is not very clear about the construction of the “workpiece. A simple building block 30 is suggested without a center bore. As a result, the outward bumping 'drill' will only knock the workpiece off the beam (or the model will jam if this does not succeed immediately). In addition, due to the black mounting cam on one side of the building block, the overall width is more than 30 mm. This allows the motor's direction of motion to keep correcting itself restlessly, so the “workpiece” will never come to a stop in the worst case. I solved it by making a slightly narrower 'workpiece' (see photos) that also has a hole in the middle so that after positioning it can be 'pierced' by the outward bumping axis. In practice, the positioning of this workpiece turns out to be quite precise.

h-bridge

See the photo above for a detail of the module where the H-Bridge 'Silberling' replaces the two Relay Bausteine in the original circuit. Also visible here is how the 'Enable' inputs are activated with a small jumper to the adjacent '+' of the Dupont rail. This again saves wiring and plugging. On the output side, the Dupont connector strips also come in handy. A simple indicator with four LEDs is placed there. This extra is obviously not necessary but is very easy to keep an eye on the various motor outputs while adjusting the control. The motors then do not have to be connected directly yet.

Concluding remarks

Functionally, both H-Bridge modules have many similarities. The module the DRV8833 visually aligns more with the traditional Silberlingen, but the modue with the L298N can handle higher motor voltages. Meanwhile, in practice, the modules have proven to be an excellent replacement for the well-known fischertechnik Relay Baustein. A great advantage is that the wiring and control of the direction of rotation are much simpler when using an H-Bridge. Due to the separate inputs for the two directions of rotation and a clear separation between input and output sides of the module, the overview is maintained, a wrong direction of rotation can be reversed faster and there is much less chance of short circuits due to wiring errors. In this model, the separate 'Enable' inputs for switching the motor are not yet used. But in more complex switching schemes where rotation direction and switching the motor on and off are separate functions, this saves another relay module. A further advantage is that due to the many connection options, connecting an external motor voltage is very easy.

control-with-model1