element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • 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
Enchanted Objects
  • Challenges & Projects
  • Design Challenges
  • Enchanted Objects
  • More
  • Cancel
Enchanted Objects
Blog MagicHat - 11 - Two brains are better than one
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: amgalbu
  • Date Created: 4 May 2015 11:22 AM Date Created
  • Views 592 views
  • Likes 3 likes
  • Comments 3 comments
  • yun
  • enchanted_objects
  • mini
  • magic_doctor_hat
  • arduino
Related
Recommended

MagicHat - 11 - Two brains are better than one

amgalbu
amgalbu
4 May 2015

The blood pressure measurement system revealed to be more challenging than I expected...

As a matter of fact, the pulse detection algorithm takes up most of the Atmel 32U4 resources, thus leaving too few time to other tasks. This has some counter-effects, the most noticeable being a non-uniform movement of the continuous rotation servo.

I tried several workaround, like moving the pulse detection algorithm in Timer3 ISR instead of Timer1 ISR (and obviously forcing the Servo  library to use Timer1 instead of Timer3) but the problem was still there. I also tried to skip the Servo library and generate the PWM for the servo using the analogWrite function, but the problem was not resolved. I guess the problem is that the pulse detection algorithm completely disables interrupts, thus causing the PWM signal to jitter randomly

For this reason, I decided to move the servo control logic to another Arduino board. The Enchanted objects challenge's kit included a Arduino UNO board, but unfortunately I can use this board due to size contraints. So the choice was for the Arduino Mini Pro board, which is small enough to accommodate inside the MagicHat.

Despite the additional work this decision involves, there are also some benefits. For example, the mouth control logic I originally removed from the list of features I planned to implement is returning now into play.

The connection between the two boards is very simple:

  • a digital output driven by Arduino Yun tells Arduino Mini to start the blood pressure servo
  • a digital output driven by Arduino Yun tells Arduino Mini to bend the hat

 

 

image

  • Sign in to reply
  • Workshopshed
    Workshopshed over 10 years ago in reply to balearicdynamics

    At power on, you've no idea where the servo is positioned so it will rapidly move to the first value you provide.

    It might be nice to just be able to give the servo commands such as slow to 150°, rather than having to provide the PWM signal all of the time.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • balearicdynamics
    balearicdynamics over 10 years ago in reply to Workshopshed

    Andy, as for what as I know, the servo is positioned by a certain PWM always in the sam angular position. This is in an ideal servo working perfectly but the principle will be this.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Workshopshed
    Workshopshed over 10 years ago

    Looks like a good approach, the PWM input on the servos makes for a good solution for RC controllers but perhaps not the best for microcontroller solutions. Perhaps someone needs to invent a better servo? For example it would be good to be able get the servo position.

    • 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