Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] stepper motor interface

Status
Not open for further replies.

cyanpraveen

Junior Member level 3
Joined
Mar 31, 2011
Messages
27
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,527
Hello guys
i am trying to interface P89v51 rd2 controller with stepper motor. i had bought the stepper motor with drive. please see the specification of
stepper motor in below mentioned link.

Stepper motor:
**broken link removed**

Diver details:
**broken link removed**

i am trying to establish serious connections using this motor and driver and i need to interface with micro controller to rotate the motor in clockwise and anti clock wise direction.

i tried programming the motor as normal stepper motor but it doesn't work. like
Code:
sbit Coil_A = P2^0;		// R
sbit Coil_B = P2^1;		// O
sbit Coil_C = P2^2;		// B
sbit Coil_D = P2^3;		// G
								  
void main()
{
 P2   = 0x00;

	while(1)
	{
//Coil_A = 1;
Coil_A = 1;
Delay (1000);

// Coil_A = 0;
Coil_A = 0;
Delay(200);

Coil_B = 1;
Delay(200);

Coil_C = 0;
Coil_D = 0;
i would be really great full if someone give solution for this. thanks in advance
 

I'm not even sure that the step sequence that you are trying to implement is correct but in this case this step logic is implemented inside the driver.
All you have to do is send the logic signals:
connect your mcu as shown below, you can use three transistors or sink the output directly if your mcu can sink 16mA,then use ENA to enable the driver, select the direction from DIR and send a pulse to PUL for each step

driver.gifdriver2.gif

Alex
 

IT seems like to drive the motor i need to frequency in the range of 200khz. and is that possible to obtain 200khz in MCU if means can u say how to achieve it?
And you have mentioned that send the pulse to PUL. if you dont mind can u say how to generate the pulse from MCU pls give some examples in term of programming to give pulse to driver.
 

The pulses are send for each step, why do you need 200000 steps /sec?
An mcu can switch the output fast enough , it depends on the rest of the code how much speed you will get but it should be high enough.
The simplest way is to toggle a pin, I haven't used your mcu so I can't give you specific instructions

Alex
 

It's is similar to 8051 or 89c51 MCU. when i contacted the motor supplier he told that the motor will only get drive it the output frequency is n the range of 200khz. From investigation from other sources i found , i need to pass some value with pulse signal to run the motor. i dono how to pass the value through pulse signal. for that reason only i have some example programs to pass the pulse
 

You have been misinformed, there in no need (or way) to pass info to the driver, all the settings are done with the dip switches.
You only have to set the direction and send one pulse for one step, that is all, the datasheet is quite clear on that
There in no need for a high frequency either, you do a step whenever you want , you can do a step per hour if you wish.

Alex
 

Well thanks for the clearance.. can u pls look at the above code which i had attached ...can u say whether i a m going in a rite way or not.. if not can u direct me in rite way please
 

The pulses can be generate even from a simple code like P2^1; , every time it is used it will invert bit0 of port2 so every two times you get a step,

or you can use

P2 &= ~(1); // set pin0 to 0
delay
P2 |=1; // set pin0 to 1
delay

set the dir from another bit, this should be stable for 5ms before you send a step pulse
P2 |=2; // set pin1 to 1 for CW rotation
P2 &= ~(2); // set pin1 to 0 for CCW rotation

you can connect the enable pin (ENA) externally or in an mcu pin too
P2 |=4; // set pin2 to 1 to enable the driver
P2 &= ~(4); // set pin2 to 0 to disable the driver

Will you connect the driver directly to the mcu?
can your mcu pin sink 10-16mA for each pin?

Alex
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top