element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Cypress Kits
  • Products
  • Dev Tools
  • Cypress Kits
  • More
  • Cancel
Cypress Kits
Forum PSoC 4 Pioneer Kit Community Project#045 – Stepper Motor Example
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Cypress Kits to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 22 replies
  • Subscribers 32 subscribers
  • Views 6105 views
  • Users 0 members are here
  • 100projects
Related

PSoC 4 Pioneer Kit Community Project#045 – Stepper Motor Example

cy.wbz
cy.wbz over 12 years ago

Hello!

 

In today’s example we will be showcasing a very simple stepper motor example project. In this example we show you how to spin a stepper motor using the PSoC 4 Pioneer kit and the Arduino Motor Shield.

 

image

 

Forum Post Attachments:

 

At the bottom of this post we are including the following items:

  • Example Project Zip File
  • Zip File of Images
    • Project Schematic
    • Component Configurations

 

Components Used:

 

The user can download the example project at the bottom of this post. The project uses the following list of Creator Components:

  • PWM
  • Control Register
  • CyClock
  • CyPin

 

The components are configured by right clicking on the component in your Top Design schematic view and selecting Configure. Please enable the following selections in the Configuration windows for the listed components above.

 

Firmware Description:

 

The main.c firmware is included in the example project. Please review the commented sections for more details.

 

In this example we are giving users an example on how to control a Stepper Motor. In this example we have included a number of motor control source files that will provide you simple APIs to control the motor. These files are:

  • genSine.c/h
  • inputScan.c/h
  • Move.c/h
  • PhaseControl.c/h
  • systemInit.c/h

 

The firmware is designed to drive the stepper motor is various directions and different speeds and different lengths of time. There are a number of if/else statements that progress through the demonstration. Please take a few moments to review the included source files to get a feel for the firmware controls for the motor.

 

Hardware Connections:

 

Connect the Arduino Motor Shield to the PSoC 4 Pioneer Board. Then connect wires from the stepper motor to the Arduino Motor Shield and power the motor.

 

image

 

Test Your Project:

 

Program your project and power up the Motor Shield using an external power supply.

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

I hope this example can help you in your design.

 

Best,

Matt

Attachments:
6175.Project Images.zip
StepMotor_PSoC4200_demo.cyprj.Archive01.zip
  • Sign in to reply
  • Cancel

Top Replies

  • Former Member
    Former Member over 9 years ago in reply to balearicdynamics +1
    Enrico, I'm referring to the one linked in the project above: A000079 - ARDUINO - ADD-ON CARD, MOTOR SHIELD R3, L298P | Newark element14 I'd be happy to use another one that is compatible, if you know…
  • balearicdynamics
    balearicdynamics over 9 years ago in reply to Former Member +1
    Hello Shaka, I am providing this At the actual date I have already developed a couple of prototypes: The first project is in the state of waiting for the PCB ready and the principle and schematics has…
  • lindulajj
    lindulajj over 7 years ago +1
    Hello, the link to the Adriuno Motor shield shows that it is No Longer Manufactured. Can anyone recommend a motor shield that is compatible with the PSoc4? How about this one from Pololu: https://www.pololu…
  • DAB
    DAB over 12 years ago

    Your projects are a very good example on the versatility of PWM devices for signal generation and motor control.

     

    I had not given it a lot of thought before, but your series has made me more aware of just how useful they can be.

     

    Thanks

    DAB

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • jesusantoniocar
    jesusantoniocar over 12 years ago

    Hello Matt.

    Another great project.

     

    Stepper Motor Advantages

    1.The rotation angle of the motor is proportional to the input pulse.
    2.The motor has full torque at standstill (if the windings are energized).
    3.Precise positioning and repeatability of movement since good stepper motors have an accuracy of 3 to 5% of a step and this error is non-cumulative from one step to the next.
    4.Excellent response to starting/stopping/reversing.
    5.Very reliable since there are no contact brushes in the motor. Therefore the life of the step motor is simply dependant on the life of the bearing.
    6.The stepper motors response to digital input pulses provides open-loop control, making the motor simpler and less costly to control.
    7.It is possible to achieve very low speed synchronous rotation with a load that is directly coupled to the shaft.
    8.A wide range of rotational speeds can be realized as the speed is proportional to the frequency of the input pulses.

     

    thanks.

     

    best regards,

     

    Jesus Antonio.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • jesusantoniocar
    jesusantoniocar over 12 years ago in reply to jesusantoniocar

    Hello Matt.

    I dont know if you have planned some examples of filter design with psoc 4. It will be interesting.

     

    Regards,

     

    Jesus.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • marsmen
    marsmen over 11 years ago

    Hey Matt,

     

    I'm going through Project #045 Stepper Motor Controller and am correlating project code, PSoC 4 schematic, and ArduinoMotorShield Schematic and I noticed that Dir_Out_A doesn't go to the correct pin in the project.

     

    The project states PSoC 4 chip pin P3[4] which goes to J3.3, but on the Arduino, this is not connected to anything. The pin for DirA on the Adruino should try to PSoC 4 chip pin P3[1] going to J3.5.

     

    Also, Dir_Input on J2.16 physically doesn't connect to anything.

     

    The code I'm using is from the "First 50 Projects" zip and not from this blog page. I'm not sure if they are different.

     

    Does any of this sound right?

     

    Thanks,

    Jim

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • greatunclebulgaria
    greatunclebulgaria over 11 years ago in reply to marsmen

    Jim,

     

    Having a quick look at the "Project Images.zip", at the bottom of the first post, - the "Pin Selection.png" picture shows that DIR_OUT_A does go to P3[1].

     

    I would suggest you look at the files in this posting, and see if they tie up with your hardware. Looks like the other setup from the "First 50 Projects" has the wrong revision of "code".

     

    Hope you find the correct source for your project.

     

    David

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • marsmen
    marsmen over 11 years ago in reply to greatunclebulgaria

    David,

     

    Good call, the project zip photos didn't match the corrects pins. I updated just that one and the thing runs way smoother, but still not like what is shown. I'm guessing that there is some other stuff that is different as well.

     

    I would say, "First 50 Projects" definitely does not have the same code. Next would be to load from this posting and give it another go.

     

    Jim

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 10 years ago

    I am trying to get this project into my PSOC4 ...

    Not sure what I am doing wrong . I loaded folder into creator examples area  but get an error .

     

     

    "arm-none-eabi-gcc.exe: error: ..\..\..\..\psoc\content\cycomponentlibrary\CyComponentLibrary.cylib\CortexM0\ARM_GCC_473\Debug\CyComponentLibrary.a: No such file or directory

    The command 'arm-none-eabi-gcc.exe' failed with exit code '1'. "

     

    Somecomponent library missing ? ...

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 10 years ago in reply to Former Member

    PS. The project #45 is the stepper motor PSOC 4 .

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 9 years ago

    This Arduino stepper motor board doesn't look to be available anymore.  Is anyone aware of a replacement board that would still be compatible with this project?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • balearicdynamics
    balearicdynamics over 9 years ago in reply to Former Member

    Shaka, what Arduino stepper motor board do you refer to ?

     

    Enrico

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube