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 FPGA interface

Status
Not open for further replies.

bedooo911

Newbie level 3
Joined
Mar 4, 2011
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,308
I want to know why do I have to interface stepper motor with FPGA? and how? what kind of IC that i use to do that? Please make ur answer simple and if you can provide something that can help like data sheets that will be really appreciated.

Thanks :smile:
 

I think there is some writing mistake... Anyways..
Checkout this document..... for details.
Well to drive a stepper motor your FPGA code should able to generate specific sequence on four pins of FPGA which will further connected to bases of darlington pair transistor to drive the stepper motor coil.
see this ULN2800 IC details.
 

Attachments

  • motorbas.pdf
    189.8 KB · Views: 51
  • uln2803a.pdf
    430.6 KB · Views: 55

so your telling me that the FPGA job is to generate the sequence to drive the stepper motor. does that mean the the motor driver is preprogramed?
 

Depending on the motor type there are different coils that have to be driven with a specific sequence,
this sequence change the rotation direction.

You can find many articles on that,for example
Controlling Stepper Motors with a PIC Microcontroller
or
DC Motor interfacing with Microcontrollers tutorial : 8051 Microcontroller Projects AVR PIC Projects Tutorials Ebooks Libraries codes

The FPGA will have an input of step and direction and will translate that to the sequence that will drive the power stage that feeds the motor.

Alex
 

that was really helpful guys. I done with the microcontroller part I think. the microcontroller should get 2 inputs, one to move the motor left one step and the other is to move it right one step. does anyone know which ports am I using to get the signal to the microcontroller from the FPGA spartan 3E
 

If you want to use the standard way that is used from all the cnc software applications
then you should use one pin for direction control (for example 0 clockw1se/ 1 counterclockwise)
and a second pin that moves the motor one step when it receives a pulse.

You say that you have programmed the mcu and now you want to interface to the FPGA,
why would you use both when you can do it with only one device, either the mcu or FPGA.

Alex
 

One reason I can think is to use the mcu for communication and the fpga for things that need faster and more reliable timings.
But mainly I don't really see why you would need both either. The fpga I understand, better control over your timings. But if you have the fpga, then why use an mcu? Do you have a CAN bus or something?

Also, are you going to use pwm to control motor current? Or just a small motor that you can drive with a darlington for each phase?
 

well at the beginning I was just reading about controlling the motor with FPGA( the motor is 12v 3.6 deg for the step) but I was just reading how to do that and found that I need a mcu to interface. If anyone does know how to control it with FPGA only that will be good. I just went that way as I thought its the only way to get that done.If any one can give me ideas that will be appreciated.

Thanks any way for all the help guys
 

You can use a state machine or if/elseif which checks the value of a counter and use only the fpga to provide the steps according to the input pins (dir, step)

You can store the output steps in a constant array and then use it to output the correct value, this is an example for a bipolar motor using full step


Code VHDL - [expand]
1
2
3
4
5
6
7
8
type INIT_ROM_TYPE is array (0 to 3) of std_logic_vector(3 downto 0);
constant step_array     : INIT_ROM_TYPE :=( b"1010",    -- ++
                                            b"1001",    -- +-
                                            b"0101",    -- --
                                            b"0110");   -- -+           
 
-- then in the part of the code where you assign the values use
output<= step_array(current_step);  -- increase or decrease the current_step to turn the motor in different direction



if you are using a bipolar motor and H bridge then you must turn everything off for a few µs and then switch on the opposite transistors/mosfets to avoid any short-circuit in the bridge.
If you have a unipolar and there is no bridge there is no such problem and no delay is needed.

Alex
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top