Stepper Motor Help

Go To Last Post
14 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm working on my first stepper motor project.  Things have gone well so far!  I am using Mega48A on the front end that is sending step pulses to an STMicroelectronics L6206N dual full bridge driver.

 

The stepper motors I am trying to control are spinning metering pumps.  I can get the pumps to pump water and to spin dry with no problems at pretty decent speeds.  However, one of the materials I need to pump is a little thicker and it causes the motor to stall at fairly low speeds (153RPM is the max I can pump without skipping steps).  My goal for this project to be successful is to pump at 300RPM.

 

The stepper motors I am using are 23KM-K035-24 rated at 2.6v and 2.3a.  They are 1.8 degree step motors so at 153rpm I am at 5,100 pps.  I started this project running at 24vdc with current limited to 2.3A through the L6206N.  I played around with increasing current with little benefit and then I increased voltage to 48VDC and actually saw performance decrease by about half. 

 

Does anyone have any recommendations?

Thank you,

Kevin

 

 

--------------------------------
Kevin Pierson

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Does anyone have any recommendations?

Well, you are pretty far along but for our production apps we applied Allegro stepper drivers.  The "pros" there know how to do current-chopping and the like.

 

The second comment also may not apply if pretty far along--if you are on a quest for high RPM, why was a 200 step/rev motor chosen?

 

It's been awhile--I forget whether higher torque comes from a 4-step or 8-step excitation sequence. 

 

Are you trying to go from stopped directly to full-whooppee speed?  If so, that may be your problem--you need to ramp up and down on step rate.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The pumps and stepper motor came as a package.  The manufacturer claimed I would be able to hit my goal of 300rpm with the viscosity I am working with.  I have been in contact with them but they have not been much help.  This, most likely, is because I designed my own motor controller instead of buying 2 of their $600 controllers! 

I am controlling accel/decel with the Atmel.  I am using a 4 step sequence.

It's never too late to start completely over IF that is what fixes the problem!  One issue I did run in to though was finding drivers that would handle 2.3A.  I'll check out the Allegro drivers and see if anything fits my needs!

--------------------------------
Kevin Pierson

Last Edited: Mon. Nov 17, 2014 - 09:56 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Any chance you could say to the manufacturer... "Prove that your controller can work at 300RPM in this application"...

 

Ross McKenzie, Melbourne Australia

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

How are you accelerating your steppers?

You're probably accelerating too fast

The good steppers uses a sine acceleration ramp.

but a linear acceleration works ok too.

 

Once you skip a step all hope is lost. you have to stop and restart

Keith Vasilakes

Firmware engineer

Minnesota

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

kpierson wrote:

 They are 1.8 degree step motors so at 153rpm I am at 5,100 pps.

 

1.8 degree step motors -> 200 pulses per rev

153 rpm -> 2.55 rps

200 * 2.55 = 510 pps

 

I hope your 5,100 pps was a typo.

 

At 300 rpm, you need 1000 pps.

Last Edited: Tue. Nov 18, 2014 - 12:31 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

When pumping water or running it dry I have no problems getting it to 400 rpm.  If acceleration is an issue would it be magnified by the viscous liquid?

 

As far as my acceleration control goes I have a 10 bit register set up for speed control.  The controller increases the speed by "1" every two steps.

 

As far as asking the mfr to show me it working I actually have one of their $600 controllers that I was able to buy on Ebay for about $100.  I am getting very close to swapping my controller out for theirs but I was hoping there would be a simple, quick fix.

Does anyone have any ideas why I would lose torque after doubling the voltage?  From everything I have seen and read the torque performance, especially at lower speeds, should improve.

--------------------------------
Kevin Pierson

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

you are correct, sorry about that.  I must have added a 0 to the calculation!  I wanted to make sure I had the PPS listed and didn't even stop to think if the number I posted made sense (which it doesn't).

--------------------------------
Kevin Pierson

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It has been over a decade ago, and I don't remember where I got the "high torque" driving sequence.  I remember that it indeed worked.  The app used Allegro A3966.

 

Below is the stepping ISR, FWIW.  Perhaps try the hi-torque?

 

// **************************************************************************
//	"C" version using switch()
// **************************************************************************
//	~25us., first version.
//
// **************************************************************************
// *
// *		T I M E R 1 _ C O M P _ I S R
// *
// **************************************************************************
//
// Timer 1 output compare A interrupt service routine
//
// This ISR takes care of setting the stepper motor signals.
//	The trigger rate is controled by the command (pot, command input, RS485, etc.)
//	Global register variables "reg_" are used extensively, and hold values
//	for next iteration.
//
//	Initial coding is as a switch statement.  Depending on timing and system
//	load requirements, it may need to be re-coded as a computed goto, with
//	only necessary register saving.
//
//	Take a step in the programmed direction.  Index based on direction for next time.
//
//
#define	ENABLE_ON	0
#define	ENABLE_OFF	1

interrupt [TIM1_COMPA] void timer1_compa_isr(void)
{
// Set new speed
	OCR1A = the_speed;

// Calculate which path to take
	reg_scratch = reg_base + reg_offset;	// table + desired step

	switch (reg_scratch)
		{
		// Note: if ENx is ENABLE_OFF, the corresponding PHx is "don't care".
//
//	Full Step
//
		case STEP_TABLE_FULL + 0:
			STEP_EN1 = ENABLE_ON;
			STEP_PH1 = 1;
			STEP_EN2 = ENABLE_OFF;
			STEP_PH2 = 1;
			reg_offset += reg_dir;	// index to next step
			reg_offset &= 3;		// 4 steps in this table
			break;
		case STEP_TABLE_FULL + 1:
			STEP_EN1 = ENABLE_OFF;
			STEP_PH1 = 1;
			STEP_EN2 = ENABLE_ON;
			STEP_PH2 = 1;
			reg_offset += reg_dir;	// index to next step
			reg_offset &= 3;		// 4 steps in this table
			break;
		case STEP_TABLE_FULL + 2:
			STEP_EN1 = ENABLE_ON;
			STEP_PH1 = 0;
			STEP_EN2 = ENABLE_OFF;
			STEP_PH2 = 0;
			reg_offset += reg_dir;	// index to next step
			reg_offset &= 3;		// 4 steps in this table
			break;
		case STEP_TABLE_FULL + 3:
			STEP_EN1 = ENABLE_OFF;
			STEP_PH1 = 1;
			STEP_EN2 = ENABLE_ON;
			STEP_PH2 = 0;
			reg_offset += reg_dir;	// index to next step
			reg_offset &= 3;		// 4 steps in this table
			break;

//
//	High-Torque Full Step
//
		case STEP_TABLE_HITORQUE + 0:
			STEP_EN1 = ENABLE_ON;
			STEP_PH1 = 1;
			STEP_EN2 = ENABLE_ON;
			STEP_PH2 = 1;
			reg_offset += reg_dir;	// index to next step
			reg_offset &= 3;		// 4 steps in this table
			break;
		case STEP_TABLE_HITORQUE + 1:
			STEP_EN1 = ENABLE_ON;
			STEP_PH1 = 0;
			STEP_EN2 = ENABLE_ON;
			STEP_PH2 = 1;
			reg_offset += reg_dir;	// index to next step
			reg_offset &= 3;		// 4 steps in this table
			break;
		case STEP_TABLE_HITORQUE + 2:
			STEP_EN1 = ENABLE_ON;
			STEP_PH1 = 0;
			STEP_EN2 = ENABLE_ON;
			STEP_PH2 = 0;
			reg_offset += reg_dir;	// index to next step
			reg_offset &= 3;		// 4 steps in this table
			break;
		case STEP_TABLE_HITORQUE + 3:
			STEP_EN1 = ENABLE_ON;
			STEP_PH1 = 1;
			STEP_EN2 = ENABLE_ON;
			STEP_PH2 = 0;
			reg_offset += reg_dir;	// index to next step
			reg_offset &= 3;		// 4 steps in this table
			break;

//
//	Half Step
//
		case STEP_TABLE_HALF + 0:
			STEP_EN1 = ENABLE_ON;
			STEP_PH1 = 1;
			STEP_EN2 = ENABLE_OFF;
			STEP_PH2 = 0;
			reg_offset += reg_dir;	// index to next step
			reg_offset &= 7;		// 8 steps in this table
			break;
		case STEP_TABLE_HALF + 1:
			STEP_EN1 = ENABLE_ON;
			STEP_PH1 = 1;
			STEP_EN2 = ENABLE_ON;
			STEP_PH2 = 1;
			reg_offset += reg_dir;	// index to next step
			reg_offset &= 7;		// 8 steps in this table
			break;
		case STEP_TABLE_HALF + 2:
			STEP_EN1 = ENABLE_OFF;
			STEP_PH1 = 1;
			STEP_EN2 = ENABLE_ON;
			STEP_PH2 = 1;
			reg_offset += reg_dir;	// index to next step
			reg_offset &= 7;		// 8 steps in this table
			break;
		case STEP_TABLE_HALF + 3:
			STEP_EN1 = ENABLE_ON;
			STEP_PH1 = 0;
			STEP_EN2 = ENABLE_ON;
			STEP_PH2 = 1;
			reg_offset += reg_dir;	// index to next step
			reg_offset &= 7;		// 8 steps in this table
			break;
		case STEP_TABLE_HALF + 4:
			STEP_EN1 = ENABLE_ON;
			STEP_PH1 = 0;
			STEP_EN2 = ENABLE_OFF;
			STEP_PH2 = 1;
			reg_offset += reg_dir;	// index to next step
			reg_offset &= 7;		// 8 steps in this table
			break;
		case STEP_TABLE_HALF + 5:
			STEP_EN1 = ENABLE_ON;
			STEP_PH1 = 0;
			STEP_EN2 = ENABLE_ON;
			STEP_PH2 = 0;
			reg_offset += reg_dir;	// index to next step
			reg_offset &= 7;		// 8 steps in this table
			break;
		case STEP_TABLE_HALF + 6:
			STEP_EN1 = ENABLE_OFF;
			STEP_PH1 = 0;
			STEP_EN2 = ENABLE_ON;
			STEP_PH2 = 0;
			reg_offset += reg_dir;	// index to next step
			reg_offset &= 7;		// 8 steps in this table
			break;
		case STEP_TABLE_HALF + 7:
			STEP_EN1 = ENABLE_ON;
			STEP_PH1 = 1;
			STEP_EN2 = ENABLE_ON;
			STEP_PH2 = 0;
			reg_offset += reg_dir;	// index to next step
			reg_offset &= 7;		// 8 steps in this table
			break;

		default:
			// Release the stepper motor to free-wheel
			STEP_EN1 = ENABLE_OFF;
//			STEP_PH1 = 1;
			STEP_EN2 = ENABLE_OFF;
//			STEP_PH2 = 1;
			break;
		}
}

 

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In the Old Days, steppers were driven from a hi voltage thru a Big R that limited the current but got Real Hot. I think the idea was the hi volts got the current flowing, and as the mag field built up, the current dropped to the steady state value?

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I cannot find an exact datasheet for 23KM-K035-24.  But notice that for very similar models, once you get over about 1000 pps the torque drops dramatically.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

kpierson:

 

Is there any chance you have chosen a pwm freq that is to high for the l/r time constant of the steppers? The current may not be reaching the level required to produce the torque you need for the more viscous liquid.

 

When all else fails, buy a Geckodrive. They are bullet proof and inexpensive.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

RickB wrote:

kpierson:

 

Is there any chance you have chosen a pwm freq that is to high for the l/r time constant of the steppers? The current may not be reaching the level required to produce the torque you need for the more viscous liquid.

 

When all else fails, buy a Geckodrive. They are bullet proof and inexpensive.

 

This comment got me thinking and I looked back at the datasheet at some of the timing calculations.  I used all "recommended" values and the recommended value for the over current fault timer is around 200us.  This, is quite a bit of time at 1000pps.  I modified the resistor value that controls this time to take it down to closer to 30us and immediately saw a huge increase in torque!  I am still not to 300ml/min yet but I did run a short 20ml burst at 276ml/min!  I am running in to substantial heat issues now, but that was to be expected as I am using the through hole package for prototyping and I've got it socketed so my heat distribution is terrible. 

I'm pretty confident that by tweaking the current and the timeout value I'll reliably get to 300ml/min!

--------------------------------
Kevin Pierson

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am not talking about the overcurrent protection or the step frequency. Are you not controlling the motor current with pwm using current sense resistors for the motors? If not, how? What ps voltage are you using for the above test. What is the motor inductance and resistance?

 

The overcurrent protection is used in case of a stalled motor or output short to gnd. Something does not make sense here.

 

Edit:

 

After reading the L6206 data sheet again and reading the L6207 data sheet, it becomes a bit more clear. The 6206 does not use the ext sense resistors, but instead relies on the built in sense element in the fets. That appears to make the calculations a bit more interconnected. The 6207 has the built in comparator to sense the motor current and shut off the drive when the set current is reached. (the 6206 requires an ext. comparator) This independence from the overcurrent sensing makes troubleshooting easier.

 

The interplay of the components that set the ocd and motor current appear to be what determines the chopping frequency, and this must be low enough to allow the on time to be long enough to to overcome the motor l/r time constant. It might be easier to do with the L6207.

 

Rick

Last Edited: Wed. Nov 19, 2014 - 10:50 PM