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.

Stepper motor interface with Spartan 3

Status
Not open for further replies.

gold_kiss

Full Member level 4
Joined
Sep 11, 2002
Messages
211
Helped
7
Reputation
14
Reaction score
4
Trophy points
1,298
Activity points
1,789
spartan 3 motor dc

Hi All,

Can anyone give me circuit schematic of interfacing single phase 12V DC stepper motor with Spartan 3 FPGA.

Let the circuit be simple and efficient. May use Opto coupler IC's for protection. Also all the components in the circuit should be easily available locally.

Thanks,
Gold_kiss
 

u can try to find the datasheet from ST.... the L297.. this data sheet provide u wth all the information u require to control stepper motor

the L297 is a motor controller n it can b used wth the L298N to easily controlling the stepper motor....

search for the L297 data sheet....

if u would like to discuss bout it... u can always PM me,,, im doing it also...

regards,
sp
 

I think Xilinx ISE includes the motor control examples. You should have a look.
 

refer cool runner refrence design in xilinx website
 

I plan to use 3717 ICs to drive a stepper motor...but how do I interface my FPGA (SPARTAN 3AN) to the IC?
 

The 3717 you intend to use is a 5V logic device, right? Then you would need to use a logic level shifter, to take your (presumably 3.3 volt) outputs from the spartan-3an to something the 3717 is happy with.

Since you said stepper motor, the outputs will probably be in the 100 kHz range or so maximum. Then you can probably get away with:

Configure the intended output on your spartan IOB as:
- LVCMOS33
- configure as INOUT (so you can use a tristrate)
- pullup resistor from the output pin to +5 V
- make sure the pullup resistor is sufficiently large (say 3.3k) to limit current into the IOB clamp diode. This will make sure the diode is able to clamp the voltage on the pad to something that is within spec.

When you tristate, the pullup will ... pull up to +5 V, which is the logic HIGH input to your 3717.
When you actively pull low the output, you get 0 V, the logic LOW input to your 3717.

In verilog you would then have something like:

Code:
wire stepper_i0; // your fpga internal signal that you want to go to the "I0" pin of the 3717
wire uc3717_i0_pado; // Output to the IOB pad.


// note the inversion to make up for the inversion done by the open collector scheme
assign uc3717_i0_pado = (stepper_i0 == 1'b1) ? (1'bz) : (1'b0);

In your .ucf make sure you get lvcmos33 (and not the lvcmos25 default). The lvcmos25 will also work, but the lower VCC will result in a little more strain on the clamp diodes.

And that's it. Hope that helps. :)

PS: As an aside .. any particular reason for the 3717? AFAIK that this is pretty old and there are newer parts available that might do the job better. You are doing an unipolar driver I take it?

PPS: Forgot to mention it. I use the above scheme in a spartan-3e based stepper controller and works as advertised. I do a pullup to +12 V, so the +5 V should be peanuts. ;-)
 

what are the new stepper motor driver ICs I can use for both unipolar n bipolar Motors?
 

Depends on how big the steppers are. For the large current steppers you can use a half-bridge driver, generate the PWM with your fpga, and feed the fpga with comparators signal from the current sensing resistors. That usually gives you way more flexibility in stepper driving than the all-in-one IC's.

For half-bridge drivers, check out these parts from Fairchild semi.

FAN73832
FAN73833
FAN73932
FAN73933

And you'll need some mosfets obviously...

Although, maybe I should just ask what size stepper are you driving, and at what speed?
 
Last edited:

But I dont require half bridge drivers for a unipolar motor rite?
so what would I use for a 5V unipolar hybrid stepper motor?...i thought of driving it as bipolar but 3717 ICs are quite expensive for my budget.
 

You don't need halfbridge for unipolar. You do however need some sort of power stage. So ....

What speed? Rpm's, pulses per second, that sort of spec. What winding current? Or possibly even easier: do you have the motor datasheet?
 

Assume its a Mitsumi35SP-8 motor...12V, 259mA,50ohms....Holding torque=38.2 (200pps)...pull out pulse rate=580pps n pull inn pps=495...btw, chnage of plans...using MSP430 as the controller till my FPGA arrrives...
 

For such a small stepper you can probably get away with something like a ULN2803 darlington array.
 

yeah...but i need to perform microstepping...
 

Hi all!
I want to control a hybrid bipolar stepper motor with spartan 3.
I want to use p-fets on the high-side of dual -bridge to avoid
gate driver to boost the voltage and N-fets on the low-side.
My problem is the VHDL code for pwm microstepping controller.
I don't want to use an IC because I need large flexibility.
Does anyone can help?
I'm new on FPGA and VHDL.
 

Are you really sure you want to use P-fets? Doing the high side stuff yourself with discretes gets to be a hassle real fast. Especially if this is a hobby thing and the objective is to "save money". Because you won't save money by doing that. :p

Apart from that ... build a sin table (say 8 bits) for the reference voltage, use your favorite way to generate a voltage from this 8-bit value. I used pwm + RC lowpass for that and got about 7-bit accurate voltage, which was good enough. Then use comparators to compare the generated sin/cos with the voltage across your coil current sense resistors. Based on this comparator output you do your pwm for the coil drivers.
 

Are you really sure you want to use P-fets? Doing the high side stuff yourself with discretes gets to be a hassle real fast. Especially if this is a hobby thing and the objective is to "save money". Because you won't save money by doing that. :p

Apart from that ... build a sin table (say 8 bits) for the reference voltage, use your favorite way to generate a voltage from this 8-bit value. I used pwm + RC lowpass for that and got about 7-bit accurate voltage, which was good enough. Then use comparators to compare the generated sin/cos with the voltage across your coil current sense resistors. Based on this comparator output you do your pwm for the coil drivers.

Could be more explicit with the drawback of P-fets at the high-side?
Could you show me how you did with pwm and RC low pass to get 7-bit accuracy.
What would u recommend me if I want to any IC controller for the dual H-bridge as well as level shifter ( I want to be able to drive it directly from the FPGA)
 

P-fets typically can carry less current than N-fets. P-fets typically have a somewhat higher Rds_on. If you do your own drive stuff then you will have to do the level shifting yourself. You could use a simple npn + pulldown, but that typically is a bit slow. So you make your level shifter push-pull which will make it a little faster, and increases the parts count. Then you get the fun problem that your high and low side drive will probably be asymmetric with regard to on/off timings being different for the high and low side. So you have to compensate for that. You could do a bit of that in the fpga, but it's not going to be all that great. Then you have to make damn sure that you don't get cross conduction by the high & low side being on at the same time, and you have to incorporate sufficient deadtime as well. Again, this can be (partially) done in the fpga but you have to be carefull. For one, you will have to design your driver such that if all the fpga outputs are high-Z tristate (for example during configuration) that no accidental cross conduction can take place.

A H-bridge driver will take care of all of that for you. That and drivers are not that expensive compared to the discretes you would be using. And definitely not compared to the number of fets you will blow up during the learning curve. :p

Discretes for unipolar? Yes, sure. For bipolar personally I wouldn't.

pwm + RC low pass is basically a 1-bit dac. See for example this one...

As H-bridge driver I'd say the FAN73832/3 or FAN73932/3 is pretty good. Mouser has them for a decent price (when they have stock that is).
 
Last edited:

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top