Anyone ever use one of these stepper drivers? Ebay 2M542

As the title suggests,

I bought this stepper driver and I'm having a little trouble getting it to move my motor.

The data sheet can be found here:

http://www.hi-end.ro/pdf/motoare/CMP5042.pdf

I tried to run a test movement on it, just get it to spin a little doing this:

byte dir = 1;
	digitalWrite(directionpin,dir);

	while (location <=200) {
		
				
			//step sequence to move up
			digitalWrite(steppin, LOW);
                        delayMicroseconds(100);
			digitalWrite(steppin, HIGH);
			delayMicroseconds(100);
			location++;
	
	}

Am I doing something wrong?

You can't just step from stationary at a high rate - you need to accelerate the motor smoothly to
keep the necessary torque within limits. Try stepping at more like 200Hz rather than 5kHz

You don't mention how you've wired it up, what power supply you use, nor how the stepper
controller jumpers are configured..

Thanks Mark,

Got it working. I was using to thin of gauge wires from the stepper driver to the motor.

I had them covered and I guess one melted to another and they were shorting :astonished: oops.

Switched to thicker wire and problem solved. Also took your advice and slowed things down a bit.

You only need to limit the acceleration - you can still go to 5kHz (or a lot higher), just not instantly as there is
a mass of metal to be spun-up and that can't happen instantaneously (what actually happens
is you miss steps, or the motor get stuck humming rather than turning).

For each motor, driver, supply and mechanical load you can experiment to find the maximum
acceleration that works without miss-stepping, and the same for the rotation speed. Once you
have determined these values, de-rate them by about 10-15% each to ensure reliable stepping.

BTW use microstepping, at least 16x, to get smooth operation.

Can someone please give me some examples of wiring from this driver to Arduino?

gnd to pls- and dir-, then your steppin to pls+ and directionpin to dir+. These inputs are an opto coupler with built-in resistor

I think you also need ena- to gnd and ena+ to 5V to enable it.

thank you.

One more question, you said that those inputs are an optocuplor with built-in resistors. That means that my Arduino board is fully protected, or should I take more precautions? If so, what precautions should I take? Another serial resistor on board pins that are used?

Another series resistor might be a good idea if you were going to swap in other motor controllers, but
for this one the input is already current limited and isolated from the rest of the circuit, should be fine.

Mark, ty very much.

BTW guys, I have a serious problem with this driver. I won't start another topic on this to keep forum clean, but please help. These are the details:

  1. I can't test everyday the driver and the stepper, because they are in a lab where I do not have access. That means I have to get things right without testing.
  2. Board is Arduino Leonardo.
  3. Driver is, as mentioned above, 2M542. http://www.hi-end.ro/pdf/motoare/CMP5042.pdf
  4. Driver settings are (watch the image: http://img2.dib-bid.com/gallery/cnc-motor-driver-2m542_03.jpg ) 1.0 A, 400 steps per revolution, Sw4: off (half-current)
  5. Stepper is a big 1A turning table, 1.8 degree step. That means 200 steps per revolution.
  6. Arduino commands correctly other stepper with other drivers (same code). Driver 2M542 works correctly the turning table, with other input. All wiring is good.
  7. Code for Arduino is here: gist:5656149 · GitHub , but that's beyond of my questions. It's suffice to know that I try to control the stepper with Stepper.h library with this commands: myStepper.step(_steps); delay(500); where myStepper is myStepper(200, 7,8); , 200 means that are 200 steps by revolution. Speed is 60.

Problem:
stepper doesn't make correct number of steps. I give it to make 400 steps, but it doesn't make the full rotation; it turn like less than a quarter or a quarter of revolution. Then I tried to give 1 step, but no motion was detected. I give it 10 steps and the turning table made only 1 step or so. I believe there is a non-syncronize between Arduino and driver, and not between driver and stepper, because driver and stepper works correctly with other input. The Arduino supplies the 400 steps for the one revolution, but somewhere in between is not recognized as 400, more like 40. Probably because of the library?

Question:

  1. What's wrong?
  2. Forget the code and the problem. Can you please supply a correct code? I hope the author of this topic would see this post.

Thanks in advanced and God bless. I have finish until Thursday.

  1. I can't test everyday the driver and the stepper, because they are in a lab where I do not have access. That means I have to get things right without testing.

Frustrating (to say the least). Depends what you need to test but using an ultra-cheap miniature stepper from eBay
might be a way forward.

[ Its a good discipline to program with the aim of getting it to work first time its tested :slight_smile: ]

MarkT:

  1. I can't test everyday the driver and the stepper, because they are in a lab where I do not have access. That means I have to get things right without testing.

Frustrating (to say the least). Depends what you need to test but using an ultra-cheap miniature stepper from eBay
might be a way forward.

[ Its a good discipline to program with the aim of getting it to work first time its tested :slight_smile: ]

I quote from my self:

Arduino commands correctly other stepper with other drivers (same code).

]
That means that Arduino with the same code, an cheap driver and a scrap stepper from an old CD-ROM make the correct steps required. The 2M542 + turning table doesn't.