PDA

View Full Version : Motor driver config - newbie



SARAL
10-08-2008, 09:12 AM
I have a BS2P microcontroller (on BOE) running a driver and a stepper motor. The motor (PR 266-02A) and the driver (CSD 2120-T) are custom configured from Oriental Motors. You can see the breadboard config and the function ports (such as power, timing, Direction, Pulse controls) in the links provided below.

Breadboard: http://www.parallax.com/desktopmodules/catalookstore/ImageViewer.aspx?link=Images%2fProd%2f2%2f288%2f28 850-L.jpg&desc=Board+of+Education+Development+Board+(USB)&PortalID=0&viewerid=-1&mid=-1
Function ports on the driver: http://www.sal.wisc.edu/pfis/docs/archive/public/Product%20Manuals/orientalmotors/CSD2120-TU.pdf

I have a simple operation requirement of running the motor for a specific time CW pause and CCW for the same time.
Can you guys suggest any program that could work for this particular config? The example codes given in the manual are using drivers (L293D and ULN2003A) that provide very small current output and my motor requires 24/36V and 4.7A input. I dont even know if I can use the above driver to run the motor under this controller.

This is very important for my project and any help is very highly appreciated.

KAL

Amaral
10-08-2008, 09:45 AM
your DRIVER is responsible for the current at the motor side ! that's the meaning of using a driver ! I don't know this particular driver (CSD 2120-T). can you provide more information .


Amaral

SARAL
10-08-2008, 11:16 AM
If I were to use the other drivers (L293D and ULN2003A), the output voltage and Current specs of either of them would not support the requirements of the motor (24/26V and 4.7A). Like I said, most of the programs I saw on the web were made using one of these drivers. Please correct me if I'm wrong.

The details of the driver can be found here: http://www.sal.wisc.edu/pfis/docs/archive/public/Product%20Manuals/orientalmotors/CSD2120-TU.pdf

This driver requires a 24/26VDC Input and is capable of switching between 1-pulse and two-pulse modes in addition full and half step modes.

Amaral
10-09-2008, 08:29 AM
You have a very nice driver on your hand !

Theoretically you can just plug your BS to it. But by safety I would use some opto-isolator or an ULN2003 driver to it. You will need a 24 to 36 Vdc power supply for it.
I’ll just use the ULN2003 because I don’t know what’s the current that the drives draws from each pin of signal. It say to keep an R1 if your voltage is grater than 5 Vdc (which is not ) to keep the signal current below 10 mA. Let’s say that for signal the current needed is 7 mA your maximum current draw from the stamp is 60 mA .. that give us 8 pins at this current ... you may think that you have less than it to control, but what if you need to control something else, like a LED ? well .. for testing is it seems safe to connect your stamp direct to the driver. But for a safe operation isolate it.

Amaral.

SARAL
10-09-2008, 11:52 AM
Thanks Amaral

That was really great of you. I will go ahead and hook it up. Also I was looking for some program to run this setup. Actually our application demands it to drive the motor CW with 5 stops and CCW with same 5 stops. Since I am not good at programming I kind of searched online but found nothing that exactly fits the bill.

The closest I found was one from this website: http://www.phanderson.com/stamp/tutorial_2.html
I modified the code to suit my application. I will paste that code in my next message.

SARAL
10-09-2008, 11:54 AM
' {$STAMP BS2}
' {$PBASIC 2.0}
REVS VAR Byte
STEPS VAR Word
SPEED VAR Byte
T_VAR VAR Byte
DIR VAR Byte
INDEX VAR Byte
PATT VAR Byte
I VAR Byte
J VAR Byte

T_INT CON 5000
DIRA=$F ' low four bits are outputs

TOP:
REVS = 2 ' revolutions
STEPS = REVS * 200 ' number of steps
SPEED=(IND & %0011) ' S13 and S12
LOOKUP SPEED, [50, 75, 100, 200], T_VAR
DIR= IN15 ' read the direction
BRANCH DIR, [ONE_W_H]

ONE_W_H:
PAUSE T_INT
FOR I = 0 TO 5
I= I+1
ONE_H:
FOR INDEX=0 TO 7
LOOKUP INDEX, [$1, $3, $2, $6, $4, $C, $8, $9], PATT
OUTA = PATT
PAUSE T_VAR
STEPS=STEPS-1 ' decrement number of steps left
IF (STEPS=0) THEN ONE_H
IF (I=6) THEN TURN
NEXT
GOTO ONE_H

TURN:
REVS = 2 ' revolutions
STEPS = REVS * 200 ' number of steps
SPEED=(IND & %0011) ' S13 and S12
LOOKUP SPEED, [50, 75, 100, 200], T_VAR
DIR= IN15 ' read the direction
BRANCH DIR, [OTHER_W_H]

OTHER_W_H:
PAUSE T_INT
FOR J = 0 TO 5
J = J+1
OTHER_H:
FOR INDEX=7 TO 0
LOOKUP INDEX, [$1, $3, $2, $6, $4, $C, $8, $9], PATT
OUTA = PATT
PAUSE T_VAR
STEPS = STEPS - 1 ' decrement number of steps left
IF (STEPS = 0) THEN OTHER_H
IF (J = 6) THEN DONE
NEXT
GOTO OTHER_W_H

DONE:
DEBUG "DONE"
OUTA = 0 ' turn off all windings
DONE_1: GOTO DONE_1

SARAL
10-09-2008, 12:01 PM
I have two questions relating to this code. Do you think this would work? If so how should I connect the I/O pins of the BS board with the driver?

I was thinking along these lines:

P12 ---> PLS CW (-)
P13 ---> DIR CCW (-)
P15 ---> ??

Since the driver has got a switch to determine full or Half step modes I dont think I need to connect P14. I'll be very greatful to you if you can please assist me in this confusion.

Bruce Bates
10-09-2008, 01:46 PM
SARAL -

It's a bit difficult to answer your question since your messages are a bit confusing up to this point. At the outset you said:

"The example codes given in the manual are using drivers (L293D and ULN2003A) that provide very small current output and my motor requires 24/36V and 4.7A input. I don't even know if I can use the above driver to run the motor under this controller."

Regardless of what driver chip you plan on using, the inference is that a driver chip will be used. However, the code from Professor Anderson's web site does NOT use a driver chip, but controls the stepper motor directly. Whether a direct approach, or an indirect approach (driver used) is utilized, only one of the two methods can be used, not both as you seem to be doing here.

Here is a high voltage stepper driver that I've used quite successfully before. It even has a serial interface which permits you to use SHIFTOUT to communicate with it:
http://www.allegromicro.com/en/Products/Part_Numbers/3972/index.asp

I suspect you could even request a sample of it for use on your project.

Regards,

Bruce Bates

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When all else fails, try inserting a new battery.

Post Edited (Bruce Bates) : 10/9/2008 6:06:52 AM GMT

SARAL
10-10-2008, 09:33 AM
Thanks for the reply Bruce.

Do you mean to say I cannot use my driver when I using Prof Anderson's code? I don't think that code was to be used without driver since he specifically mentioned in the webpage that it is not a good practice to run the motor directly using the controller. I am using an indirect approach but couldn't successfully use this program to run my motor nor come up with a program that suits my controller-driver-motor setup.

Unfortunately I couldn't use your driver because the output current is 1.5A (max) and my requirement is 4.7A.

Assuming that Dr. Anderson's code is suitable for my application I went ahead and connected the controller and driver as below:

P12 --> PULSE CW (-)
P13 --> DIRECTION CCW (-)
PULSE CW (+) and DIRECTION CCW (+) --> Vdd (+5V DC)

This is not helpful and the motor is still standstill. Can you please tell me what is it that I'm not doing? I appreciate your responses.

Regards,
Saral

Amaral
10-10-2008, 09:39 AM
Saral .. please list all your connection from BS to your Driver.

Tks

SARAL
10-10-2008, 10:18 AM
BS --> MOTOR
P12 --> PULSE CW (-)
P13 --> DIRECTION CCW (-)
PULSE CW (+) --> Vdd (+5V DC)
DIRECTION CCW (+) --> Vdd (+5V DC)

Driver is connected to the power supply for +24V DC Input. Motor is connected to the driver according to the color coded connections given in the manual: http://www.sal.wisc.edu/PFIS/docs/archive/public/Product%2520Manuals/orientalmotors/CSD2120-TU.pdf&usg=AFQjCNEBl0YvEK6eW5Y9KMA0Ph3p3E37uQ

Thing is the 'GND' I/O signal from the driver is connected to V- of the power supply since there is no terminal for GND in the power supply I have. I dont know if that is going to make any difference, doesn't it?

Thanks



Amaral said...
Saral .. please list all your connection from BS to your Driver.

Tks