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
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • 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
Sustain The World - Design Challenge
  • Challenges & Projects
  • Design Challenges
  • Sustain The World - Design Challenge
  • More
  • Cancel
Sustain The World - Design Challenge
Blog Waste Food Management Blog #6   Program control DC motor and fine tune program
  • 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: wtos03
  • Date Created: 3 Sep 2020 2:59 AM Date Created
  • Views 537 views
  • Likes 2 likes
  • Comments 0 comments
Related
Recommended

Waste Food Management Blog #6   Program control DC motor and fine tune program

wtos03
wtos03
3 Sep 2020

This week I spend most of the time on programming. There are three main parts that have been done.

 

1) Improve Servo control by using analogWrite() function. This function will send PWM pulse continuously to the Servo.  The frequency

of the PWM will be set by setAnalogWriteFrequency (PIN, PERIOD in ms ). We use 22 to get the most nearly 50 Hz. (By experiment and measure by scope)

Servo control is programmed in servoWrite(angle) function. The Angle of the Servo will be mapped to duty cycle by using map function between 0 - 180 degrees

and  MIN/MAX of Duty cycle.

 

2) Program Control DC motor. Firstly, install the library TLE94112 for Arduino.  I use example  control2Motors as a reference. To get most of the current for DC motor, 

I use HB1, HB2 for crusher_motor’s highside and HB3, HB4 for crusher_motor’s lowside. For another motor, I use HB9, HB10 for stir_motor’s highside and HB11, HB12 for stir_motor’s lowside.

I tested it with small motor and it works fine. But after I changed to bigger motor. The motor cannot start.  The current drive should be enough because I join two outputs together which mean can

drive up to 1.8 amp.  Then I tried to change command from start to rampSpeed command and it works fine. I still don’t know the reason.  Maybe start up gradually reduce current at the startup.

 

3) Implement the Auto program, this program will automatically start from  crush_motor to release EM from valve and start stirring motor at a specific of time.

From the experiment, I  redesign that the start/stop button should be separate from the knob. This will reduce confusion and more easy to control start/stop anytime, because we can use interrupt

for start/stop button. At this moment, I still not finished implement start/stop yet.

 

I would like to show Video here.  But I think it will be better if I show when all is finished.

 

Next  I will concentrate on the program and start to build the machine as the meat grinder had arrived and the structure for the machine had been set up.

For source code go to  https://github.com/wtos03/WasteFoodMgmt.  Please note source code is not finalize and there is still a lot of testing command and it may change often.

  • Sign in to reply
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 © 2026 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