Demanding Stepper Motor Applications

Table of contents

Demanding Stepper Motor Applications

Abstract

This project addresses the "Start a Movement" theme by incorporating the Analog Devices stepper motor kit in two applications where stepper motors require precise control. These applications are a connector tester and a thread tapping machine.

image

Intro

My main objective for this design challenge was to have fun designing and building some cool machines. Of course there are more detailed practical objectives as well, such as:

  • Explore and highlight some applications that can take advantage of the comprehensive and accurate control provided by the Analog Devices TMC5272-EVAL-Kit.
  • Develop useful subsystems that can be reused in future projects.
  • Ensure the project stays true to the "Start a Movement" theme of the design challenge.
  • Incorporate some creative electronic, software and mechanical design elements in the project.
  • Choose interesting topics that members might enjoy reading about.

To address all these objectives I included two applications:

  1. The first application is a connector and cable tester system that can perform cycle testing on connectors to determine their wear characteristics. This requires mechanically connecting and disconnecting connectors repeatedly and accurately until failures start to occur. Electronic testing for short circuits and open circuits is performed on every cycle to track connector performance. This application can also be used to test cable integrity. While this is an interesting and demanding application for a stepper motor, its primary use would be in a commercial context where testing durability and integrity are important. However it nicely ticks all the objectives boxes while adding some attractive displays to the blogging side of the project..

  2. The second application is a thread tapping machine. This machine requires two stepper motors since the forward motion must be accurately synchronized to the rotary motion. This type of machine may have lots of commercial applications, but I can also use it for my hobby projects to save lots of tedious thread tapping activity.

  image

System Design and Build

This section will present selected parts of the design and build process. There are 5 other blogs linked below for those that want more detail on how the system progressed and came together.

The Connector Tester

The connector tester is based on a custom PCB that has 16 channels where each channel has corresponding red, yellow and green LEDs plus 2 external connector pins. When a channel's 2 pins are connected, its green LED is on, the yellow LED for each channel indicates that the channel is being interrogated for shorts and open circuits. The red LED indicates that the channel is open circuit during the interrogation.

An Arduino Mega is used to cycle through all the channels, displaying the cycle count and number of faults found on a 20 x 4 character LCD.

This video shows all the electronic hardware and software working but not packaged:

 

Schematic

This is the schematic for the custom 16 channel connector tester PCB:

image

Firmware

This is the firmware that runs on the Arduino Mega:

// Connector Tester Program
// Doug Wong
// 2024
// 16 pin connector and cable tester program for an Arduino Mega
// 

 #include <Wire.h>
 #include <LiquidCrystal_I2C.h>
 LiquidCrystal_I2C lcd(0x27,  20, 4);

int pinI[16] = {53, 51, 49, 47, 45, 43, 41, 39, 37, 35, 33, 31, 29, 27, 25, 23};
int pinO[16] = {52, 50, 48, 46, 44, 42, 40, 38, 36, 34, 32, 30, 28, 26, 24, 22};

int cycles;
int faults;
int trigger, oldtrigger;
int triggerpin = 1;

void setup() {
  lcd.begin();
  lcd.clear();
  lcd.print("     element14");
  lcd.setCursor(0, 1);
  lcd.print("  Start A Movement");
  lcd.setCursor(0, 2);
  lcd.print("Cycles 0");
  lcd.setCursor(0, 3);
  lcd.print("Faults 0");

  pinMode(triggerpin, INPUT);	//configure trigger pin
  
  for (int i = 0; i < 16; i++) {	//configure digital pins
   pinMode(pinI[i], INPUT);
   pinMode(pinO[i], OUTPUT);
  }
  trigger = digitalRead (triggerpin);
  oldtrigger = trigger;
}

void loop() {
  trigger = digitalRead (triggerpin);
  if (trigger != oldtrigger){           //trigger pin has changed state
    oldtrigger = trigger;
    delay (100);
    if (trigger == 1){                  //trigger detected
      cycles++;
      for (int j = 0; j < 16; j++){     //enable 16 outputs
       digitalWrite (pinO[j], HIGH);
      }
      for (int n = 0; n < 16; n++){     //read 16 inputs to determine state of each
        if (digitalRead(pinI[n]) == 1){
          faults++;                     //if a fault is detected increment the fault counter
        }
      }
      delay(100);
      lcd.setCursor(7, 2);
      lcd.print(cycles);
      lcd.setCursor(7, 3);
      lcd.print(faults);
      delay(400);
      for (int k = 0; k < 16; k++){     //disable 16 output pins
        digitalWrite (pinO[k], LOW);
      }
    }
  }
}

Connector Tester Plastic Parts Design

Connecter Tester Demo

The Analog Devices TMCL-IDE provides very comprehensive control of stepper motors and I can set it up to automatically run the connector tester repetitive cycles. It even provides dynamically adjusting acceleration profiles so that the correct torque gets applied to prevent skipping any steps of the motor due to inadequate torque. Unfortunately, I did something to limit torque and I have not yet figured out what, but I will keep trying.

Thread Tapping Machine

The thread tapping machine uses 2 stepper motors that are precisely synchronized so that the tap screws into a hole without applying any axial force to the threads. The TMC5272-EVAL-KIT conveniently provides two stepper motor channels and the TMCL-IDE allows both to be independently and precisely controlled at the same time. The tapping machine basically consists of a rotary actuator, turning the tap, mounted on a linear actuator which drives the rotary actuator forward.

Linear Actuator

This video shows the design and construction of the linear actuator stage:

I did figure out how to use the IDE to update the firmware - it is right in one of the menus. I also figured out the how to set the IDE up to proved any desired motion. The issue was that the parameters do not have defaults (of course) so I needed to set up a bunch of motion parameters.

Rotary Actuator

This video shows the rotary actuator chassis mechanical design:

This video shows the design and build of the rotary actuator:

Thread Tapping Demo

It is not the fastest tapping process, but the slow speed allows the plastic to stay cool enough to avoid melting.

This video shows both rotary and linear motion at the same time:

Full System Demo of Both Connector Tester and Thread Tapping Machines

Discussion

This project demonstrated a couple of interesting applications of stepper motors that require sophisticated control, which is exactly what the Analog Devices TMC5272 system provides.

I enjoy design work and always try to include electronics, software and mechanical design aspects in my projects. I especially like to include a PCB that I designed in each project. In this case the connector tester PCB is one I designed some time ago, but never fully assembled it until now and likewise the Arduino Mega and its firmware are all new aspects of the connector tester system. I am glad that the electronics displays could add some visual interest to the blogs.

Both of the systems developed for this project require precise mechanical tolerances and robust mechanical structures. These types of tolerance typically would require a proper machine shop to achieve, but I was able to coax my 3D printer into making structures that were up to the task. I really like that the machines look quite industrial and robust. The mechanical structures really went together with remarkably little fiddling around. Even the electronics mounting brackets and housings worked extremely well.

There were some compromises along the way of course. Machines like this can be quite expensive and I needed to make do with a cheap electric screwdriver gearbox even though it didn't have an ideal gear ratio.

Also the linear travel was quite limited, but it was perfectly adequate for these applications. The limit was partly imposed by the size of my 3D printer - the main chassis is right at the limit of what it can print. The size limit was also driven by a desire to comfortably fit the apparatus into a video frame with enough resolution to see what was going on. 

The TMCL-IDE and the TMC5272-EVAL-KIT provided an amazing level of control over stepper motor parameters and performance. The ability to specify complex dynamic acceleration profiles and features like Stall Guard plus microstepping control allow stepper motor performance to be optimized. I'm sure that exposure to these products will increase the number of projects I do involving stepper motors. There is enough complexity in these products that I am far from mastering it yet, but I now have tools to continue the learning curve.

This project involved lots of blogs and video work which provided opportunities to experiment with new techniques to make the material a bit less dry with new intros and background music.

There was one major frustration when I lost the ability to set stepper motor current, but my main objective of having fun designing systems was met. I couldn't be happier about how well everything I designed worked and looked. Projects of this complexity never go entirely as planned, but working though adversity can be immensely satisfying in itself. Thankfully I got back to decent torque levels on the last day and have been able to demonstrate both systems fully working.

I expect some of the subsystems and design work from this project will be useful in future projects: Things like the LCD display housings, the GoPro mounts, the linear actuator, the connector tester PCB are all likely to be helpful in future projects.

Finally I would like to thank element14 and Analog Devices for sponsoring this design challenge and selecting me to participate. This kind of activity enriches us all.

Links

Category : project