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 & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • 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
Smarter Life
  • Challenges & Projects
  • Design Challenges
  • Smarter Life
  • More
  • Cancel
Smarter Life
Blog Smarter Life Challenge - Control Architecture
  • Blog
  • Forum
  • Documents
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: PaulMakesThings
  • Date Created: 16 Dec 2013 5:59 PM Date Created
  • Views 436 views
  • Likes 2 likes
  • Comments 2 comments
  • psoc4
  • smarter_life_challenge
  • smarter_life
  • auto_barista
Related
Recommended

Smarter Life Challenge - Control Architecture

PaulMakesThings
PaulMakesThings
16 Dec 2013

I really wanted to come up with a design that used the strengths of the PSoC platform, it is often too temping to just use what you know, but I figure the point here is to show some of the things it can do better than other systems. There is plenty of existing code for controlling steppers from a micro controller using timers and interrupts, but I suspected that by using the programmable digital hardware I could offload much of that work, and make it operate more smoothly.

 

A coordinated move means that each axis does it's move in the same time so that the trajectory does not change, it looks more smooth and makes the path predictable. To do this you know that each axis has a maximum speed and a distance it has to move, so your limit is whichever axis will take the longest then you decide the move speeds of all other axes by slowing them down to also happen in that time. At that point a normal MCU would start a timer driven loop of some sort, then count out the time to switch each pin on and off.

 

Here is what I have right now, the first PWM controls the speed of the entire move. The counters are set to divide the frequency so that once their periods and compare values are set, the trajectory set, and the MCU doesn't have to do any more work on that. The speed of the PWM will determine the speed of the whole move. This makes it easier to do a coordinated ramp up as well (a method to allow the machine a little time to accelerate) because if the frequency ramps up to the full speed, levels out, then ramps down, it will be divided up into the speed of the respective moves automatically.

image

 

Motor 4 is driven by an unrelated PWM because that is the gripper, it doesn't need to move with the other axes and it will likely be an RC servo for this iteration, meaning I can set the pulse width of that module and the hand will stay in the same position until I change it.

 

I'm working on the code still, but this seems to accomplish my goal. The MCU sets each move in motion by setting the period and compare value on each counter, and setting the frequency on the PWM source, then just lets it fly until it gets the interrupt signaling that it has finished. The direction pins aren't shown here, it was getting very cluttered, but those would also just be set once (high or low) at the start of a move). There will also be a limit switch pin (or several) attached to an interrupt. I'm glad I had this contest to push me to really explore the PSoC platform, not that I'm done yet of course.

 

I'm still working on building the arm itself of course. Posts on that with pictures of the build, and including the software I'm writing will follow. By the way here's a picture of the wrist with the bearing integrated, just because it's a cool feeling when your 3D prints and off the shelf parts click together perfectly. The end of the arm will grip this bearing and the hand bolts on to the gear.

 

image

  • Sign in to reply
  • PaulMakesThings
    PaulMakesThings over 11 years ago in reply to DAB

    Yes, I'm trying out several options, but there are some details to work out.

     

    By the way, I need to amend and correct my post, I was confusing UDB and FF modules. There are universal digital blocks (UDB) which can be several things, including PWMs or counters, and fixed function (FF) devices, which are separate. So I can have more than 4 PWM modules and 4 counters, because there are UDBs that can act as additional ones.

     

    So, knowing that, I still think I will use counters to divide one source clock, so that I can run moves together, and it will be easier to add ramps later. But this should let me run more motors when I upgrade, and I can make the gripper stepper driven too. (I think)

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

    Very nice solution.

     

    You might have to work out some details in timing, but I think you have a very nice solution for multiple motor control off the same time base.

     

    I can't wait to see your arm in action.

     

    DAB

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • 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