In this Instructable, I will go through the steps that I took to select a Step Motor and Driver for a prototype Automated Shade Screen project. The shade screens are the popular and inexpensive Coolaroo hand cranked models, and I wanted to replace the hand cranks with step motors and a central controller that could be programmed to raise and lower the shades based on calculated sun rise and sun set times. The project has evolved through at least five iterations into a product that you can find on Amazon.com or AutoShade.mx, but the process for selecting the step motor and its driver electronics is one that should be applicable to many other Arduino based projects.
The initial configuration chosen for the prototype electronics was the Arduino Uno (Rev 3) processor (Adafruit #50) with boards for display (Adafruit #399), real time clock timing (Adafruit #1141) and dual step motor drivers (Adafruit #1438). All boards communicate with the processor using a serial I2C interface. Software drivers are available for all of these making development of the shade screen controller much simpler.
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Determine the Requirements
The shades should operate at least as fast as with hand cranking. A sustained hand cranking speed might be 1 crank per second. Most step motors have a step size of 1.8 degrees, or 200 steps per revolution. So the minimum step speed should be about 200 steps per second. Twice that would be even better.
The torque to raise or lower the shade through the Coolaroo worm gear was measured on 9 shade screens at the top and bottom of their travel using a calibrated torque screwdriver (McMaster Carr #5699A11 having a range of +/- 6 in-lbs). This was the “breakaway” torque, and it varied a lot. The minimum was 0.25 in-lbs and the maximum was 3.5 in-lbs. The proper metric unit of measure for torque is N-m and 3 in-lbs is .40 N-m which I used as the nominal “friction torque”.
Step motor vendors specify motor torque in units of kg-cm for some reason. The above minimum torque of 0.4 N-m is 4.03 Kg-cm. For a decent torque margin I wanted a motor capable of delivering twice this or about 8 Kg-cm. Looking over the step motors listed at Circuit Specialists quickly indicated that I needed a frame size 23 motor. These are available in short, medium and long stack lengths and a variety of windings.
Step 2: Build a Dynamometer
Step motors have a distinct torque vs speed characteristic that depends on the manner in which their windings are driven. There are two reasons why the torque decreases with speed. The first is that a back EMF (voltage) is developed in the windings that opposes the applied voltage. Secondly, the winding inductance opposes the change in current that occurs with each step.
The performance of a step motor can be predicted using a dynamic simulation, and it can be measured using a dynamometer. I did both, but will not be discussing the simulation because the test data is really a check on the accuracy of the simulation.
A dynamometer allows measuring the torque capacity of a motor while running at a controlled speed. A calibrated magnetic particle brake applies the load torque to the motor. There is no need to measure the speed since it will be equal to the step rate of the motor until the load torque exceeds the motor’s capability. Once this happens, the motor loses synchronization and make a loud racket. The test procedure consists of commanding a constant speed, slowly increasing the current through the brake, and noting its value just before the motor loses synch. This is repeated at various speeds and plotted as torque vs speed.
The magnetic particle brake chosen is a Placid Industries model B25P-10-1 purchased on Ebay. This model is no longer listed on the manufacturer’s web site, but from the part number, it is rated to supply a peak torque of 25 in-lb = 2.825 N-m, and the coil is designed for 10 VDC (max). This is ideally suited for testing the size 23 motors under consideration which are rated to produce peak torques of about 1.6 N-m. In addition, this brake came with a pilot hole and mounting holes identical to those used on NMEA 23 motors, so it could be mounted using the same size mounting bracket as the motor. The motors have ¼ inch shafts and the brake came with a ½ inch shaft so a flexible coupling adapter with the same size shafts was also procured on Ebay. All that was required was to mount to two brackets to an aluminum base. The photograph above shows the test stand. The mounting brackets are readily available on Amazon and Ebay.
The braking torque of the magnetic particle brake is proportional to the winding current. To calibrate the brake, either of two torque measuring screwdrivers were connected to the shaft at the opposite side of the brake as the step motor. The two screwdrivers used were McMaster Carr part numbers 5699A11 and 5699A14. The former has a maximum torque range of 6 in-lb = 0.678 N-m and the latter has a maximum torque range of 25 in-lb = 2.825 N-m. Current was supplied from a variable DC power supply CSI5003XE (50 V/3A). The graph above shows the measured torque vs current.
Note that in the range of interest for these tests, the braking torque can be closely approximated by the linear relationship Torque (N-m) = 1.75 x Brake Current (A).
Step 3: Select Candidate Step Motor Drivers
Step motors may be driven with one winding fully active at a time commonly called SINGLE stepping, both windings fully active (DOUBLE stepping) or both winding partially active (MICROSTEPPING). In this application, we are interested in maximum torque, so only DOUBLE stepping is used.
Torque is proportional to the winding current. A step motor may be driven with a constant voltage if the winding resistance is high enough to limit the steady state current to the rated value for the motor. The Adafruit #1438 Motorshield uses constant voltage drivers (TB6612FNG) that are rated at 15 VDC, 1.2 amps maximum. This driver is the larger board shown in the first photo above (without the two daughter boards on the left).
Performance with a constant voltage driver is limited because the current at speed is greatly reduced due to both the winding inductance and the back EMF. An alternative approach is to select a motor with a lower resistance and inductance winding and to drive it with a constant current. The constant current is produced by pulse width modulating the applied voltage.
A great device used to provide the constant current drive is the DRV8871 made by Texas Instruments. This small IC contains an H bridge with an internal current sense. An external resistor is used to set the desired constant (or maximum) current. The IC automatically disconnects the voltage when the current exceeds the programmed value and reapplies it when it drops below some threshold.
The DRV8871 is rated at 45 VDC, 3.6 amps maximum. It contains an internal over-temperature sensing circuit that disconnects the voltage when the junction temperature reaches 175 degrees C. The IC is available only in an 8 pin HSOP package which has a thermal pad on the bottom side. TI sells a development board that contains one IC (two are required for one step motor), but it is very expensive. Adafruit and others sell a small prototyping board (Adafruit #3190). For test, two of these were mounted outboard of an Adafruit Motorshield as shown in the first photo above.
The current drive capabilities of both the TB6612 and DRV8871 are in practice limited by the temperature rise inside the parts. This will depend on the heat sinking of the parts as well as the ambient temperature. In my room temperature tests, the DRV8871 daughter boards (Adafruit #3190) reached their over temperature limits in about 30 seconds at 2 amps, and the step motors become very erratic (single phasing intermittently as the over temperature circuit cut in and out). Using the DRV8871’s as daughterboards is a kludge anyway, so a new shield was designed (AutoShade #100105) which contains four of the drivers in order to operate two step motors. This board was designed with a large amount of ground plane on both sides to heat sink the ICs. It uses the same serial interface to the Arduino as the Adafruit Motorshield, so the same library software can be used for the drivers. The second photo above shows this circuit board. For more information on the AutoShade #100105, see the listing on Amazon or the AutoShade.mx website.
In my shade screen application, it takes 15 to 30 seconds to raise or lower each shade depending on the speed setting and the shade distance. The current should therefore be limited such that the over-temperature limit is never reached during operation. The time to reach the over-temperature limits on the 100105 is greater than 6 minutes with a 1.6 amp current limit and greater than 1 minute with a 2.0 amp current limit.
Step 4: Select Candidate Step Motors
Circuit Specialists has two size 23 step motors that provide the 8 kg-cm of torque required. Both have two phase windings with center taps so they can be connected such that either the full windings or half windings are driven. The specifications for these motors are listed in the two tables above. Both motors are nearly identical mechanically, but electrically the 104 motor has a much lower resistance and inductance than the 207 motor. By the way, the electrical specifications are for half coil excitation. When the entire winding is used, the resistance doubles and the inductance increases by a factor of 4.
Step 5: Measure Torque Vs Speed of Candidates
Using the dynamometer (and the simulation) the torque vs speed curves for a number of motor/winding/current drive configurations was determined. The program (sketch) used for running the dynamometer for these tests can be downloaded from the AutoShade.mx website.
Step 6: Constant Voltage Drive of 57BYGH207 Half Coil at Rated Current
The 57BYGH207 motor with half coil driven at 12V (constant voltage mode) results in 0.4 amps and was the original drive configuration. This motor can be driven directly from the Adafruit #1434 Motorshield. The above figure shows the simulated and measured torque speed characteristics along with the worst case friction. This design falls far below the desired torque required for operation at 200 to 400 steps per second.
Step 7: Constant Current Drive of 57BYGH207 Half Coil at Rated Current
Doubling the applied voltage but using the chopper drive to limit the current to 0.4 amps improves the performance significantly as shown above. Increasing the applied voltage further would improve the performance even more. But operation above 12 VDC is undesirable for several reasons.
· The DRV8871 is voltage limited to 45 VDC
· Higher voltage wall mount power supplies are not so common and are more expensive
· The voltage regulators used to supply the 5 VDC power for the logic circuitry used in the Arduino design are limited to 15 VDC max. So operating the motors at voltages higher than this would require two power supplies.
Step 8: Constant Current Drive of 57BYGH207 Full Coil at Rated Current
This was looked at with the simulation but not tested because I did not have a 48 V power supply. The torque at low speeds doubles when the full coil is driven at the rated current, but then falls off more rapidly with speed.
Step 9: Constant Current Drive of 57BYGH104 Full Coil at ½ Rated Current
With 12 VDC and a current of 1.0A, the torque-speed characteristic shown above results. The test results meet the requirements for operation at 400 steps per second.
Step 10: Constant Current Drive of 57BYGH104 Full Coil at 3/4 Rated Current
Increasing the winding currents to 1.6 amps increases the torque margin significantly.
Step 11: Constant Current Drive of 57BYGH104 Full Coil at Rated Current
If the winding currents are increased to 2A, and the torque increases as shown above, but not as much as the simulation would predict. So something is happening in reality that is limiting the torque at these higher currents.
Step 12: Making the Final Selection
Utilizing the full coil rather than half is definitely better but is not desirable with the 207 motor because of the higher voltage required. The 104 motor allows operation at lower applied voltage. This motor is therefore selected.
The full coil resistance of the 57BYGH104 motor is 2.2 ohms. The resistance of the driver FETS in the DRV8871 is about 0.6 ohms. Typical wiring resistance to and from the motors is about 1 ohm. So the power dissipated in one motor circuit is the winding current squared times 3.8 ohms. Total power is twice this since both windings are driven at the same time. For the winding currents considered above, the results are shown in this Table.
Limiting the motor currents to 1.6 amps allows us to use a smaller and less expensive 24 watt power supply. Very little torque margin is lost. Also, step motors are not quiet devices. Driving them at a higher current makes them louder. So in the interests of lower power and quieter operation, the current limit was chosen to be 1.6 amps.