Sunday, 8 September 2013

Bipolar Stepper Motor Driver Circuit with LMD18245

Bipolar Stepper Motor Driver Circuit with LMD18245

Introduction

For some time I have been planning to build a number of devices that make use of stepper motors. Since I have no experience in using stepper motors I had no idea what parts, what driver and controller circuits I would need to get them running.

After extensive research  on the internet I decided to make a bipolar stepper motor driver based on Texas Instuments' LMD18245, which is a 3A, 55V DMOS Full-Bridge Motor Driver. It incorporates all the circuit blocks required to drive and control current in a bipolar stepper motor.

This integrated circuit is a bit more involved to program (although surprisingly simple compared to what it delivers) but comes with many extra features (for free), such as overcurrent protection and thermal shutdown.

Creating a test board for the LMD18245


The only drawback of the LMD18245 is that it comes in a 15-pin TO-220 package which is not breadboard-friendly. To overcome this problem I designed a small breakout board for the chip:
Creating a test board Dynamic-Electronics
It has footprint for all the parts needed for normal operation or experimenting with the LMD18245. It also has a 15 pin header to allow easy access to each pin of the chip.

A little detour to using someone else's custom part  - I don't want you to make the same mistake as I did!

I designed the circuit and PCB in Eagle. Eagle doesn't come with the part for the LMD18245, but a quick search on Eagle's web site made me happy with a part someone had made available as a free download. As usual, after downloading it I double checked the footprint used against the datasheet and found it correct, so I started designing the circuit with it. I even printed the PCB artwork on paper (as usual) to check it against the actual parts I would use to populate the PCB with. Everything checked out, so I sent the gerber files for production.
circuit and PCB Dynamic-Electronics
                                                        Front of finished PCB
LMD18245 Dynamic-Electronics
                                                               Back of finished PCB
After a few weeks I was happy to receive the ready boards and I started assembling two of them (two LMD18245s are required to drive one bipolar stepper motor). Soon I realized that, although the footprint of the LMD18245 were correct, the holes for the LMD18245 were too small. That means all the holes had to be enlarged. Luckily, I have a small drill and drill bits as small as 0.3mm diameter, so I picked a 0.8mm one and widened the holes as can be seen in the images below.
 corrected PCB Dynamic-Electronics
Front of corrected PCB
 corrected PCB Dynamic-Electronics
                                    
                                                               Back of corrected PCB
Lesson learnt: NEVER trust a custom part unless you fully check ALL its properties!

and now, back to the project...
NEMA 23 stepper motor Dynamic-Electronics

Test application

To test the breakout boards I created a simple circuit around a PIC18f4550. Since the circuit is very simple, I didn't create schematics for it. I used PORTD[0..7] to control the M1..M4 lines of the 2 LMD18245, and used PORTA[0..1] to control the two direction lines. I also have 8 LEDs on the test board to show me what lines (PORTD[0..7]) are active. The circuit works just fine without them as well.

This is the full setup:
NEMA 23 stepper motor Dynamic-Electronics
The rubber band on the motor is placed there to prevent damage to my desk in case it resonates much. In practice, it's hardly noticeable.

Building blocks of my test rig:

  • NEMA 23 stepper motor (left)
  • PIC18F4550 (center)
  • ICSP connector (above the PIC) - it's a 6 pin RJ45 connector.
  • 2 LMD18245 breakout boards (lower left)
  • 8 debug LEDs (top right) - optional
LMD18245 needs heatsinks Dynamic-Electronics
Test run
I powered the motors with a 12V ATX power supply as that's all I have available at the moment. I understand if I used higher voltage (up to 55V) The motor could run faster, but I cannot test this right now.

For any real life application the LMD18245 needs heatsinks. In the test rig, however, I observed that as long as the axis is in continuous movement there is no heat dissipation almost at all. Even after hours of running the chips are all at room temperature. When I slow down movement, i.e. making small breaks in between steps, the chips start heating up.

The alligator clip on the axis of the motor serves only one purpose: makes motor movement visible. :)

A few test videos in different setups, all full stepping mode:

Step by step
In this video you can observe each step individually, with a bit of pause in between steps.

Continuous movement in one direction

Friday, 6 September 2013

Make a WiFi Weather Station With Arduino and Adafruit’s CC3000


Make a WiFi Weather Station With Arduino and Adafruit’s CC3000 Dynamic-Electronics



As open-source hardware users and makers, we love playing with new chips, boards and tools. And there is one chip which is quite popular these days: the CC3000 WiFi chip from TI. This chip comes with many promises: cheap (around $10), easy to use, low-power … It was featured in many articles around the web, but somehow it was quite hard to use with Arduino as there was no breakout board or library available. Luckily, Adafruit solved that for us with a nice breakout board and a working library for Arduino. In this article, I will show you how to use this chip for home automation purposes. Remember that weather station project? We are going to do the same: measure the temperature and the humidity. But this time we won’t display the information on an LCD screen. Instead, we will transmit the data wirelessly via WiFi to your computer and display it there. Excited ? Let’s get started!

Maretron advanced NMEA 2000 monitoring via cell texts Evrything:-


Maretron advanced NMEA 2000 monitoring via cell texts Dynamic-Electronics
Add caption


Two recent experiences make me particularly excited about the Maretron SMS100 announced today (and already shipping). During the trip north I learned to appreciate the sophisticated "Alert" features built into Maretron's various NMEA 2000 displays and I also enjoyed some benefits of the Siren Marine cellular monitoring system. In fact, Gizmo's refrigerator currently contains two temperature sensors, a Maretron probe for on board monitoring and a Siren probe so I can keep an eye on the system from afar (even from Korea, by gosh). While the standalone and economical Siren system will definitely remain appropriate for some boats (and Maretron probably has an SMS learning curve to climb), I'm really looking forward to having virtually unlimited N2K monitoring on my phone...
So let's take a look at what Maretron terms Alerts because they are usefully sub-categorized into Alarms and Warnings. An alert can be created for any value in the system based on data "trigger" conditions such as High, Low, Inside/Outside Radius, On/Off State, Direction and Time. An alarm based on a predetermined time from an N2K source like a GPS might otherwise be known as an alarm clock ;-)


Maretron advanced NMEA 2000 monitoring via cell texts Dynamic-Electronics

There are also a few special triggers like GPS Quality and the Anchor Watch alert that pairs with the DSM250 screen above (which is also available on the 250's much less expensive little brother, the DSM150). There are arguably better anchor alarms -- like the Vesper WatchMate AIS with its plotting feature or the Boat Monitor app that let's you input the bearing and distance to your actual hook instead of creating a radius around where the boat first settles -- but I've gotten very fond of Maretron's. Probably the main reason is that Gizmo now has an ALM100 Alarm Module mounted on the main panel near my berth and that sucker can bring me up from the deepest sleep. - 

Maretron advanced NMEA 2000 monitoring via cell texts Dynamic-Electronics
Besides blasting an audible alarm or warning (if I want), Maretron alerts also flash on whatever DSM screen is active, as shown above left. A tap on the enter button takes you to the screen above right, where you can quickly mute the sound and where you'll also see some of the sophistication underlying the whole Alerts feature. The Description and Location, for instance, are fully customizable fields that carry themselves throughout the system, including the SMS100 text messages -
Maretron advanced NMEA 2000 monitoring via cell texts Dynamic-Electronics

I used the DSM250 emulator that is part of the free N2KAnalyzer program to make the screens above illustrating the Alert creation process (clockwise from top left). Note how they have a priority value so that if more than one is active, the right one shows on screen and the ALM100 makes its particular sound (from a choice of six). Note too how the whole Alerts system has four modes (including disabled) so, for instance, it's easy to arm Gizmo's navigation light low current and block temperature alarms by simply setting the mode to underway. A user can also specify which Annuciators respond to a specific alert, so I can keep my middle of the night anchor watch to myself instead having the fly bridge ALM100 also go off.

Maretron advanced NMEA 2000 monitoring via cell texts Dynamic-Electronics
But probably the hardest parameters to get one's head around are the Re-trigger, Set, and Clear time periods. The former is simply an anti-distraction setting as it just re-fires an already Accepted alert if the condition remains the same for a certain period of time (leaving it at 0 leaves it off). Meanwhile the above diagram -- found, like many of these screens, in the DSM250 manual you can download here -- neatly illustrates the use of Set and Clear delays. The values are sort of like dampening on instruments and they are also more ways that Maretron lets you hone alerts until they work exactly as they should. In my experience boat alarms that go off too often when they're not really needed get turned off permanently
Maretron advanced NMEA 2000 monitoring via cell texts Dynamic-Electronics

As for the SMS100 itself, it's certainly neat that it has a display because of its DSM association. That screen above, for instance, shows not only signal strength but also recent incoming texts so you can easily test both outgoing and incoming transmission. And I like the sound of a six frequency band modem supporting 2G GSM/GPRS/EDGE and 3G UMTS/HSDPA/HSUPA protocols because that covers so much of the cellular soup. But I wonder if Maretron's plan to have users or installers provide their own SIM cards will cause difficulties. It makes sense on a global basis, but then again I know that Siren Marine has done a lot of trouble shooting to make their SIM cards mostly trouble free.
   The SMS100's ability to process text commands is also paltry compared to the Siren. As shipped users will only be able to text it a "Status" message and they will only get back the info seen below. However, Maretron tells me that eventually we'll be able to design custom commands on a DSM that will not only call forth any info on the system but also permit actual control commands like DCR100 digital switching via phone. I've always fancied the idea of turning on boat lights before taking the tender out into a dark anchorage, but I've resisted having to install single purpose gadgetry to do it. Looks like I won't have to.  What can you imagine doing with Maretron's powerful system? -
Maretron advanced NMEA 2000 monitoring via cell texts Dynamic-Electronics

Thursday, 5 September 2013

Self-contained Wi-Fi module simplifies Internet Eveything

Texas Instruments Incorporated is offering developers a solution to the challenges posed by the Internet of Things (IoT) revolution with the company’s introduction of the SimpleLink Wi-Fi CC3000 module.
The IoT enables devices to be wirelessly connected to the home network and to the cloud. However, headless devices with no keypads or touchscreens including garage door openers, home appliances, lights, thermostats and treadmills can be complicated to connect to a Wi-Fi network.
The self-contained SimpleLink Wi-Fi CC3000 module features the SmartConfig technology, a Wi-Fi configuration process developed by TI that allows multiple in-home devices without displays to connect to a Wi-Fi network via a smartphone or tablet - in just one easy step. To see how simple SmartConfig technology is, watch the video here:
The CC3000 module now also supports service discovery applications on phones, tablets and PCs using Bonjour zero-configuration networking technology, making it easier for consumers to quickly identify and manage networked devices. The SimpleLink Wi-Fi CC3000 module is compatible with low-cost, low-memory microcontroller (MCU) systems, such as TI’s MSP430 family.
“The need to easily connect display-less devices to the wireless network has become a barrier to wide deployment of connected-home products,” said Gil Reiter, marketing director, Wireless Connectivity Solutions, TI. “With TI’s SmartConfig technology, ODMs can reduce the complexity of consumers’ in-home provisioning through a simple Wi-Fi setup application for smartphones or tablets that gets a SimpleLink Wi-Fi CC3000-enabled device on the network with just one click. Once devices are connected, the consumer’s experience gets even better with intuitive service discovery capabilities that allow for easy device control and monitoring.”
Availability and Pricing
SimpleLink Wi-Fi CC3000 pre-production modules are sampling now. Production modules will be available in 1Q 2013 through TI authorized distributors for $9.99 in 1,000-unit quantities. The SmartConfig technology iOS app is available now on the App Store. The SmartConfig technology app will be available for Android in 1Q 2013.
Find more datasheets on products like this one at Datasheets.com, searchable by category, part #, description, manufacturer, and more.
Don't miss out on the latest products.  Subscribe to EDN's weekly Products & Tools newsletter (free registration) for the latest product announcements and news.
This article originally appeared on EE Times Europe.

High-voltage seven segment LED display driver: Everything

High-voltage seven segment LED display driver: Dynamic-Electronics

Seven segment LED displays are known to be resource and power hungry. But because they are visually so charming and readable from a far viewing distance and at a much wider viewing angle as compared to any other electronic displays, they are still hugely popular. The required number of I/O pins to drive the LED segments can be reduced significantly by using an additional dedicated hardware. For example, the MAXIM’s MAX7219 device allows you to interface 8 pieces of seven segment LED modules using only 3 I/O pins of Arduino or any other microcontroller. You can find details on the use of MAX7219 to drive seven segment LED displays in my previous projects 4-digit serial seven segment LED display (SPI7SEGDISP4.40-1R), 8-digit serial seven segment LED display (SPI7SEGDISP8.56-1R), and double-row 4-digit seven segment LED display (SPI7SEGDISP8.56-2R).