Silicon Chip12V-24V High-Current DC Motor Speed Controller, Pt.2 - April 2008 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: Your future electric car may use ultracapacitors
  4. Feature: Beyond The Capacitor There Is The Ultracapacitor by Ross Tester
  5. Feature: How To Get Into Digital TV, Pt.2 by Alan Hughes & Leo Simpson
  6. Project: Charge Controller For 12V Lead-Acid Or SLA Batteries by John Clarke
  7. Project: A Safe Flash Trigger For Your Digital SLR Camera by Ross Tester
  8. Project: 12V-24V High-Current DC Motor Speed Controller, Pt.2 by Mauro Grassi
  9. Project: Two-Way Stereo Headphone Adaptor by Mauro Grassi
  10. Vintage Radio: Shortwave converters from the 1930s by Rodney Champness
  11. Book Store
  12. Advertising Index
  13. Order Form

This is only a preview of the April 2008 issue of Silicon Chip.

You can view 29 of the 96 pages in the full issue, including the advertisments.

For full access, purchase the issue for $10.00 or subscribe for access to the latest issues.

Articles in this series:
  • How To Get Into Digital TV (March 2008)
  • How To Get Into Digital TV (March 2008)
  • How To Get Into Digital TV, Pt.2 (April 2008)
  • How To Get Into Digital TV, Pt.2 (April 2008)
Items relevant to "Charge Controller For 12V Lead-Acid Or SLA Batteries":
  • 12V Lead-Acid Charge Controller PCB [14104081] (AUD $12.50)
  • PIC16F88-I/P programmed for the 12V Battery Charge Controller [1410408A.HEX] (Programmed Microcontroller, AUD $15.00)
  • PIC16F88 firmware and source code for the 12V Lead-Acid or SLA Battery Charge Controller [1410408A.HEX] (Software, Free)
  • 12V Lead-Acid or SLA Battery Charge Controller PCB pattern (PDF download) [14104081] (Free)
  • 12V Lead-Acid or SLA Battery Charge Controller front panel artwork (PDF download) (Free)
Items relevant to "12V-24V High-Current DC Motor Speed Controller, Pt.2":
  • PIC16F88-I/P programmed for the DC Motor Speed Controller [0910308A.HEX] (Programmed Microcontroller, AUD $15.00)
  • PIC16F88 firmware and source code for the 12-24V High Current Motor Speed Controller [0910308A.HEX] (Software, Free)
  • 12-24V High-Current Motor Speed Controller main PCB pattern (PDF download) [09103081] (Free)
  • 12-24V High-Current Motor Speed Controller display PCB pattern (PDF download) [09103082] (Free)
Articles in this series:
  • 12V-24V High-Current DC Motor Speed Controller, Pt.1 (March 2008)
  • 12V-24V High-Current DC Motor Speed Controller, Pt.1 (March 2008)
  • 12V-24V High-Current DC Motor Speed Controller, Pt.2 (April 2008)
  • 12V-24V High-Current DC Motor Speed Controller, Pt.2 (April 2008)
Items relevant to "Two-Way Stereo Headphone Adaptor":
  • Stereo Headphone Adaptor PCB [01104081] (AUD $15.00)
  • Two-Way Stereo Headphone Adaptor PCB pattern (PDF download) [01104081] (Free)
  • Two-Way Stereo Headphone Adaptor front panel artwork (PDF download) (Free)
  • Two-Way Stereo Headphone Adaptor rear panel artwork (PDF download) (Free)

Purchase a printed copy of this issue for $10.00.

Pt.2: By MAURO GRASSI 12V-24V High-Current Motor Speed Controller Last month, we described the circuit and software features of our new High-Current DC Motor Speed Controller. This month, we show you how to build and test it. T HE DC MOTOR Speed Controller is built on two PC boards: a main board coded 09103081 (124 x 118mm) and a display board coded 09103082 (73 x 58mm). These are joined together via a 12-way flat ribbon cable which plugs into a pin header on the main board. The main board can be assembled first – see Fig.9. Start by checking the PC board for hairline cracks and for any visible shorts, especially between the ground plane and any adjacent tracks. In addition, check the hole sizes for the larger hardware items by test fitting these parts into position. 64  Silicon Chip That done, begin by installing the 17 wire links. These must go in first, since some of them run under other components. To straighten the link wire, first clamp one end in a vice, then stretch it slightly by pulling on the other end with a pair of pliers. It’s then just a matter of cutting the links to length and bending their leads down through 90° to match the holes in the PC board. The resistors are next on the list. Table 1 shows the resistor colour codes but you should also check each one using a digital multimeter before installing it on the board, as some colours can be difficult to decipher. Note that resistor R1 should be 1kW if the supply voltage will be higher than or equal to 16V. Alternatively, use a 100W resistor if the supply voltage is going to be less than 16V. The 22W 1W resistor (on the lefthand side of Fig.9) should be mounted 3-4mm proud of the PC board to aid heat dissipation. Once the resistors are in, install the diodes and the zener diodes. Take care to ensure that these are all correctly oriented and note that diode D2 (near inductor L1) must be a 1N5819 Schottky type. Take care also with the zener diodes. ZD1-ZD5 are all 16V 1W types, while ZD6 and ZD7 are 33V 5W types. The fast recovery diode (D3) can be left until later as there are two options for this. The next thing to do is to solder in the four power Mosfets (Q5-Q8). These come in a TO-220 package and sit siliconchip.com.au NOTE: USE NEUTRAL-CURE SILICONE SEALANT TO SECURE INDUCTOR L1 AND THE 2200mF LOW-ESR CAPACITOR Fig.9: install the parts on the main PC board as shown on this layout diagram, starting with the 17 wire links. The 40EPF06PBF 40A fast recovery diode (D3) is shown in position here but you can also use two MBR20100CT 20A diodes connected in parallel (see Fig.10). Note the alternative positions for VR1. horizontally on the PC board. Note that the source lead of each device extends further than the other two. Before mounting each device, you will have to first position it on the PC board and bend its leads down through 90° so that they mate with the holes in the board. That done, fasten each device to the PC board using an M3 x 6mm screw and nut before soldering its leads. Do not solder the leads before bolting the metal tab down. If you do, you risk stressing the soldered joints as the screw is tightened and this could crack the copper or lift the pads. The next thing to do is to solder in the two IC sockets. Make sure these are oriented correctly as per the component overlay. It is important that you use IC sockets because calibration of the +5V rail is done with microcontroller IC1 out of circuit. This is described later during the setting-up stage. siliconchip.com.au Now the four bipolar transistors can be soldered in. There are three BC337 NPN types (Q2-Q4) and one BC327 PNP type (Q1) – don’t get them mixed up. Their leads will only go in one way and it’s just a matter of pushing them down onto the board as far as they will comfortably go before soldering the leads. The single 3mm red LED can go in next, again taking care to orient it correctly. Its anode lead is the longer of the two. Follow this with trimpot VR2 and the piezo buzzer. Note that the buzzer must be installed with its positive terminal towards the bottom edge of the board – see Fig.9. Once these parts are in, you can solder the capacitors in place. The ceramic, monolithic and MKT types can go in either way around but be sure to orient the electrolytics correctly. The large low-ESR 2200mF capacitor sits horizontally on the PC board with its leads bent at 90° to go through their holes in the board. The SPDT horizontal toggle switch (S1) can be soldered in next. Alternatively, this part can be mounted on a panel and connected back to the PC board via flying leads – it all depends on how you intend mounting the board. The 220mH toroid inductor (L1) sits vertically on the PC board – see photo. Be sure to strip the enamel from its leads and tin them with solder before attempting to solder it in position. CON1, the 12-way header, is next on the list. This should be oriented as shown on Fig.9 and the photographs. That done, mount the two heavy-duty 3-way screw terminal blocks. Note that these are dovetailed together to make a 6-way block before mounting them on the board. Potentiometer VR1 can now be April 2008  65 Table 2: Capacitor Codes Value mF Code IEC Code EIA Code 220nF 0.22mF 220n 224 100nF 0.1mF 100n 104 470pF NA 470p 471 soldered straight in as shown in Fig.9 and the photo at left. Make sure that it goes in with its metal face towards the screw terminal block. Alternatively, if you are using the two MBR20100CT 20A diodes, then these must be connected in parallel and installed as shown in Fig.10 and its accompanying photos. These particular diodes come in TO-220 packages and each package itself contains two 10A diodes which are used in parallel. The middle lead connects to the tab and is the cathode. This middle lead must be cut off using a small pair of sidecutters, as the tabs are used to make the cathode connections to the board. The two outer leads of each device are the anode connections. The procedure for mounting these two diodes is as follows: (1) Drill the hole for the cathode connection on the PC board to 3mm. (2) Lightly tin the copper around the two mounting holes (this is necessary to ensure good contact with the screw heads). (3) Secure the metal tab of the first device to the PC board using an M3 x 12mm screw and nut, with the screw passing up from the underside of the board. Tighten the nut down firmly. (3) Install an M3 x 12mm screw through the hole at the anode end of the diodes, secure it with a nut, then This view shows the fully assembled main board. Note that this prototype board differs slightly from the final version shown in Fig.9. installed. There are two possible locations on the board for this part. Mount it in the position that’s the most convenient for your application (but don’t install a pot in both positions). Alternatively, the pot can be mounted off the board and connected to its mounting pads via flying leads. Leave the two ICs out of their sockets for now. We’ll cover their installation later in the article. Fast recovery diode Now for the fast recovery diode (D3). If you are using the 40EPF06PBF diode (rated at 40A), then this can be Table 1: Resistor Colour Codes o o o o o o o o o o o o No.   2   2   1   6   6   1   1   8   1   4   3 66  Silicon Chip Value 33kW 4.7kW 3.6kW 1kW 470W 100W 56W 39W 22W 15W 1W 4-Band Code (1%) orange orange orange brown yellow violet red brown orange blue red brown brown black red brown yellow violet brown brown brown black brown brown green blue black brown orange white black brown red red black brown brown green black brown brown black gold gold 5-Band Code (1%) orange orange black red brown yellow violet black brown brown orange blue black brown brown brown black black brown brown yellow violet black black brown brown black black black brown green blue black gold brown orange white black gold brown red red black gold brown brown green black gold brown brown black black silver brown siliconchip.com.au Fig.10: this diagram & the two photos below show how to install the alternative MBR20100CT fast recovery diodes (D3). FRONT PANELS & ENCLOSURES Customized front panels can be easily designed with our free software Front Panel Designer • Cost-effective prototypes and production runs • Wide range of materials or customization of provided material • Automatic price calculation • Fabrication in 1, 3 or 7 days In this photo, the first diode has been fastened into position and its two outer leads soldered to the solder lug. The second diode is then mounted in position and its outer leads soldered to the top solder lug. fit a solder lug and secure it with a second nut. Again, make sure the nuts are done up tightly. (4) Solder the two outer leads of this first device to the solder lug, then fit another solder lug and nut. (5) Secure the tab of the second device in position and solder its outer leads to the top solder lug. Alternatively, IC3 can be directly soldered to the PC board. Be sure to install the IC with the correct orientation – ie, its notched end goes towards CON2. Finally, complete the display board assembly by installing a 12-way pin header (this part is optional), the two pushbutton switches and the four 7-segment displays. Be sure to orient the displays with the decimal points at bottom right. Similarly, make sure that the push­button switch­es are correctly oriented. As shown in Fig.11, they must each be installed with the flat side towards the displays. Building the display board The display board is optional but will be useful in many applications. If you decide not to build it, you will not be able to change the settings and default values will have to be used. You will also have no way of knowing what percentage of full speed the motor is running at. As before, check the board for defects. In particular, check for shorts between tracks or between the ground plane and any adjacent tracks. That done, start the assembly by installing the 23 wire links. Some of these sit under the 7-segment LED displays, so make sure these links sit flat against the PC board. Don’t forget the short links immediately to the left of CON1 and at bottom right. The resistors can go in next, followed by the 100nF capacitor and the four transistors (Q9-Q12). If you are using an IC socket for IC3, then this can also now go in. Install it with its notched end positioned as indicated on the diagram, then install IC3 (74HC595). siliconchip.com.au Connecting the boards Sample price: USD 43.78 plus S&H www.frontpanelexpress.com ANTRIM TRANSFORMERS manufactured in Australia by Harbuch Electronics Pty Ltd Toroidal – Conventional TX – Power – Audio – Valve – Specials – Medical – Isolated & Stepdown – Encased Power Supplies Once the board assemblies are complete, make up a 12-way ribbon cable to connect the two boards together. This should be terminated at either end to a 12-way header plug. Be sure to arrange this cable so that pin 1 of the header of the main board connects to pin 1 of the header of the display board and so on. Toroidal General Construction Set-up INNER WINDING Once you have completed the con­ struction, the next step is to go through the setting up procedure. You also need to adjust trimpot VR2 on the main board, so that the output from the MC30463 IC (IC2) sits at exactly +5V (this rail needs to be at exactly +5V to ensure that the voltage meas- OUTER INSULATION OUTER WINDING WINDING INSULATION CORE CORE INSULATION Comprehensive data available: www.harbuch.com.au Harbuch Electronics Pty Ltd 9/40 Leighton Pl, HORNSBY 2077 Ph (02) 9476 5854 Fax (02) 9476 3231 April 2008  67 Questions, Problems & Answers Question: is the display board optional? Answer: yes the display board is optional and the DC Motor Speed Controller will function without it. However, the display board is necessary if you want to change the settings of the battery alarm, the audible cues and the frequency of the PWM, as well as to view the current speed of the motor and the values of the settings. We therefore recommend that you build the display board as well, even if you use it to change the settings only once. If this board is subsequently disconnected, the speed controller will still work and will use the last settings stored in the microcontroller’s nonvolatile memory. Problem: when using the display board, not all digits light up. What should I do? Answer: check the 12-way cable and the pin header connections. Check that all 12 connections are good. Problem: the voltage at the cathode of ZD1 is nowhere near 12-16V (it should be 16V if the supply voltage is 16V or greater). Answer: check the orientation of ZD1 and check for incorrect power supply connections. Problem: the power supply voltage does not appear on the cathode of D1. Answer: in normal operation, D1’s cathode should sit about 0.6V below the supply voltage. This cathode should not exceed 40V at any time, or damage may occur to the switchmode IC and to the microcontroller. ZD7, a 33V 5W urements made by the microcontroller are accurate). The setting-up procedure is as follows: (1) Check that the two ICs on the main board are out of their sockets and that toggle switch S1 is in the OFF position (ie, the switch should be in the opposite position to that shown Fig.9). (2) Connect a 12V-24V DC supply to the screw terminal blocks (check the supply voltage before you do this). Note that if you are connecting the supply leads directly to a battery, there could be a spark when you first con68  Silicon Chip zener diode, is there to protect against high voltages on this rail. Problem: some components are getting quite hot. Answer: in normal operation, all components should run cool except for the fast recovery diode (D3), the four power Mosfets Q5-Q8 (especially if high currents are being switched) and possibly zener diodes ZD6 & ZD7, although the latter should not get too hot. If they do, it could mean that the supply lead inductance is causing high transient voltages on the supply rail. Normally the low-ESR 2200mF capacitor should filter these out but if you do strike problems, try minimising the length of the power supply connecting leads (as well as those to the motor, if possible). You should also twist the positive and negative power supply leads together in order to cancel any magnetic fields induced by high currents. Problem: the speed controller does not respond to the pushbutton switch­es on the display board. Answer: this could be caused by the pushbuttons being incorrectly oriented on the display board. Make sure the two pushbuttons are installed with their flat sides as indicated on the parts layout diagram (Fig.10). Problem: LED1 (red) lights but there is no beep from the piezo buzzer. Alternatively, there is a beep from the piezo buzzer but the LED does not light. Answer: either the LED is incorrectly oriented or the buzzer is. nect power due to the low-ESR 2200uF bypass capacitor across the supply. For this reason, connect the supply leads to the battery first, then to the terminal blocks, as it’s never a good idea to generate a spark near a battery. As noted previously, resistor R1 should be 1kW if you are using a supply greater than or equal to 16V. Alternatively, R1 should be 100W if you are using a supply of less than 16V. (3) Apply power to the circuit by toggling S1 to ON. (4) Check the voltage on D1’s cathode. It should be about 0.6V less that the supply voltage. (5) Check the voltage on ZD1’s cathode. This should be very close to +16V if you are using a power supply that’s greater than 16V. Alternatively, it should sit between +12V and +16V if you are using a 12-16V power supply. (6) If these voltages are OK, switch off and install the MC34063 switchmode IC (IC2) into its socket. Make sure that the notch on the IC matches the notch on the socket – ie, the notch must face towards inductor L1. (7) Apply power and check the voltage at pin 1 of the 12-way header on the main board. This is the +5V rail but it may not yet be at exactly +5V (the exact voltage depends on the setting of trimpot VR2). (8) Adjust VR2 until the voltage on pin 1 of the header is exactly +5V. (9) Assuming that the above voltage is now correctly set, switch off and insert microcontroller IC1 into its socket. Make sure that its notched end goes towards link LK11. (10) Plug the display board into the 12-way header and apply power. If everything is working correctly (and assuming a motor isn’t connected), the 4-digit display should immediately read “P00.0”, indicating the current speed. (11) If it all works correctly, skip the following troubleshooting section and go straight to the software initialisation procedure. Troubleshooting If you strike problems, the first thing to do is go back and check the board for any missed or bad solder joints. Check also that there are no shorts between tracks or between the ground plane and any adjacent tracks. If these checks don’t reveal the problem, we suggest that you go through the following checklist: (1) Check that all 17 links are installed on the PC board. A missing link could mean that parts of the ground plane are floating and this will lead to improper operation! (2) Check that all polarised components, including the diodes, zener diodes, electrolytic capacitors and ICs are correctly oriented as per the component overlay. (3) Check that you have used the correct value for R1, depending on your input supply voltage. (4) Make sure that the four transissiliconchip.com.au drao B y alpsiD 28030190 DISP3 39 39 39 DISP2 DISP4 S3 Q9 100nF IC3 74HC595 Q10 Q11 Q12 470 470 470 470 39 39 DISP1 39 39 G M 7 0 0 2/ 1 1 CS 39 S2 1 12 CON2 (FROM MAIN BOARD) Fig.11: here’s how to assemble the optional display board. Make sure all parts, including the switches, are correctly oriented. tors on the main board are the correct types. Q2-Q4 are all BC337s but Q1 is a BC327 type. (5) Make sure that the input voltage connections to the 6-way terminal block are correct. We have also assembled a list of likely questions and answers that may help you troubleshoot the DC Motor Speed Controller if it is not operating as expected – see accompanying panel. Software initialisation If your boards are working, it is now time to initialise the software settings before connecting a motor. To do this, you must have the display board connected. Note that more detailed user instructions for the DC Motor Speed Controller appeared in Pt.1 last month (p37-39). This section simply explains how to change the battery level alarm and the frequency of the PWM before you use the unit for the first time. These settings will be retained in nonvolatile memory. When the microcontroller begins executing the firmware (from a power- siliconchip.com.au on reset) you should be taken straight to the main menu. This will indicate the percentage of full speed that the motor is currently running at. Without a motor connected, it should read “P00.0”. From here, press “short R” twice (see Pt.1) to arrive at the battery level alarm menu. This menu shows an “A” followed by a 3-digit voltage value which indicates the voltage level below which the low battery alarm will sound. In this menu, press “long L” to set the level using potentiometer VR1. The “A” should start flashing and you should then be able to vary the pot to change the level. Once you are happy with the current level, press “short L” to update the setting and return to the main menu. Next, press “short R” three times to arrive at the frequency menu. This will show an “F” followed by a 3-digit frequency in kilohertz. Once you are in this menu, press “long L” and set the frequency of the PWM (pulse width modulation) using VR1. The “F” should flash while you are setting the frequency. In practice, the frequency can be set to one of 256 values between 488Hz and 7812Hz. Once you have set the desired frequency, press “short L” to store the setting and return to the main menu. That’s it! For more detailed instructions on the other software modes, refer back to the March issue. Connecting the motor Once you have verified that the DC Motor Speed Controller is working correctly, you can connect a motor. This should be connected with its positive terminal to the second terminal block from the top, while its negative terminal can go to either the third or fourth terminal from the top. Note that all supply and motor connections to the terminal block should be run using heavy-duty 56A wire. The top terminal block is used to terminate the positive supply lead from the battery. This lead should connect via the 50A in-line fuse. Either of the bottom two terminals can be used for the negative battery lead (ie, one is left unused). Your DC Motor Speed Controller is SC now ready for action. April 2008  69