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
Summer of Green Tech Design Challenge
  • Challenges & Projects
  • Design Challenges
  • Summer of Green Tech Design Challenge
  • More
  • Cancel
Summer of Green Tech Design Challenge
Blog Recycled e-Scooter #3 Use arduino IDE with simpleFOC
  • Blog
  • Forum
  • Documents
  • Leaderboard
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Summer of Green Tech Design Challenge to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: fyaocn
  • Date Created: 20 Sep 2023 2:08 AM Date Created
  • Views 646 views
  • Likes 9 likes
  • Comments 2 comments
Related
Recommended

Recycled e-Scooter #3 Use arduino IDE with simpleFOC

fyaocn
fyaocn
20 Sep 2023

#3 Use arduino IDE with simpleFOC

Table of Contents

  • 1 Use Arduino IDE
  • 2 Run Hall sensor example
  • 3 Simple FOC library and BLDC control
  • 4 Run the simpleFOC example 
  • 5 Summary

1 Use Arduino IDE

With Seeed Xiao, Arduino IDE , MicroPython with Thonny IDE and CircuitPython can be used for development. Arduino is stil my first choice

Version: 2.2.1
Date: 2023-08-31T14:35:44.802Z
CLI Version: 0.34.0

Copyright © 2023 Arduino SA

2 Run Hall sensor example

Connect the  analogue Pin A0 in Xiao ,

image

Read the sensor value is output with serial ports

image

 

3 Simple FOC library and BLDC control

Install the simpleFOC library from library manager

image

The simpleFOC is open sourced library for BLDC motor control, this is key part in driving scooter. 

4 Run the simpleFOC example 

Prepare the voltage control example and run it,

image

But the error pop out, some Parameter is not well defined. The reason is simple, Seed Xiao is not enlisted in the acceptable board, although the architecture of sam21 and sam51 is OK.

Find the keyword in board definition 

image

and add the key word in the list. 

image

Then the example passed.

image

 

5 Summary

The Seeed Xiao is easy to use and simple FOC provide ful feature in BLDC control algorithm. That is very good start for this project.

  • Sign in to reply
  • fyaocn
    fyaocn over 1 year ago in reply to dougw

    Hall sensor is used  for Positon detection for speed control.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • dougw
    dougw over 1 year ago

    Where is the Hall sensor mounted?

    • 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