├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── config.yml │ └── feature_request.md └── workflows │ ├── ci-master.yml │ ├── ci.yml │ └── publish.yml ├── .gitignore ├── .prettierignore ├── .prettierrc ├── .stylelintrc.json ├── 404.html ├── CNAME ├── Doxyfile ├── Gemfile ├── README.md ├── _config.yml ├── _includes ├── head.html ├── head_custom.html ├── js │ └── custom.js ├── nav.html ├── title.html └── vendor │ └── anchor_headings.html ├── _layouts ├── about.html ├── default.html ├── home.html ├── page.html ├── post.html ├── table_wrappers.html └── vendor │ └── compress.html ├── _sass ├── base.scss ├── buttons.scss ├── code.scss ├── color_schemes │ └── dark.scss ├── content.scss ├── custom │ └── custom.scss ├── labels.scss ├── layout.scss ├── navigation.scss ├── overrides.scss ├── search.scss ├── support │ ├── _functions.scss │ ├── _variables.scss │ ├── mixins │ │ ├── _buttons.scss │ │ ├── _layout.scss │ │ ├── _typography.scss │ │ └── mixins.scss │ └── support.scss ├── tables.scss ├── typography.scss ├── utilities │ ├── _colors.scss │ ├── _layout.scss │ ├── _lists.scss │ ├── _spacing.scss │ ├── _typography.scss │ └── utilities.scss └── vendor │ └── normalize.scss │ ├── README.md │ ├── normalize.scss │ └── package.json ├── assets ├── css │ ├── dark-mode-preview.scss │ └── just-the-docs.scss ├── images │ ├── just-the-docs.png │ └── search.svg └── js │ ├── dark-mode-preview.js │ ├── just-the-docs.js │ ├── search-data.json │ └── vendor │ └── lunr.min.js ├── bin └── just-the-docs ├── contact.md ├── docs ├── boards │ ├── index.md │ └── simplefoc_shield │ │ ├── fabrication │ │ ├── index.md │ │ ├── shield_fabrication_v1.md │ │ └── shield_fabrication_v2.md │ │ ├── getting_started │ │ ├── code.md │ │ ├── connections.md │ │ ├── index.md │ │ └── soldering_pads │ │ │ ├── index.md │ │ │ ├── pads_v1.md │ │ │ └── pads_v2.md │ │ └── index.md └── simplefoc_library │ ├── cheatsheet │ ├── build_flags.md │ ├── index.md │ └── options.md │ ├── citing.md │ ├── code │ ├── communication │ │ ├── commander │ │ │ ├── custom.md │ │ │ ├── index.md │ │ │ ├── lpf.md │ │ │ ├── motion.md │ │ │ ├── motor.md │ │ │ ├── pid.md │ │ │ └── scalar.md │ │ ├── index.md │ │ └── step_dir.md │ ├── current_sense │ │ ├── high_side.md │ │ ├── index.md │ │ ├── inline.md │ │ └── low_side.md │ ├── debug.md │ ├── drivers │ │ ├── bldc_driver │ │ │ ├── bldc_driver_3pwm.md │ │ │ ├── bldc_driver_6pwm.md │ │ │ └── index.md │ │ ├── index.md │ │ └── stepper_driver │ │ │ ├── index.md │ │ │ ├── stepper_driver_2pwm.md │ │ │ └── stepper_driver_4pwm.md │ ├── drivers_library.md │ ├── from_scratch.md │ ├── index.md │ ├── monitoring.md │ ├── motion_control │ │ ├── closed_loop_control │ │ │ ├── angle.md │ │ │ ├── index.md │ │ │ ├── torque_control │ │ │ │ ├── dc_current.md │ │ │ │ ├── foc_current.md │ │ │ │ ├── index.md │ │ │ │ └── voltage.md │ │ │ └── velocity.md │ │ ├── index.md │ │ └── open_loop │ │ │ ├── angle_openloop.md │ │ │ ├── index.md │ │ │ ├── index_search.md │ │ │ └── velocity_openloop.md │ ├── motors │ │ ├── bldc_motors.md │ │ ├── index.md │ │ └── stepper_motors.md │ └── sensors │ │ ├── encoder.md │ │ ├── generic.md │ │ ├── hall_sensor.md │ │ ├── index.md │ │ └── magnetic │ │ ├── index.md │ │ ├── magnetic_sensor_analog.md │ │ ├── magnetic_sensor_i2c.md │ │ ├── magnetic_sensor_pwm.md │ │ └── magnetic_sensor_spi.md │ ├── digging_deeper │ ├── index.md │ ├── libray_source │ │ ├── communication.md │ │ ├── examples.md │ │ ├── foc_source.md │ │ ├── index.md │ │ ├── motiron_control.md │ │ └── sensors.md │ └── theory │ │ ├── FOC_routine.md │ │ ├── index.md │ │ ├── low_pass_filtering.md │ │ ├── pid_controller.md │ │ └── voltage_torque_control.md │ ├── examples │ ├── drv8302.md │ ├── foc_pendulum.md │ ├── gimbal_velocity_example.md │ ├── haptics.md │ ├── index.md │ ├── position_control_example.md │ ├── position_control_example_nucleo.md │ ├── stepper_control_nucleo.md │ └── velocity_control_example.md │ ├── hardware │ ├── drivers │ │ ├── BLDC_drivers.md │ │ ├── index.md │ │ └── stepper_drivers.md │ ├── index.md │ ├── mcus │ │ ├── arduinos.md │ │ ├── esp32.md │ │ ├── index.md │ │ ├── nRF52_mcu.md │ │ ├── portenta.md │ │ ├── rpi_pico.md │ │ ├── samd.md │ │ ├── stm32.md │ │ └── teensy.md │ ├── motors │ │ ├── BLDC_motors.md │ │ ├── index.md │ │ └── stepper_motors.md │ ├── sensors.md │ └── setup_examples │ │ ├── arduino_l6234.md │ │ ├── bluepill_conneciton.md │ │ ├── drv8302.md │ │ ├── foc_shield.md │ │ ├── hmbgc.md │ │ ├── index.md │ │ └── nucleo_conneciton.md │ ├── index.md │ ├── installation │ ├── index.md │ ├── library_download.md │ ├── library_platformio.md │ └── minimal_download.md │ ├── simplefocstudio..md │ └── work_roadmap.md ├── extras ├── ArduinoFOCShieldV12.pdf ├── Images │ ├── 0.5.jpg │ ├── 0.6.jpg │ ├── 1.jpg │ ├── 3pwm_driver.png │ ├── 6pwm_driver.png │ ├── AFSV11_bottom.png │ ├── B-G431B-ESC1_SPL.jpg │ ├── BTS7960B.jpg │ ├── LPF_alpha.png │ ├── PID_der.png │ ├── PID_eq.png │ ├── PID_int.png │ ├── PID_pro.png │ ├── SHIELD_IFX007T.jpg │ ├── align_diagram.png │ ├── alm.gif │ ├── alpha.png │ ├── angle_loop.png │ ├── angle_loop_i.png │ ├── angle_loop_v.png │ ├── arduino_connection.png │ ├── arduino_connection_magnetic.png │ ├── arduino_uno.jpg │ ├── as5600.jpg │ ├── back_shield.jpg │ ├── battery.jpg │ ├── bgc31.jpg │ ├── bgc_30.jpg │ ├── big.jpg │ ├── bigger.jpg │ ├── bluepill.jpg │ ├── bluepill_foc_shield.jpg │ ├── bluepill_foc_shield_thumb.jpg │ ├── bluepill_foc_shield_v13.png │ ├── bluepill_pinout.jpg │ ├── c2216.png │ ├── closed_loop.gif │ ├── cmd1.png │ ├── cmd2.png │ ├── cmd3.png │ ├── cmd4.png │ ├── cmd5.png │ ├── cmd6.png │ ├── cmd7.png │ ├── cmd_motor.gif │ ├── cmd_motor_get.gif │ ├── community.png │ ├── comparison_cs.png │ ├── connection.gif │ ├── connection.png │ ├── contPID.png │ ├── cont_LPF.png │ ├── d1_r32.jpg │ ├── dagor.png │ ├── dc_current_mode.png │ ├── dc_motor.gif │ ├── dead_zone.png │ ├── dis_LPF.png │ ├── dis_PI.png │ ├── drv8301.png │ ├── drv8302.png │ ├── drv8302_arduino_connection.jpg │ ├── drv8302_connection.jpg │ ├── drv8302_connection_thumb.jpg │ ├── drv8302_example.jpg │ ├── due.jpg │ ├── ebay.jpg │ ├── ebay2.jpg │ ├── enc.jpg │ ├── enc0.jpg │ ├── enc1.png │ ├── esp32.jpg │ ├── feather_basic.jpg │ ├── feather_express.jpg │ ├── foc_current_mode.png │ ├── foc_modulation.png │ ├── foc_modulation_svm.png │ ├── foc_pendulum.jpg │ ├── foc_shield_v13.jpg │ ├── foc_shield_v13.png │ ├── foc_shield_v13_analog.png │ ├── foc_shield_v13_enc.png │ ├── foc_shield_v13_hall.png │ ├── foc_shield_v13_magI2C.png │ ├── foc_shield_v13_magSPI.png │ ├── foc_shield_v13_nucleo.png │ ├── foc_shield_video.jpg │ ├── gauge_connection.jpg │ ├── hall.png │ ├── hall1.png │ ├── hall_schema.jpg │ ├── hallw.png │ ├── haptics.png │ ├── high-side.png │ ├── high_side_sync.png │ ├── hmbgc_connection.png │ ├── hmbgc_v22.jpg │ ├── hmbgc_v22_velocity_control.jpg │ ├── hor_cad_shield.jpg │ ├── in-line.png │ ├── interactive_example.png │ ├── inverse_clarke.png │ ├── inverse_park.png │ ├── jk42.png │ ├── l298n.jpg │ ├── l6234.jpg │ ├── library_.png │ ├── library_min_.png │ ├── limits.png │ ├── low-side.png │ ├── low_side_sync.png │ ├── mad5008.png │ ├── mag.jpg │ ├── mag0.jpg │ ├── mag2.jpg │ ├── mega.png │ ├── minimal.gif │ ├── mkr1000.jpg │ ├── mkr1010.jpg │ ├── ml4114.png │ ├── mot.jpg │ ├── mot2.jpg │ ├── mot3.jpg │ ├── motor_cmd.png │ ├── ms1508.jpg │ ├── n2830.png │ ├── nano.png │ ├── nano33.png │ ├── nema14.jpg │ ├── nema17_1.jpg │ ├── nema17_2.jpg │ ├── nema23.jpg │ ├── nucleo.jpg │ ├── nucleo_foc_shield.jpg │ ├── nucleo_foc_shield_connection.jpg │ ├── open_loop.gif │ ├── open_loop_angle.png │ ├── open_loop_velocity.png │ ├── pico.jpg │ ├── pinout.jpg │ ├── plotter.jpg │ ├── pololu.jpg │ ├── position.png │ ├── position_control_example.jpg │ ├── powershield.jpg │ ├── pwm_sensor.png │ ├── sd_m13.jpg │ ├── shield_bo_v13.jpg │ ├── shield_bot_v131.png │ ├── shield_bot_v131_config_double.png │ ├── shield_bot_v131_config_double_ard.png │ ├── shield_bot_v131_config_double_nucleo.png │ ├── shield_bot_v131_config_single.png │ ├── shield_bot_v131_pinout.gif │ ├── shield_bot_v131_pullup_enable.png │ ├── shield_bot_v131_side.png │ ├── shield_bot_v132_i2c_pullup_enable.png │ ├── shield_bot_v201_pinout.gif │ ├── shield_monster.jpg │ ├── shield_to_v13.jpg │ ├── shield_top_v13.png │ ├── shield_top_v131.png │ ├── shield_v13.png │ ├── shiled_stepper.jpg │ ├── shiled_stepper1.jpg │ ├── shiled_stepper3.jpg │ ├── side2_shield.jpg │ ├── side_shield.jpg │ ├── simple_foc_shield_v13_small.gif │ ├── sine_foc.png │ ├── source_docs.jpg │ ├── steer_by_wire_connection.jpg │ ├── stepper4pwm.png │ ├── stepper_2pwm_one_dir.png │ ├── stepper_2pwm_two_dir.png │ ├── stepper_connection.png │ ├── stepper_example.png │ ├── stepper_limits.png │ ├── strom.jpg │ ├── svm0.5.jpg │ ├── svm_1.png │ ├── svm_dc.png │ ├── teensy32.jpg │ ├── teensy41_4.jpg │ ├── terminal.jpg │ ├── top_shield.jpg │ ├── torque_loop_i.png │ ├── torque_loop_v.png │ ├── torque_modes.gif │ ├── track.png │ ├── uno_l6234.jpg │ ├── uno_l6234_velocity.jpg │ ├── v2_adc.gif │ ├── v2_ard1.jpg │ ├── v2_ard2.jpg │ ├── v2_hall.jpg │ ├── v2_i2c.jpg │ ├── v2_ldo.jpg │ ├── v2_nuc1.jpg │ ├── v2_nuc2.jpg │ ├── v2_single.jpg │ ├── velocity_loop.png │ ├── velocity_loop_i.png │ ├── velocity_loop_v.png │ ├── voltage_loop.png │ ├── voltage_mode.png │ ├── youtube.png │ ├── youtube_drv8302.png │ ├── youtube_haptic.png │ ├── youtube_pendulum.png │ └── youtube_stepper.png ├── esp32 │ └── mcpwm.h └── fabrication │ ├── 3d_model.zip │ ├── BOM.xlsx │ ├── Gerber.zip │ └── schematic.pdf ├── favicon.ico ├── index.md ├── just-the-docs.gemspec ├── lib └── tasks │ └── search.rake ├── logo.png └── script └── build /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: Ask a question 4 | url: https://github.com/pmarsceill/just-the-docs/discussions 5 | about: Ask questions and discuss with other community members 6 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/workflows/ci-master.yml: -------------------------------------------------------------------------------- 1 | on: 2 | push: 3 | branches: 4 | - master 5 | 6 | name: Master branch CI 7 | 8 | jobs: 9 | 10 | jekyll-latest: 11 | name: Build Jekyll site (latest) 12 | runs-on: ubuntu-latest 13 | steps: 14 | 15 | - uses: actions/checkout@master 16 | 17 | - name: Build the site in the jekyll/builder container 18 | run: | 19 | docker run --rm \ 20 | --volume="${{ github.workspace }}:/srv/jekyll" \ 21 | jekyll/builder:latest /bin/bash -c "gem install bundler && chmod -R 777 /srv/jekyll && jekyll build && bundle exec just-the-docs rake search:init" 22 | jekyll-3-8-5: 23 | name: Build Jekyll site (v3.8.5) 24 | runs-on: ubuntu-latest 25 | steps: 26 | 27 | - uses: actions/checkout@master 28 | 29 | - name: Build the site in the jekyll/builder container 30 | run: | 31 | docker run --rm \ 32 | --volume="${{ github.workspace }}:/srv/jekyll" \ 33 | jekyll/builder:3.8.5 /bin/bash -c "gem install bundler && chmod -R 777 /srv/jekyll && jekyll build && bundle exec just-the-docs rake search:init" 34 | assets: 35 | name: Format and test CSS and JS 36 | runs-on: ubuntu-latest 37 | 38 | steps: 39 | - uses: actions/checkout@v2 40 | - name: Use Node.js 12.x 41 | uses: actions/setup-node@v1 42 | with: 43 | node-version: '12.x' 44 | - run: npm install 45 | - run: npm test 46 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | on: [pull_request] 2 | 3 | name: CI 4 | 5 | jobs: 6 | 7 | jekyll-latest: 8 | name: Build Jekyll site (latest) 9 | runs-on: ubuntu-latest 10 | steps: 11 | 12 | - uses: actions/checkout@master 13 | 14 | - name: Build the site in the jekyll/builder container 15 | run: | 16 | docker run --rm \ 17 | --volume="${{ github.workspace }}:/srv/jekyll" \ 18 | jekyll/builder:latest /bin/bash -c "gem install bundler && chmod -R 777 /srv/jekyll && jekyll build && bundle exec just-the-docs rake search:init" 19 | 20 | jekyll-3-8-5: 21 | name: Build Jekyll site (v3.8.5) 22 | runs-on: ubuntu-latest 23 | steps: 24 | 25 | - uses: actions/checkout@master 26 | 27 | - name: Build the site in the jekyll/builder container 28 | run: | 29 | docker run --rm \ 30 | --volume="${{ github.workspace }}:/srv/jekyll" \ 31 | jekyll/builder:3.8.5 /bin/bash -c "gem install bundler && chmod -R 777 /srv/jekyll && jekyll build && bundle exec just-the-docs rake search:init" 32 | 33 | assets: 34 | name: Format and test CSS and JS 35 | runs-on: ubuntu-latest 36 | 37 | steps: 38 | - uses: actions/checkout@v2 39 | # Using this so the this instead of GITHUB_TOKEN so that this workflow can trigger another 40 | with: 41 | token: ${{ secrets.PAT }} 42 | - name: Use Node.js 12.x 43 | uses: actions/setup-node@v1 44 | with: 45 | node-version: '12.x' 46 | - name: Extract branch name 47 | shell: bash 48 | run: echo "##[set-output name=branch;]$(echo ${GITHUB_HEAD_REF#refs/heads/})" 49 | id: extract_branch 50 | 51 | - run: npm install 52 | - run: npm run format 53 | - name: Add changed files 54 | run: | 55 | echo "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY.git" 56 | git config --global user.email $GITHUB_ACTOR@users.noreply.github.com 57 | git config --global user.name $GITHUB_ACTOR 58 | echo "extracted branch is ${{ steps.extract_branch.outputs.branch }}" 59 | git checkout -b ${{ steps.extract_branch.outputs.branch }} 60 | git status 61 | git add . 62 | - name: Are there any updates? 63 | shell: bash 64 | run: echo "##[set-output name=status]$(git status -s)" 65 | id: is_dirty 66 | - name: Commit files 67 | if: steps.is_dirty.outputs.status 68 | run: | 69 | echo ${{ steps.is_dirty.outputs.status }} 70 | git commit -m "🎨 Prettier" 71 | git push --force --set-upstream "https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" ${{ steps.extract_branch.outputs.branch }} 72 | - run: npm test 73 | -------------------------------------------------------------------------------- /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | name: Publish Gem 2 | 3 | on: [release] 4 | 5 | jobs: 6 | build: 7 | name: Build + Publish 8 | runs-on: ubuntu-latest 9 | 10 | steps: 11 | - uses: actions/checkout@master 12 | - name: Set up Ruby 2.6 13 | uses: actions/setup-ruby@v1 14 | with: 15 | version: 2.6.x 16 | 17 | - name: Publish to GPR 18 | run: | 19 | mkdir -p $HOME/.gem 20 | touch $HOME/.gem/credentials 21 | chmod 0600 $HOME/.gem/credentials 22 | printf -- "---\n:github: Bearer ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials 23 | gem build just-the-docs.gemspec 24 | gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem 25 | env: 26 | GEM_HOST_API_KEY: ${{secrets.GPR_AUTH_TOKEN}} 27 | OWNER: pmarsceill 28 | 29 | - name: Publish to RubyGems 30 | run: | 31 | mkdir -p $HOME/.gem 32 | touch $HOME/.gem/credentials 33 | chmod 0600 $HOME/.gem/credentials 34 | printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials 35 | gem build just-the-docs.gemspec 36 | gem push *.gem 37 | env: 38 | GEM_HOST_API_KEY: ${{secrets.RUBYGEMS_AUTH_TOKEN}} 39 | 40 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.gem 2 | .bundle 3 | .sass-cache 4 | _site 5 | Gemfile.lock 6 | node_modules 7 | .jekyll-cache -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | package.json 2 | package-lock.json 3 | _site 4 | assets/css/dark-mode-preview.scss 5 | assets/css/just-the-docs.scss 6 | assets/js/vendor/lunr.min.js 7 | assets/js/search-data.json 8 | assets/js/just-the-docs.js 9 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "endOfLine": "lf", 3 | "semi": false, 4 | "singleQuote": false, 5 | "tabWidth": 2, 6 | "trailingComma": "es5" 7 | } 8 | 9 | -------------------------------------------------------------------------------- /.stylelintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "ignoreFiles": [ 3 | "assets/css/just-the-docs.scss", 4 | "assets/css/dark-mode-preview.scss", 5 | "_sass/vendor/**/*.scss" 6 | ], 7 | "extends": ["stylelint-config-primer", "stylelint-config-prettier"], 8 | "plugins": ["stylelint-prettier"], 9 | "rules": { 10 | "prettier/prettier": true 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /404.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: Page not found 4 | permalink: /404 5 | nav_exclude: true 6 | search_exclude: true 7 | --- 8 | 9 |

Page not found

10 | 11 |

The page you requested could not be found. Try using the navigation {% if site.search_enabled %}or search {% endif %}to find what you're looking for or go to this site's home page.

12 | -------------------------------------------------------------------------------- /CNAME: -------------------------------------------------------------------------------- 1 | docs.simplefoc.com -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | gemspec 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Simple**FOC**library 中文文档 2 | Simple**FOC**library 中文文档,官方Github 3 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | # Welcome to Jekyll! 2 | # 3 | # This config file is meant for settings that affect your whole site, values 4 | # which you are expected to set up once and rarely edit after that. If you find 5 | # yourself editing these this file very often, consider using Jekyll's data files 6 | # feature for the data you need to update frequently. 7 | # 8 | # For technical reasons, this file is *NOT* reloaded automatically when you use 9 | # 'jekyll serve'. If you change this file, please restart the server process. 10 | 11 | # Site settings 12 | # These are used to personalize your new site. If you look in the HTML files, 13 | # you will see them accessed via {{ site.title }}, {{ site.github_repo }}, and so on. 14 | # You can create any custom variable you would like, and they will be accessible 15 | # in the templates via {{ site.myvariable }}. 16 | title: Arduino-FOC 17 | description: An Arduino Bases Field Oriented Control(FOC) library documentation 18 | baseurl: "/" 19 | url: "https://docs.simplefoc.com" 20 | 21 | permalink: pretty 22 | exclude: ["node_modules/", "*.gemspec", "*.gem", "Gemfile", "Gemfile.lock", "package.json", "package-lock.json", "script/", "LICENSE.txt", "lib/", "bin/", "README.md", "Rakefile"] 23 | 24 | # Set a path/url to a logo that will be displayed instead of the title 25 | #logo: "/assets/images/logo.png" 26 | 27 | # Enable or disable the site search 28 | search_enabled: true 29 | 30 | # Set the search token separator for hyphenated-word search: 31 | search_tokenizer_separator: /[\s/]+/ 32 | 33 | # Enable or disable heading anchors 34 | heading_anchors: true 35 | 36 | # Aux links for the upper right navigation 37 | aux_links: 38 | "Arduino SimpleFOC on GitHub": 39 | - "https://github.com/simplefoc" 40 | "Order Arduino SimpleFOC Shield": 41 | - "https://simplefoc.com/simplefoc_shield_product" 42 | 43 | # Footer content appears at the bottom of every page's main content 44 | footer_content: "Copyright © 2020. Distributed by an MIT license." 45 | 46 | # Color scheme currently only supports "dark" or nil (default) 47 | color_scheme: nil 48 | 49 | # Google Analytics Tracking (optional) 50 | # e.g, UA-1234567-89 51 | ga_tracking: UA-55976594-3 52 | 53 | plugins: 54 | - jekyll-seo-tag 55 | 56 | compress_html: 57 | clippings: all 58 | comments: all 59 | endings: all 60 | startings: [] 61 | blanklines: false 62 | profile: false 63 | -------------------------------------------------------------------------------- /_includes/head.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {% if site.plugins.jekyll-seo == nil %} 6 | {{ page.title | replace: '&', '&' | markdownify | strip_html | escape_once | remove: 'Table of contents' | remove: '```' | remove: '---' | replace: '\', ' ' | replace: ' . . . ', ' . ' | replace: ' . . ', ' . ' }} | {{ site.title }} 7 | 8 | {% if page.description %} 9 | 10 | {% endif %} 11 | {% endif %} 12 | 13 | 14 | 15 | 16 | 17 | 18 | {% if site.ga_tracking != nil %} 19 | 20 | 27 | 28 | {% endif %} 29 | 30 | {% if site.search_enabled != false %} 31 | 32 | {% endif %} 33 | 34 | 35 | 36 | 37 | {% seo %} 38 | 39 | {% include head_custom.html %} 40 | 41 | 42 | -------------------------------------------------------------------------------- /_includes/head_custom.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /_includes/title.html: -------------------------------------------------------------------------------- 1 | {% if site.logo %} 2 | 3 | {% else %} 4 | {{ site.title }} 5 | {% endif %} 6 | -------------------------------------------------------------------------------- /_layouts/about.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 | 5 | {{ content }} 6 | -------------------------------------------------------------------------------- /_layouts/home.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 | 5 | {{ content }} 6 | -------------------------------------------------------------------------------- /_layouts/page.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 | 5 | {{ content }} 6 | -------------------------------------------------------------------------------- /_layouts/post.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 | 5 | {{ content }} 6 | -------------------------------------------------------------------------------- /_layouts/table_wrappers.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: vendor/compress 3 | --- 4 | 5 | {% assign content_ = content | replace: '', '' %} 7 | {{ content_ }} -------------------------------------------------------------------------------- /_sass/base.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Base element style overrides 3 | // 4 | // stylelint-disable selector-no-type, selector-max-type 5 | 6 | * { 7 | box-sizing: border-box; 8 | } 9 | 10 | ::selection { 11 | color: $white; 12 | background: $link-color; 13 | } 14 | 15 | html { 16 | @include fs-4; 17 | } 18 | 19 | body { 20 | font-family: $body-font-family; 21 | font-size: 0.93em; 22 | font-weight: 300; 23 | font-style: normal; 24 | line-height: $body-line-height; 25 | color: $body-text-color; 26 | background-color: $body-background-color; 27 | } 28 | 29 | p, 30 | h1, 31 | h2, 32 | h3, 33 | h4, 34 | h5, 35 | h6, 36 | ol, 37 | ul, 38 | pre, 39 | address, 40 | blockquote, 41 | dl, 42 | div, 43 | fieldset, 44 | form, 45 | hr, 46 | noscript, 47 | table { 48 | margin-top: 0; 49 | } 50 | 51 | h1, 52 | h2, 53 | h3, 54 | h4, 55 | h5, 56 | h6 { 57 | margin-top: 1.2em; 58 | margin-bottom: 0.8em; 59 | font-weight: 500; 60 | line-height: $body-heading-line-height; 61 | color: $body-heading-color; 62 | } 63 | 64 | p { 65 | margin-bottom: 1em; 66 | } 67 | 68 | a { 69 | color: $link-color; 70 | text-decoration: none !important; 71 | } 72 | 73 | a:not([class]) { 74 | text-decoration: none; 75 | background-image: linear-gradient($border-color 0%, $border-color 100%); 76 | background-repeat: repeat-x; 77 | background-position: 0 100%; 78 | background-size: 1px 1px; 79 | 80 | &:hover { 81 | background-image: linear-gradient( 82 | rgba($link-color, 0.45) 0%, 83 | rgba($link-color, 0.45) 100% 84 | ); 85 | background-size: 1px 1px; 86 | } 87 | } 88 | 89 | code { 90 | font-family: $mono-font-family; 91 | font-size: 12px; 92 | line-height: $body-line-height; 93 | } 94 | 95 | figure, 96 | pre { 97 | margin: 0; 98 | } 99 | 100 | li { 101 | margin: 0.25em 0; 102 | } 103 | 104 | img { 105 | max-width: 100%; 106 | height: auto; 107 | } 108 | 109 | hr { 110 | height: 1px; 111 | padding: 0; 112 | margin: $sp-6 0; 113 | background-color: $border-color; 114 | border: 0; 115 | } 116 | -------------------------------------------------------------------------------- /_sass/buttons.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Buttons and things that look like buttons 3 | // 4 | // stylelint-disable color-named 5 | 6 | .btn { 7 | display: inline-block; 8 | box-sizing: border-box; 9 | padding-top: 0.3em; 10 | padding-right: 1em; 11 | padding-bottom: 0.3em; 12 | padding-left: 1em; 13 | margin: 0; 14 | font-family: inherit; 15 | font-size: inherit; 16 | font-weight: 500; 17 | line-height: 1.5; 18 | color: $link-color; 19 | text-decoration: none; 20 | vertical-align: baseline; 21 | cursor: pointer; 22 | background-color: $base-button-color; 23 | border-width: 0; 24 | border-radius: $border-radius; 25 | box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 3px 10px rgba(0, 0, 0, 0.08); 26 | appearance: none; 27 | 28 | &:focus { 29 | text-decoration: none; 30 | outline: none; 31 | box-shadow: 0 0 0 3px rgba(blue, 0.25); 32 | } 33 | 34 | &:focus:hover, 35 | &.selected:focus { 36 | box-shadow: 0 0 0 3px rgba(blue, 0.25); 37 | } 38 | 39 | &:hover, 40 | &.zeroclipboard-is-hover { 41 | color: darken($link-color, 2%); 42 | } 43 | 44 | &:hover, 45 | &:active, 46 | &.zeroclipboard-is-hover, 47 | &.zeroclipboard-is-active { 48 | text-decoration: none; 49 | background-color: darken($base-button-color, 1%); 50 | } 51 | 52 | &:active, 53 | &.selected, 54 | &.zeroclipboard-is-active { 55 | background-color: darken($base-button-color, 3%); 56 | background-image: none; 57 | box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15); 58 | } 59 | 60 | &.selected:hover { 61 | background-color: darken(#dcdcdc, 5%); 62 | } 63 | 64 | &:disabled, 65 | &.disabled { 66 | &, 67 | &:hover { 68 | color: rgba(102, 102, 102, 0.5); 69 | cursor: default; 70 | background-color: rgba(229, 229, 229, 0.5); 71 | background-image: none; 72 | box-shadow: none; 73 | } 74 | } 75 | } 76 | 77 | .btn-outline { 78 | color: $link-color; 79 | background: transparent; 80 | box-shadow: inset 0 0 0 2px $grey-lt-300; 81 | 82 | &:hover, 83 | &:active, 84 | &.zeroclipboard-is-hover, 85 | &.zeroclipboard-is-active { 86 | color: darken($link-color, 4%); 87 | text-decoration: none; 88 | background-color: transparent; 89 | box-shadow: inset 0 0 0 3px $grey-lt-300; 90 | } 91 | 92 | &:focus { 93 | text-decoration: none; 94 | outline: none; 95 | box-shadow: inset 0 0 0 2px $grey-dk-100, 0 0 0 3px rgba(blue, 0.25); 96 | } 97 | 98 | &:focus:hover, 99 | &.selected:focus { 100 | box-shadow: inset 0 0 0 2px $grey-dk-100; 101 | } 102 | } 103 | 104 | .btn-primary { 105 | @include btn-color($white, $btn-primary-color); 106 | } 107 | 108 | .btn-purple { 109 | @include btn-color($white, $purple-100); 110 | } 111 | 112 | .btn-blue { 113 | @include btn-color($white, $blue-000); 114 | } 115 | 116 | .btn-green { 117 | @include btn-color($white, $green-100); 118 | } 119 | -------------------------------------------------------------------------------- /_sass/color_schemes/dark.scss: -------------------------------------------------------------------------------- 1 | $body-background-color: $grey-dk-300; 2 | $sidebar-color: $grey-dk-300; 3 | $border-color: $grey-dk-200; 4 | 5 | $body-text-color: $grey-lt-300; 6 | $body-heading-color: $grey-lt-000; 7 | $nav-child-link-color: $grey-dk-000; 8 | $search-result-preview-color: $grey-dk-000; 9 | 10 | $link-color: $blue-000; 11 | $btn-primary-color: $blue-200; 12 | $base-button-color: $grey-dk-250; 13 | 14 | $code-background-color: $grey-dk-250; 15 | $search-background-color: $grey-dk-250; 16 | $table-background-color: $grey-dk-250; 17 | -------------------------------------------------------------------------------- /_sass/content.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | // 4 | // Styles for rendered markdown in the .main-content container 5 | // 6 | // stylelint-disable selector-no-type, max-nesting-depth, selector-max-compound-selectors, selector-max-type 7 | 8 | .page-content { 9 | line-height: $content-line-height; 10 | 11 | a { 12 | overflow: hidden; 13 | text-overflow: ellipsis; 14 | white-space: nowrap; 15 | } 16 | 17 | ul, 18 | ol { 19 | padding-left: 1.5em; 20 | } 21 | 22 | ol { 23 | list-style-type: none; 24 | counter-reset: step-counter; 25 | 26 | > li { 27 | position: relative; 28 | 29 | &::before { 30 | position: absolute; 31 | top: 0.2em; 32 | left: -1.6em; 33 | color: $grey-dk-000; 34 | content: counter(step-counter); 35 | counter-increment: step-counter; 36 | @include fs-3; 37 | 38 | @include mq(sm) { 39 | top: 0.11em; 40 | } 41 | } 42 | 43 | ol { 44 | counter-reset: sub-counter; 45 | 46 | li { 47 | &::before { 48 | content: counter(sub-counter, lower-alpha); 49 | counter-increment: sub-counter; 50 | } 51 | } 52 | } 53 | } 54 | } 55 | 56 | ul { 57 | list-style: none; 58 | 59 | > li { 60 | &::before { 61 | position: absolute; 62 | margin-left: -1.4em; 63 | color: $grey-dk-000; 64 | content: "•"; 65 | } 66 | } 67 | } 68 | 69 | .task-list { 70 | padding-left: 0; 71 | } 72 | 73 | .task-list-item { 74 | display: flex; 75 | align-items: center; 76 | 77 | &::before { 78 | content: ""; 79 | } 80 | } 81 | 82 | .task-list-item-checkbox { 83 | margin-right: 0.6em; 84 | } 85 | 86 | hr + * { 87 | margin-top: 0; 88 | } 89 | 90 | h1:first-of-type { 91 | margin-top: 0.5em; 92 | } 93 | 94 | dl { 95 | display: grid; 96 | grid-template-columns: max-content 1fr; 97 | } 98 | 99 | dt, 100 | dd { 101 | margin: 0.25em 0; 102 | } 103 | 104 | dt { 105 | text-align: right; 106 | 107 | &::after { 108 | content: ":"; 109 | } 110 | } 111 | 112 | dd { 113 | margin-left: 1em; 114 | font-weight: 500; 115 | } 116 | 117 | .anchor-heading { 118 | position: absolute; 119 | right: -$sp-4; 120 | width: $sp-5; 121 | height: 100%; 122 | padding-right: $sp-1; 123 | padding-left: $sp-1; 124 | overflow: visible; 125 | 126 | @include mq(md) { 127 | right: auto; 128 | left: -$sp-5; 129 | } 130 | 131 | svg { 132 | display: inline-block; 133 | width: 100%; 134 | height: 100%; 135 | fill: $link-color; 136 | visibility: hidden; 137 | } 138 | } 139 | 140 | .anchor-heading:hover, 141 | h1:hover > .anchor-heading, 142 | h2:hover > .anchor-heading, 143 | h3:hover > .anchor-heading, 144 | h4:hover > .anchor-heading, 145 | h5:hover > .anchor-heading, 146 | h6:hover > .anchor-heading { 147 | svg { 148 | visibility: visible; 149 | } 150 | } 151 | 152 | h1, 153 | h2, 154 | h3, 155 | h4, 156 | h5, 157 | h6 { 158 | position: relative; 159 | } 160 | } 161 | -------------------------------------------------------------------------------- /_sass/labels.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Labels (not the form kind) 3 | // 4 | 5 | .label, 6 | .label-blue { 7 | display: inline-block; 8 | padding-top: 0.16em; 9 | padding-right: 0.42em; 10 | padding-bottom: 0.16em; 11 | padding-left: 0.42em; 12 | margin-right: $sp-1; 13 | margin-left: $sp-1; 14 | color: $white; 15 | text-transform: uppercase; 16 | vertical-align: middle; 17 | background-color: $blue-100; 18 | @include fs-2; 19 | } 20 | 21 | .label-green { 22 | background-color: $green-200; 23 | } 24 | 25 | .label-purple { 26 | background-color: $purple-100; 27 | } 28 | 29 | .label-red { 30 | background-color: $red-200; 31 | } 32 | 33 | .label-yellow { 34 | color: $grey-dk-200; 35 | background-color: $yellow-200; 36 | } 37 | -------------------------------------------------------------------------------- /_sass/navigation.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Main nav, breadcrumb, etc... 3 | // 4 | .navigation-list { 5 | padding: 0; 6 | margin-top: 0; 7 | margin-bottom: 0; 8 | list-style: none; 9 | } 10 | 11 | .navigation-list-link { 12 | color:$nav-child-link-color; 13 | font-weight: bold; 14 | } 15 | 16 | .navigation-list-child-list { 17 | padding-left: $sp-3; 18 | list-style: none; 19 | 20 | .navigation-list-link { 21 | color: $nav-child-link-color; 22 | font-weight: 300; 23 | } 24 | 25 | .navigation-list-item { 26 | position: relative; 27 | 28 | &::before { 29 | position: absolute; 30 | margin-top: 0.3em; 31 | margin-left: -0.8em; 32 | color: rgba($body-text-color, 0.3); 33 | } 34 | 35 | &.active { 36 | &::before { 37 | color: $body-text-color; 38 | } 39 | } 40 | } 41 | } 42 | 43 | .navigation-list-item { 44 | @include fs-4; 45 | margin: 0; 46 | 47 | @include mq(md) { 48 | @include fs-4; 49 | } 50 | 51 | .grand-child-list { 52 | display: none; 53 | @include fs-3; 54 | } 55 | .grand-grand-child-list { 56 | display: none; 57 | @include fs-3; 58 | } 59 | .grand-grand-grand-child-list { 60 | display: none; 61 | @include fs-3; 62 | } 63 | .child-list { 64 | display: bock; 65 | @include fs-4; 66 | } 67 | 68 | 69 | &.active { 70 | .child-list { 71 | display: block; 72 | 73 | &.active{ 74 | .grand-child-list{ 75 | display: block; 76 | 77 | &.active{ 78 | .grand-grand-child-list{ 79 | display: block; 80 | 81 | &.active{ 82 | .grand-grand-grand-child-list{ 83 | display: block; 84 | } 85 | } 86 | } 87 | } 88 | } 89 | } 90 | } 91 | } 92 | } 93 | 94 | 95 | .navigation-list-link { 96 | display: block; 97 | padding-top: $sp-1; 98 | padding-bottom: $sp-1; 99 | //color: $nav-child-link-color; 100 | color: #616161; 101 | 102 | &.active { 103 | font-weight: 600; 104 | color: #44a8fa; 105 | text-decoration: none; 106 | } 107 | } 108 | 109 | // Small screen nav 110 | 111 | .main-nav { 112 | display: none; 113 | 114 | &.nav-open { 115 | display: block; 116 | } 117 | @include mq(md) { 118 | display: block; 119 | } 120 | } 121 | 122 | .aux-nav { 123 | align-self: center; 124 | } 125 | 126 | // Breadcrumb nav 127 | .breadcrumb-nav { 128 | @include mq(md) { 129 | margin-top: -$sp-4; 130 | } 131 | } 132 | 133 | .breadcrumb-nav-list { 134 | padding-left: 0; 135 | margin-bottom: $sp-3; 136 | list-style: none; 137 | } 138 | 139 | .breadcrumb-nav-list-item { 140 | display: table-cell; 141 | @include fs-2; 142 | 143 | &::before { 144 | display: none; 145 | } 146 | 147 | &::after { 148 | display: inline-block; 149 | margin-right: $sp-2; 150 | margin-left: $sp-2; 151 | color: $grey-dk-000; 152 | content: "/"; 153 | } 154 | 155 | &:last-child { 156 | &::after { 157 | content: ""; 158 | } 159 | } 160 | } 161 | -------------------------------------------------------------------------------- /_sass/support/_functions.scss: -------------------------------------------------------------------------------- 1 | @function rem($size, $unit: "") { 2 | $remSize: $size / $root-font-size; 3 | 4 | @if ($unit == false) { 5 | @return #{$remSize}; 6 | } @else { 7 | @return #{$remSize}rem; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /_sass/support/mixins/_buttons.scss: -------------------------------------------------------------------------------- 1 | // Colored button 2 | 3 | @mixin btn-color($fg, $bg) { 4 | color: $fg; 5 | background-color: darken($bg, 2%); 6 | background-image: linear-gradient(lighten($bg, 5%), darken($bg, 2%)); 7 | box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), 0 4px 10px rgba(0, 0, 0, 0.12); 8 | 9 | &:hover, 10 | &.zeroclipboard-is-hover { 11 | color: $fg; 12 | background-color: darken($bg, 4%); 13 | background-image: linear-gradient((lighten($bg, 2%), darken($bg, 4%))); 14 | } 15 | 16 | &:active, 17 | &.selected, 18 | &.zeroclipboard-is-active { 19 | background-color: darken($bg, 5%); 20 | background-image: none; 21 | box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15); 22 | } 23 | 24 | &.selected:hover { 25 | background-color: darken($bg, 10%); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /_sass/support/mixins/_layout.scss: -------------------------------------------------------------------------------- 1 | // Media query 2 | 3 | // Media query mixin 4 | // Usage: 5 | // @include mq(md) { 6 | // ..medium and up styles 7 | // } 8 | @mixin mq($name) { 9 | // Retrieves the value from the key 10 | $value: map-get($media-queries, $name); 11 | 12 | // If the key exists in the map 13 | @if $value != null { 14 | // Prints a media query based on the value 15 | @media (min-width: rem($value)) { 16 | @content; 17 | } 18 | } @else { 19 | @warn "No value could be retrieved from `#{$media-query}`. " 20 | + "Please make sure it is defined in `$media-queries` map."; 21 | } 22 | } 23 | 24 | // Responsive container 25 | 26 | @mixin container { 27 | padding-right: $gutter-spacing-sm; 28 | padding-left: $gutter-spacing-sm; 29 | 30 | @include mq(md) { 31 | padding-right: $gutter-spacing; 32 | padding-left: $gutter-spacing; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /_sass/support/mixins/_typography.scss: -------------------------------------------------------------------------------- 1 | // Font size 2 | 3 | @mixin fs-1 { 4 | font-size: 9px !important; 5 | 6 | @include mq(sm) { 7 | font-size: 10px !important; 8 | } 9 | } 10 | 11 | @mixin fs-2 { 12 | font-size: 11px !important; 13 | 14 | @include mq(sm) { 15 | font-size: 12px !important; 16 | } 17 | } 18 | 19 | @mixin fs-3 { 20 | font-size: 12px !important; 21 | 22 | @include mq(sm) { 23 | font-size: 14px !important; 24 | } 25 | } 26 | 27 | @mixin fs-4 { 28 | font-size: 14px !important; 29 | 30 | @include mq(sm) { 31 | font-size: 16px !important; 32 | } 33 | } 34 | 35 | @mixin fs-5 { 36 | font-size: 16px !important; 37 | 38 | @include mq(sm) { 39 | font-size: 18px !important; 40 | } 41 | } 42 | 43 | @mixin fs-6 { 44 | font-size: 18px !important; 45 | 46 | @include mq(sm) { 47 | font-size: 24px !important; 48 | } 49 | } 50 | 51 | @mixin fs-7 { 52 | font-size: 24px !important; 53 | 54 | @include mq(sm) { 55 | font-size: 32px !important; 56 | } 57 | } 58 | 59 | @mixin fs-8 { 60 | font-size: 32px !important; 61 | 62 | @include mq(sm) { 63 | font-size: 36px !important; 64 | } 65 | } 66 | 67 | @mixin fs-9 { 68 | font-size: 36px !important; 69 | 70 | @include mq(sm) { 71 | font-size: 42px !important; 72 | } 73 | } 74 | 75 | @mixin fs-10 { 76 | font-size: 42px !important; 77 | 78 | @include mq(sm) { 79 | font-size: 48px !important; 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /_sass/support/mixins/mixins.scss: -------------------------------------------------------------------------------- 1 | @import "./layout"; 2 | @import "./buttons"; 3 | @import "./typography"; 4 | -------------------------------------------------------------------------------- /_sass/support/support.scss: -------------------------------------------------------------------------------- 1 | @import "./variables"; 2 | @import "./functions"; 3 | @import "./mixins/mixins"; 4 | -------------------------------------------------------------------------------- /_sass/tables.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Tables 3 | // 4 | // stylelint-disable max-nesting-depth, selector-no-type, selector-max-type 5 | 6 | .table-wrapper { 7 | display: block; 8 | width: 100%; 9 | max-width: 100%; 10 | margin-bottom: $sp-5; 11 | overflow-x: auto; 12 | border-radius: $border-radius; 13 | box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 3px 10px rgba(0, 0, 0, 0.08); 14 | } 15 | 16 | table { 17 | display: table; 18 | min-width: 100%; 19 | border-collapse: separate; 20 | } 21 | 22 | th, 23 | td { 24 | @include fs-3; 25 | min-width: 120px; 26 | padding-top: $sp-2; 27 | padding-right: $sp-3; 28 | padding-bottom: $sp-2; 29 | padding-left: $sp-3; 30 | background-color: $table-background-color; 31 | border-bottom: $border rgba($border-color, 0.5); 32 | border-left: $border $border-color; 33 | 34 | &:first-of-type { 35 | border-left: 0; 36 | } 37 | } 38 | 39 | tbody { 40 | tr { 41 | &:last-of-type { 42 | th, 43 | td { 44 | border-bottom: 0; 45 | } 46 | 47 | td { 48 | padding-bottom: $sp-3; 49 | } 50 | } 51 | } 52 | } 53 | 54 | thead { 55 | th { 56 | border-bottom: $border $border-color; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /_sass/typography.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Typography 3 | // 4 | // stylelint-disable primer/selector-no-utility, primer/no-override, selector-no-type, selector-max-type 5 | 6 | h1, 7 | .text-alpha { 8 | @include fs-8; 9 | font-weight: 300; 10 | } 11 | 12 | h2, 13 | .text-beta { 14 | @include fs-6; 15 | } 16 | 17 | h3, 18 | .text-gamma { 19 | @include fs-5; 20 | } 21 | 22 | h4, 23 | .text-delta { 24 | @include fs-2; 25 | font-weight: 300; 26 | text-transform: uppercase; 27 | letter-spacing: 0.1em; 28 | } 29 | 30 | h5, 31 | .text-epsilon { 32 | @include fs-3; 33 | color: $grey-dk-200; 34 | } 35 | 36 | h6, 37 | .text-zeta { 38 | @include fs-2; 39 | color: $grey-dk-200; 40 | } 41 | 42 | li { 43 | .highlight { 44 | margin-top: $sp-2; 45 | } 46 | } 47 | 48 | .text-small { 49 | @include fs-2; 50 | } 51 | 52 | .text-mono { 53 | font-family: $mono-font-family !important; 54 | } 55 | 56 | .text-center { 57 | text-align: center !important; 58 | } 59 | -------------------------------------------------------------------------------- /_sass/utilities/_layout.scss: -------------------------------------------------------------------------------- 1 | // stylelint-disable primer/selector-no-utility, primer/no-override 2 | // 3 | // Utility classes for layout 4 | // 5 | 6 | // Display 7 | 8 | .d-block { 9 | display: block !important; 10 | } 11 | .d-flex { 12 | display: flex !important; 13 | } 14 | .d-inline { 15 | display: inline !important; 16 | } 17 | .d-inline-block { 18 | display: inline-block !important; 19 | } 20 | .d-none { 21 | display: none !important; 22 | } 23 | 24 | @each $media-query in map-keys($media-queries) { 25 | @for $i from 1 through length($spacers) { 26 | @include mq($media-query) { 27 | $size: #{map-get($spacers, sp-#{$i - 1})}; 28 | $scale: #{$i - 1}; 29 | 30 | // .d-sm-block, .d-md-none, .d-lg-inline 31 | .d-#{$media-query}-block { 32 | display: block !important; 33 | } 34 | .d-#{$media-query}-flex { 35 | display: flex !important; 36 | } 37 | .d-#{$media-query}-inline { 38 | display: inline !important; 39 | } 40 | .d-#{$media-query}-inline-block { 41 | display: inline-block !important; 42 | } 43 | .d-#{$media-query}-none { 44 | display: none !important; 45 | } 46 | } 47 | } 48 | } 49 | 50 | // Vertical alignment 51 | 52 | .v-align-baseline { 53 | vertical-align: baseline !important; 54 | } 55 | .v-align-bottom { 56 | vertical-align: bottom !important; 57 | } 58 | .v-align-middle { 59 | vertical-align: middle !important; 60 | } 61 | .v-align-text-bottom { 62 | vertical-align: text-bottom !important; 63 | } 64 | .v-align-text-top { 65 | vertical-align: text-top !important; 66 | } 67 | .v-align-top { 68 | vertical-align: top !important; 69 | } 70 | -------------------------------------------------------------------------------- /_sass/utilities/_lists.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Utility classes for lists 3 | // 4 | 5 | // stylelint-disable primer/selector-no-utility, primer/no-override, selector-max-type 6 | 7 | .list-style-none { 8 | padding: 0 !important; 9 | margin: 0 !important; 10 | list-style: none !important; 11 | 12 | li { 13 | &::before { 14 | display: none !important; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /_sass/utilities/_typography.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Utility classes for typography 3 | // 4 | 5 | // stylelint-disable primer/selector-no-utility, primer/no-override 6 | 7 | .fs-1 { 8 | @include fs-1; 9 | } 10 | 11 | .fs-2 { 12 | @include fs-2; 13 | } 14 | 15 | .fs-3 { 16 | @include fs-3; 17 | } 18 | 19 | .fs-4 { 20 | @include fs-4; 21 | } 22 | 23 | .fs-5 { 24 | @include fs-5; 25 | } 26 | 27 | .fs-6 { 28 | @include fs-6; 29 | } 30 | 31 | .fs-7 { 32 | @include fs-7; 33 | } 34 | 35 | .fs-8 { 36 | @include fs-8; 37 | } 38 | 39 | .fs-9 { 40 | @include fs-9; 41 | } 42 | 43 | .fs-10 { 44 | @include fs-10; 45 | } 46 | 47 | .fw-300 { 48 | font-weight: 300 !important; 49 | } 50 | 51 | .fw-400 { 52 | font-weight: 400 !important; 53 | } 54 | 55 | .fw-500 { 56 | font-weight: 500 !important; 57 | } 58 | 59 | .fw-700 { 60 | font-weight: 700 !important; 61 | } 62 | 63 | .lh-0 { 64 | line-height: 0 !important; 65 | } 66 | 67 | .lh-default { 68 | line-height: $body-line-height; 69 | } 70 | 71 | .lh-tight { 72 | line-height: $body-heading-line-height; 73 | } 74 | 75 | .ls-5 { 76 | letter-spacing: 0.05em !important; 77 | } 78 | 79 | .ls-10 { 80 | letter-spacing: 0.1em !important; 81 | } 82 | 83 | .ls-0 { 84 | letter-spacing: 0 !important; 85 | } 86 | 87 | .text-uppercase { 88 | text-transform: uppercase !important; 89 | } 90 | 91 | // stylelint-enable primer/selector-no-utility 92 | -------------------------------------------------------------------------------- /_sass/utilities/utilities.scss: -------------------------------------------------------------------------------- 1 | @import "./colors"; 2 | @import "./layout"; 3 | @import "./typography"; 4 | @import "./lists"; 5 | @import "./spacing"; 6 | -------------------------------------------------------------------------------- /_sass/vendor/normalize.scss/README.md: -------------------------------------------------------------------------------- 1 | # normalize.scss v0.1.0 2 | 3 | Normalize.scss is the SCSS version of [normalize.css](http://necolas.github.io/normalize.css), a customisable CSS file that makes browsers render all elements more consistently and in line with modern standards. 4 | 5 | [View the normalize.css test file](http://necolas.github.io/normalize.css/latest/test.html) 6 | 7 | ## Install 8 | 9 | * [npm](http://npmjs.org/): `npm install --save normalize.scss` 10 | * [Component(1)](https://github.com/component/component/): `component install guerrero/normalize.scss` 11 | * [Bower](http://bower.io/): `bower install --save normalize.scss` 12 | * Download: Go to [this link](https://raw.githubusercontent.com/guerrero/normalize.scss/master/normalize.scss), press right-click on the page and choose "Save as..." 13 | 14 | No other styles should come before Normalize.scss. 15 | 16 | It's recommendable to modify `normalize.scss` to suit it to your project 17 | 18 | ## What does it do? 19 | 20 | * Preserves useful defaults, unlike many CSS resets. 21 | * Normalizes styles for a wide range of elements. 22 | * Corrects bugs and common browser inconsistencies. 23 | * Improves usability with subtle improvements. 24 | * Explains what code does using detailed comments. 25 | 26 | ## Browser support 27 | 28 | * Google Chrome (latest) 29 | * Mozilla Firefox (latest) 30 | * Mozilla Firefox 4 31 | * Opera (latest) 32 | * Apple Safari 6+ 33 | * Internet Explorer 8+ 34 | 35 | [Normalize.css v1 provides legacy browser 36 | support](https://github.com/necolas/normalize.css/tree/v1) (IE 6+, Safari 4+), 37 | but is no longer actively developed. 38 | 39 | ## Extended details 40 | 41 | Additional detail and explanation of the esoteric parts of normalize.css. 42 | 43 | #### `pre, code, kbd, samp` 44 | 45 | The `font-family: monospace, monospace` hack fixes the inheritance and scaling 46 | of font-size for preformated text. The duplication of `monospace` is 47 | intentional. [Source](http://en.wikipedia.org/wiki/User:Davidgothberg/Test59). 48 | 49 | #### `sub, sup` 50 | 51 | Normally, using `sub` or `sup` affects the line-box height of text in all 52 | browsers. [Source](http://gist.github.com/413930). 53 | 54 | #### `svg:not(:root)` 55 | 56 | Adding `overflow: hidden` fixes IE9's SVG rendering. Earlier versions of IE 57 | don't support SVG, so we can safely use the `:not()` and `:root` selectors that 58 | modern browsers use in the default UA stylesheets to apply this style. [SVG 59 | Mailing List discussion](http://lists.w3.org/Archives/Public/public-svg-wg/2008JulSep/0339.html) 60 | 61 | #### `input[type="search"]` 62 | 63 | The search input is not fully stylable by default. In Chrome and Safari on 64 | OSX/iOS you can't control `font`, `padding`, `border`, or `background`. In 65 | Chrome and Safari on Windows you can't control `border` properly. It will apply 66 | `border-width` but will only show a border color (which cannot be controlled) 67 | for the outer 1px of that border. Applying `-webkit-appearance: textfield` 68 | addresses these issues without removing the benefits of search inputs (e.g. 69 | showing past searches). 70 | 71 | #### `legend` 72 | 73 | Adding `border: 0` corrects an IE 8–11 bug where `color` (yes, `color`) is not 74 | inherited by `legend`. 75 | 76 | ## Acknowledgements 77 | 78 | Normalize.scss is a project by [Alex Guerrero](https://github.com/guerrero) based on [normalize.css](http://necolas.github.io/normalize.css) from [Nicolas Gallagher](https://github.com/necolas), co-created with [Jonathan Neal](https://github.com/jonathantneal). 79 | -------------------------------------------------------------------------------- /_sass/vendor/normalize.scss/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_args": [ 3 | [ 4 | "normalize.scss", 5 | "/Users/pmarsceill/_projects/just-the-docs" 6 | ] 7 | ], 8 | "_from": "normalize.scss@*", 9 | "_id": "normalize.scss@0.1.0", 10 | "_inCache": true, 11 | "_installable": true, 12 | "_location": "/normalize.scss", 13 | "_nodeVersion": "0.10.32", 14 | "_npmUser": { 15 | "email": "alexguerrero1092@gmail.com", 16 | "name": "alexguerrero" 17 | }, 18 | "_npmVersion": "2.0.2", 19 | "_phantomChildren": {}, 20 | "_requested": { 21 | "name": "normalize.scss", 22 | "raw": "normalize.scss", 23 | "rawSpec": "", 24 | "scope": null, 25 | "spec": "*", 26 | "type": "range" 27 | }, 28 | "_requiredBy": [ 29 | "#DEV:/" 30 | ], 31 | "_resolved": "https://registry.npmjs.org/normalize.scss/-/normalize.scss-0.1.0.tgz", 32 | "_shasum": "4a21dc25bd4c019c857785f829b658aba2a8f9ab", 33 | "_shrinkwrap": null, 34 | "_spec": "normalize.scss", 35 | "_where": "/Users/pmarsceill/_projects/just-the-docs", 36 | "author": "", 37 | "bugs": { 38 | "url": "https://github.com/guerrero/normalize.scss/issues" 39 | }, 40 | "dependencies": {}, 41 | "description": "Normalize.scss as a node packaged module", 42 | "devDependencies": {}, 43 | "directories": {}, 44 | "dist": { 45 | "shasum": "4a21dc25bd4c019c857785f829b658aba2a8f9ab", 46 | "tarball": "https://registry.npmjs.org/normalize.scss/-/normalize.scss-0.1.0.tgz" 47 | }, 48 | "files": [ 49 | "normalize.scss" 50 | ], 51 | "gitHead": "d67d517e28615a873066438af1d4845c157c9baf", 52 | "homepage": "https://github.com/guerrero/normalize.scss", 53 | "license": "MIT", 54 | "maintainers": [ 55 | { 56 | "name": "alexguerrero", 57 | "email": "alexguerrero1092@gmail.com" 58 | } 59 | ], 60 | "name": "normalize.scss", 61 | "optionalDependencies": {}, 62 | "readme": "ERROR: No README data found!", 63 | "repository": { 64 | "type": "git", 65 | "url": "git://github.com/guerrero/normalize.scss.git" 66 | }, 67 | "scripts": {}, 68 | "style": "normalize.scss", 69 | "version": "0.1.0" 70 | } 71 | -------------------------------------------------------------------------------- /assets/css/dark-mode-preview.scss: -------------------------------------------------------------------------------- 1 | --- 2 | # this ensures Jekyll reads the file to be transformed into CSS later 3 | # only Main files contain this front matter, not partials. 4 | --- 5 | 6 | {% if site.logo %} 7 | $logo: "{{ site.logo | absolute_url }}"; 8 | {% endif %} 9 | 10 | // 11 | // Import external dependencies 12 | // 13 | 14 | @import "./vendor/normalize.scss/normalize.scss"; 15 | 16 | // 17 | // Import Just the Docs scss 18 | // 19 | 20 | // Support 21 | @import "./support/support"; 22 | 23 | // 24 | // Import custom color scheme scss 25 | // 26 | 27 | @import "./color_schemes/dark.scss"; 28 | 29 | // Modules 30 | @import "./base"; 31 | @import "./layout"; 32 | @import "./content"; 33 | @import "./navigation"; 34 | @import "./typography"; 35 | @import "./labels"; 36 | @import "./buttons"; 37 | @import "./search"; 38 | @import "./tables"; 39 | @import "./code"; 40 | @import "./utilities/utilities"; 41 | 42 | // 43 | // Import custom overrides 44 | // 45 | @import "./custom/custom"; 46 | -------------------------------------------------------------------------------- /assets/css/just-the-docs.scss: -------------------------------------------------------------------------------- 1 | --- 2 | # this ensures Jekyll reads the file to be transformed into CSS later 3 | # only Main files contain this front matter, not partials. 4 | --- 5 | 6 | {% if site.logo %} 7 | $logo: "{{ site.logo | absolute_url }}"; 8 | {% endif %} 9 | 10 | // 11 | // Import external dependencies 12 | // 13 | 14 | @import "./vendor/normalize.scss/normalize.scss"; 15 | 16 | // 17 | // Import Just the Docs scss 18 | // 19 | 20 | // Support 21 | @import "./support/support"; 22 | 23 | // 24 | // Import custom overrides 25 | // 26 | 27 | @import "./custom/custom"; 28 | 29 | // 30 | // Import custom color scheme scss 31 | // 32 | 33 | {% if site.color_scheme == "dark" %} 34 | @import "./color_schemes/dark.scss"; 35 | {% endif %} 36 | 37 | // Modules 38 | @import "./base"; 39 | @import "./layout"; 40 | @import "./content"; 41 | @import "./navigation"; 42 | @import "./typography"; 43 | @import "./labels"; 44 | @import "./buttons"; 45 | @import "./search"; 46 | @import "./tables"; 47 | @import "./code"; 48 | @import "./utilities/utilities"; 49 | @import "./overrides"; 50 | -------------------------------------------------------------------------------- /assets/images/just-the-docs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/assets/images/just-the-docs.png -------------------------------------------------------------------------------- /assets/images/search.svg: -------------------------------------------------------------------------------- 1 | Search 2 | -------------------------------------------------------------------------------- /assets/js/dark-mode-preview.js: -------------------------------------------------------------------------------- 1 | document.addEventListener("DOMContentLoaded", function () { 2 | const toggleDarkMode = document.querySelector(".js-toggle-dark-mode") 3 | const cssFile = document.querySelector('[rel="stylesheet"]') 4 | const originalCssRef = cssFile.getAttribute("href") 5 | const darkModeCssRef = originalCssRef.replace( 6 | "just-the-docs.css", 7 | "dark-mode-preview.css" 8 | ) 9 | const buttonCopy = ["Return to the light side", "Preview dark color scheme"] 10 | const updateButtonText = function (toggleDarkMode) { 11 | toggleDarkMode.textContent === buttonCopy[0] 12 | ? (toggleDarkMode.textContent = buttonCopy[1]) 13 | : (toggleDarkMode.textContent = buttonCopy[0]) 14 | } 15 | 16 | jtd.addEvent(toggleDarkMode, "click", function () { 17 | if (cssFile.getAttribute("href") === originalCssRef) { 18 | cssFile.setAttribute("href", darkModeCssRef) 19 | updateButtonText(toggleDarkMode) 20 | } else { 21 | cssFile.setAttribute("href", originalCssRef) 22 | updateButtonText(toggleDarkMode) 23 | } 24 | }) 25 | }) 26 | -------------------------------------------------------------------------------- /assets/js/search-data.json: -------------------------------------------------------------------------------- 1 | --- 2 | --- 3 | { 4 | {% assign comma = false %} 5 | {% for page in site.html_pages %}{% if page.search_exclude != true %}{% if comma == true%},{% endif %}"{{ forloop.index0 }}": { 6 | "title": "{{ page.title | replace: '&', '&' | markdownify | markdownify | replace: ' SimpleFOC 社区 10 | 有关实现、应用程序、支持的硬件等相关的问题,请访问我们的 [社区论坛](https://community.simplefoc.com) 11 | 12 | 听到有关于代码实现的事情/问题/建议对我们来说是有帮助的,在社区里,你可能会发现很多疑惑已经有了答案! 13 | 14 | 20 | 21 | 22 | 23 | ## 在 Github 提出问题 & 贡献你的代码 24 | 25 | 如果你对代码有任何问题/意见/建议,请不要犹豫地提出来! 26 | 27 | 欢迎你们贡献代码,不过可以先在 [社区论坛](https://community.simplefoc.com) 展开讨论! 28 | 29 | ## 直接联系我们 30 | 31 | 如果你有非常重要的问题,请直接联系我们 😄: 32 | [simplefoc.com](https://simplefoc.com/contact) -------------------------------------------------------------------------------- /docs/boards/simplefoc_shield/getting_started/connections.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: 连接硬件 4 | parent: 开始上手 5 | description: "Connecting SimpleFOCShield with your hardware." 6 | nav_order: 2 7 | permalink: /foc_shield_connect_hardware 8 | grand_parent: Arduino SimpleFOCShield 9 | grand_grand_parent: SimpleFOC Boards 10 | --- 11 | 12 | # 连接硬件 13 | 14 |

15 | 16 |

17 | 18 | 将SimpleFOCShield 与单片机、无刷直流电机、电源和传感器连接起来。 19 | 20 | ## 单片机 21 | - Arduino SimpleFOCShield 可堆叠在所有有 Arduino 标准接口的设备上,如: [Arudino UNO](arduino_simplefoc_shield), Arudino MEGA, [Stm32 Nucleo](nucleo_connection) 等。 22 | 23 | - Bit 它也可以作为一个独立的无刷直流电机驱动程序,如 [Stm32 Bluepill](bluepill_connection) 所示。 24 | 25 | > wait to translate 26 | 27 | ## 无刷直流电机 28 | - 电机的 `a` 相, `b` 相和 `c` 相直接连接到驱动板的电机输出端子 `TB_M1` 29 | 30 |

注意:功率的限制

31 | Arduino SimpleFOCShield 适用于内阻大于10Ω的云台电机。此单驱动器的最大电流为5A。请确保你使用此驱动器时的无刷直流电机符合上述对电机的要求。
32 | 如果你仍然想在这块驱动板上用内阻小于10Ω的电机,请留意设置驱动板的电压限制。
33 | 有关电机选择的更多信息,请访问 无刷直流电机文档 34 |
35 | 36 | 37 | ## 电源 38 | - 电源线连接到输入端 `TB_PWR` 39 | - 电源电压建议在12-24V。这块驱动器上没有测试过更高的电压输入,但在30V以下应该不会有太多问题。 40 | 41 | 42 | 43 | ## 编码器 44 | - 通道 `A` and `B` 连接到驱动板的编码器端子 `P_ENC`的 `A` 和 `B`上。 45 | - 如果你的编码器上有 `index` ,你也可以将它连接到编码器端子的 `I`上。 46 | 47 | 48 | 49 | 图片名词:Power supply (电源),Encoder(编码器), BLDC motor(无刷直流电机),optional(可选择的) 50 | 51 | ## 磁传感器-SPI通信 52 | - 磁传感器的 SPI 接口 `SCK`, `MISO` 和 `MOSI` 连接到 Arduino 的 `SPI` 引脚 (Arduino UNO `13`,`12` and `11`)。 53 | - 如果需要多个传感器,可以将所有传感器都连接到 Arduino 的相同引脚上。 54 | - `chip select` 引脚连接到所需的引脚上,每个连接到同一个 Arduino 的传感器必须有唯一的 chip 选择引脚。 55 | 56 | 57 | 58 | 图片名词:Power supply (电源), BLDC motor(无刷直流电机) 59 | 60 | ## 磁传感器-I2C通信 61 | - 磁传感器的 I2C 的接口 `SCL` 和 `SDA` 连接到 Arduino 的 `I2C` 引脚 (Arduino UNO `A4` 和 `A5`). 62 | - 如果需要多个传感器,可以将所有传感器都连接到 Arduino 的相同引脚上。 63 | - 你可能需要给 `SDA` 和 `SCL` 接上拉电阻。 64 | 65 | 66 | 67 | 图片名词:Power supply (电源), BLDC motor(无刷直流电机) 68 | 69 | 70 | ## 磁传感器-模拟输出 71 | - 磁传感器的模拟输出直接连接到Arduino 的任何模拟输入引脚,在下图中我们使用 `A0` 72 | - 如果需要多个传感器,则每个传感器需要连接到唯一的模拟输入引脚 73 | 74 | 75 | 76 | 图片名词:Power supply (电源), BLDC motor(无刷直流电机) 77 | 78 | 79 | ## 霍尔传感器 80 | - 通道 `A`, `B` 和 `C` ( `U`, `V` 和 `W` ) 连接到驱动器的编码器端子 `P_ENC`. 81 | 82 | 83 | 84 | 图片名词:Power supply (电源), BLDC motor(无刷直流电机) 85 | 86 | -------------------------------------------------------------------------------- /docs/boards/simplefoc_shield/getting_started/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: 开始上手 4 | description: "Getting started with Arduino SimpleFOCShield" 5 | parent: Arduino SimpleFOCShield 6 | grand_parent: SimpleFOC Boards 7 | nav_order: 1 8 | permalink: /arduino_simplefoc_shield_installation 9 | has_children: true 10 | has_toc: false 11 | --- 12 | # 开始上手 Arduino SimpleFOCShield 13 | 14 | 15 | 16 | ## 第一步: [硬件配置](pads_soldering) 17 | 使用Arduino SimpleFOCShield 首先要进行引脚的配置。 18 | 19 | 20 | 21 | 每个驱动器的底部有一组用于配置的锡盘。这些焊盘功能包括: 22 | - 启用/禁用编码器A、B和索引通道的负载电阻 23 | - 配置无刷直流的驱动引脚(PWM引脚A、B、C和使能引脚) 24 | 25 | [查看更多](pads_soldering) 26 | 27 | 28 | 29 | ## 第二步:[连接硬件](foc_shield_connect_hardware) 30 | 31 | 32 | 33 | 如图,将SimpleFOCShield 与单片机、无刷直流电机、电源和传感器连接起来。 34 | 35 | [查看更多](foc_shield_connect_hardware) 36 | 37 | ## 第三步:[编写代码](foc_shield_code) 38 | 39 | 在配置好合适的 [硬件配置](pads_soldering) 和硬件 [连接](foc_shield_connect_hardware) 之后,我们就可以开始最激动人心的部分,写代码! 40 | 41 | [查看更多](foc_shield_code) -------------------------------------------------------------------------------- /docs/boards/simplefoc_shield/getting_started/soldering_pads/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: 焊盘部分 4 | parent: 开始上手 5 | description: "Configuring your SimpleFOCShield by soldering the pads." 6 | nav_order: 1 7 | permalink: /pads_soldering 8 | grand_parent: Arduino SimpleFOCShield 9 | grand_grand_parent: SimpleFOC Boards 10 | has_children: true 11 | has_toc: false 12 | --- 13 | 14 | # 使用焊盘进行硬件配置 15 | Arduino SimpleFOCShield 的一个重要特性是硬件配置。 16 | 17 | 18 | 25 | 26 | 33 | -------------------------------------------------------------------------------- /docs/simplefoc_library/cheatsheet/build_flags.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: Build Flags 4 | nav_order: 2 5 | permalink: /cheetsheet/build_flags 6 | parent: Options Cheat Sheet 7 | grand_parent: Arduino SimpleFOClibrary 8 | has_children: False 9 | has_toc: False 10 | --- 11 | 12 | 13 | # Build flags 14 | 15 | SimpleFOClibrary 支持一些高级用户可能会感兴趣的编译器选项。 它们如下所述。 16 | 17 | ## 可用的构建标志 18 | 19 | 通过构建标志来控制编译器生成 SimpleFOClibrary 代码的方式。有些在所有架构上都受支持,而有些则依赖于 MCU 架构。 20 | 21 | 标志 | 架构 | 说明 22 | --- | --- | --- 23 | `SIMPLEFOC_DISABLE_DEBUG` | 所有 | 设置为禁用整个调试代码 24 | `SIMPLEFOC_STM32_DEBUG` | STM32 | 设置为 STM32 MCU 启用额外的调试输出。 25 | `SIMPLEFOC_STM32_MAX_PINTIMERSUSED` | STM32 | 可配置的最大 PWM 引脚数,默认为 12(最多 2x 6PWM,一般是够用的) 26 | `SIMPLEFOC_SAMD_DEBUG` | SAMD21 / SAMD51 | 设置为 SAMD MCU 启用额外的调试输出。 27 | `SIMPLEFOC_SAMD_MAX_TCC_PINCONFIGURATIONS` | SAMD21 / SAMD51 | 可配置的最大 PWM 引脚数,默认为 24(最多 4x6PWM,一般是够用的 ;-) ) 28 | `SIMPLEFOC_SAMD51_DPLL_FREQ` | SAMD21 / SAMD51 | DPLL 上的预期频率,一般不自己配置。 通常这是 CPU 频率。 对于自定义板或超频器,您可以使用此定义覆盖它。 默认为 120000000 29 | `SIMPLEFOC_DEBUG_RP2040` | RP2040 | 设置为在 Raspberry Pico 上启用额外的调试输出。 30 | `SIMPLEFOC_ESP32_USELEDC` | ESP32 | 即使在支持 MCPWM 的 ESP32 上也强制使用 LEDC PWM 驱动器。 主要用于测试目的,通常您会更喜欢 MCPWM(如果可用)。 31 | -------------------------------------------------------------------------------- /docs/simplefoc_library/cheatsheet/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: Options Cheat Sheet 4 | nav_order: 9 5 | permalink: /options_cheetsheet 6 | parent: Arduino SimpleFOClibrary 7 | has_children: True 8 | has_toc: False 9 | --- 10 | 11 | 12 | # 选项查阅 13 | 14 | 在这些页面中,找到选项和标志的引用。 15 | 16 | ## 选项 17 | 18 | SimpleFOClibrary 对象的 [常用选项](cheetsheet/options_reference) 。 19 | 20 | ## 创建标志 21 | 22 | 通过[建立标志Build flags](cheetsheet/build_flags) 来控制编译器生成 SimpleFOClibrary 代码的方式。 23 | 24 | -------------------------------------------------------------------------------- /docs/simplefoc_library/citing.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: 引用 SimpleFOC 4 | parent: Arduino SimpleFOClibrary 5 | nav_order: 9 6 | permalink: /citing 7 | --- 8 | 9 | 10 | # 引用 SimpleFOC 11 | 12 | 13 | 14 | 我们很高兴 *Simple**FOC**library* 已被用作多个研究项目的组成部分,并被多篇科学论文引用。 我们希望随着项目的成熟和强大,这种趋势能持续下去! 因此,我们在《开源软件杂志》上发表了一篇关于 *Simple**FOC*** 的简短论文: 15 | 16 |

17 | SimpleFOC: A Field Oriented Control (FOC) Library for Controlling Brushless Direct Current (BLDC) and Stepper Motors.
18 | A. Skuric, HS. Bank, R. Unger, O. Williams, D. González-Reyes
19 | Journal of Open Source Software, 7(74), 4232, https://doi.org/10.21105/joss.04232 20 |

21 | 22 | 如果你想在你的研究中引用 *Simple**FOC**library* 或者 *Simple**FOC**project* 中的某些部分,我们建议你引用我们的论文: 23 | 24 |
25 | 26 |
27 | @article{simplefoc2022,
28 |   doi = {10.21105/joss.04232},
29 |   url = {https://doi.org/10.21105/joss.04232},
30 |   year = {2022},
31 |   publisher = {The Open Journal},
32 |   volume = {7},
33 |   number = {74},
34 |   pages = {4232},
35 |   author = {Antun Skuric and Hasan Sinan Bank and Richard Unger and Owen Williams and David González-Reyes},
36 |   title = {SimpleFOC: A Field Oriented Control (FOC) Library for Controlling Brushless Direct Current (BLDC) and Stepper Motors},
37 |   journal = {Journal of Open Source Software}
38 | }
39 | 
40 |
41 |
42 | 43 | 44 | ## SimpleFOC: 用于控制BLDC无刷直流电机和步进电机的FOC磁场定向控制库。 45 | 46 | -------------------------------------------------------------------------------- /docs/simplefoc_library/code/communication/commander/custom.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: 自定义命令 4 | nav_order: 6 5 | permalink: /commander_custom 6 | parent: Commander 接口 7 | grand_parent: 内置通信接口 8 | grand_grand_parent: 代码 9 | grand_grand_grand_parent: Arduino SimpleFOClibrary 10 | --- 11 | 12 | # 使用自定义功能拓展commander 13 | 14 | 使用自己的未在 SimpleFOClibrary 上实现的功能拓展commander接口,您只需要: 15 | 16 | 1. 执行你的回调函数 `void myFunc(char*){}` 17 | 2. 将它添加到 commander `commander.add('.',myFunc,"..")` 18 | 19 | ```cpp 20 | void myFunc(char*){ 21 | // 做一些有用的事 22 | } 23 | 24 | Commander commander = Commander(...) 25 | void setup(){ 26 | ... 27 | commander.add('A',myFunc,"my functionality"); 28 | ... 29 | } 30 | void loop(){ 31 | ... 32 | commander.run() 33 | } 34 | ``` 35 | 36 | ## 实例 37 | 38 | 这是一个使用两个新功能扩展commander接口的示例代码,打开和关闭 LED 灯并读取 5 个模拟引脚。 39 | 40 | ```cpp 41 | 42 | #include 43 | 44 | // 实例化 commander 45 | Commander command = Commander(Serial); 46 | 47 | // LED控制功能 48 | void doLed(char* cmd){ 49 | if(atoi(cmd)) digitalWrite(LED_BUILTIN, HIGH); 50 | else digitalWrite(LED_BUILTIN, LOW); 51 | }; 52 | // 获取模拟输入 53 | void doAnalog(char* cmd){ 54 | if (cmd[0] == '0') Serial.println(analogRead(A0)); 55 | else if (cmd[0] == '1') Serial.println(analogRead(A1)); 56 | else if (cmd[0] == '2') Serial.println(analogRead(A2)); 57 | else if (cmd[0] == '3') Serial.println(analogRead(A3)); 58 | else if (cmd[0] == '4') Serial.println(analogRead(A4)); 59 | }; 60 | 61 | void setup() { 62 | // 定义引脚 63 | pinMode(LED_BUILTIN, OUTPUT); 64 | pinMode(A0, INPUT); 65 | pinMode(A1, INPUT); 66 | pinMode(A2, INPUT); 67 | pinMode(A3, INPUT); 68 | pinMode(A4, INPUT); 69 | 70 | // 要使用的串行端口 71 | Serial.begin(115200); 72 | 73 | // 添加新命令 74 | command.add('L', doLed, "led on/off"); 75 | command.add('A', doAnalog, "analog read A0-A4"); 76 | 77 | Serial.println(F("Commander listening")); 78 | Serial.println(F(" - Send ? to see the node list...")); 79 | Serial.println(F(" - Send L0 to turn the led off and L1 to turn it off")); 80 | Serial.println(F(" - Send A0-A4 to read the analog pins")); 81 | _delay(1000); 82 | } 83 | 84 | 85 | void loop() { 86 | 87 | // 用户通信 88 | command.run(); 89 | _delay(10); 90 | } 91 | ``` 92 | 93 | 然后在你的串行终端中,你可以 94 | ```sh 95 | $ ? # 列出命令 96 | L: led on/off 97 | A: analog read A0-A4 98 | $ L0 # led 关闭 99 | $ A1 # 读取 A1 100 | 321 101 | $ A3 # 读取 A3 102 | 1023 103 | $ L1 # led 开启 104 | $ L0 # led 关闭 105 | ``` 106 | -------------------------------------------------------------------------------- /docs/simplefoc_library/code/communication/commander/lpf.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: LPF 配置 4 | nav_order: 3 5 | permalink: /commander_lpf 6 | parent: Commander 接口 7 | grand_parent: 内置通信接口 8 | grand_grand_parent: 代码 9 | grand_grand_grand_parent: Arduino SimpleFOClibrary 10 | --- 11 | 12 | # 使用 Commander 配置低通滤波器 13 | 当使用 `LowPassFilter` 类的标准回调时:`commander.lpf(&lpf,cmd)` 用户可用一个命令: 14 | 15 | - **F**: 低通滤波器时间常数 16 | 17 | 例如,如果在 `commander` 中添加了低通滤波器: 18 | 19 | ```cpp 20 | LowPassFilter filter = .... 21 | Commander commander = ... 22 | 23 | void onLpf(char* cmd){ commander.lpf(&filter,cmd); } 24 | void setup(){ 25 | ... 26 | commander.add('A',onLpf,"my lpf"); 27 | ... 28 | } 29 | void loop(){ 30 | ... 31 | commander.run(); 32 | } 33 | ``` 34 | 可以从串行监视器配置(设置和获取)其参数: 35 | 36 | ```sh 37 | $ AF # 获取时间常数 38 | Tf: 1.0 39 | $ AF0.05 # 设定时间常数 40 | Tf: 0.05 41 | $ AW # 未知命令 42 | err 43 | ``` 44 | -------------------------------------------------------------------------------- /docs/simplefoc_library/code/communication/commander/pid.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: PID 配置 4 | nav_order: 2 5 | permalink: /commander_pid 6 | parent: Commander 接口 7 | grand_parent: 内置通信接口 8 | grand_grand_parent: 代码 9 | grand_grand_grand_parent: Arduino SimpleFOClibrary 10 | --- 11 | 12 | # 使用 Commander 配置 PID 13 | 当为 `PIDController` 类使用标准回调时:`commander.pid(&pid,cmd)` ,可用命令: 14 | 15 | - **P**: PID 控制器 P 增益 16 | - **I**: PID 控制器 I 增益 17 | - **D**: PID 控制器 D 增益 18 | - **R**: PID 控制器输出梯度 19 | - **L**: PID 控制器输出限制 20 | 21 | 例如,如果将 PID 控制器添加到 `commander`: 22 | 23 | ```cpp 24 | PIDController pid = .... 25 | Commander commander = ... 26 | 27 | void onPid(char* cmd){ commander.pid(&pid,cmd); } 28 | void setup(){ 29 | ... 30 | commander.add('C',onPid,"my pid"); 31 | ... 32 | } 33 | void loop(){ 34 | ... 35 | commander.run(); 36 | } 37 | ``` 38 | 能从串行监视器配置(设置和获取)其参数: 39 | ```sh 40 | $ CP # 获取 P 增益 41 | P: 1.0 42 | $ CD0.05 # 设置 D 增益 43 | D: 0.05 44 | $ CO # 未知命令 45 | err 46 | $ CL3.25 # 设置输出限制 47 | limit: 3.25 48 | ``` -------------------------------------------------------------------------------- /docs/simplefoc_library/code/communication/commander/scalar.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: 标量变量 4 | nav_order: 1 5 | permalink: /commander_scalar 6 | parent: Commander 接口 7 | grand_parent: 内置通信接口 8 | grand_grand_parent: 代码 9 | grand_grand_grand_parent: Arduino SimpleFOClibrary 10 | --- 11 | 12 | # 使用 Commander 的标量变量 13 | 14 | Commander 接口具有用于设置/获取标量变量的内置功能。要将它与所需的变量(例如`variable`)一起使用,请使用回调`commander.scalar(&variable,cmd)`。 15 | 16 | 例如,将变量添加到 `commander`: 17 | ```cpp 18 | 19 | Commander commander = ... 20 | 21 | // 定义我的变量 22 | float my_variable = 1.234; 23 | 24 | void onScalar(char* cmd){ commander.scalar(&my_variable,cmd); } 25 | void setup(){ 26 | ... 27 | commander.add('A',onScalar,"my variable"); 28 | ... 29 | } 30 | void loop(){ 31 | ... 32 | commander.run(); 33 | } 34 | ``` 35 | 36 | 能从串行监视器配置(设置和获取)它: 37 | ```sh 38 | $ ? # 列出可用命令 39 | A: my variable 40 | $ A # 获取时间常数 41 | 1.234 42 | $ A0.05 # 设定时间常数 43 | 0.05 44 | $ A # 获取时间常数 45 | 0.05 46 | ``` 47 | -------------------------------------------------------------------------------- /docs/simplefoc_library/code/communication/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: 内置通信接口 4 | nav_order: 8 5 | permalink: /communication 6 | parent: 代码 7 | grand_parent: Arduino SimpleFOClibrary 8 | has_children: True 9 | has_toc: False 10 | --- 11 | 12 | 13 | # 内置通信接口 14 | Simplefoc实现了一个简单的通信方案,可快速方便地对所设置的参数进行测试、调试和监控: 15 | 16 | - 📈 监督和变量监测 - [Monitoring](monitoring) 17 | - ⚙️ 调试和配置接口 - [Commander interface](commander_interface) 18 | 19 | 此外,我们尝试提供一个可以简单执行的通信协议,该协议支持: 20 | 21 | - [Step-Direction 接口 ](step_dir_interface) 22 | - PWM接口-*尚不支持* 23 | 24 |

关于CAN总线和RS485

25 | SimpleFOC 库的主要目标是提供一个简单且有效率的无刷电机和步进电机控制方法。所以通信协议方面的实现其实超出了本库的目标范畴。之所以这样说,是因为根据特定的应用、开发体系适应和硬件能力,可用于控制电机的通信协议其实是多种多样的。再者,当一个应用需要更采用高级通信协议(如CAN、RS485等)时,其实有很多更棒的库可以采用,这些库都可以顺畅无比的连接到SFOC库中。我们会尝试提供一些这方面的例程。 26 | 27 | 28 | -------------------------------------------------------------------------------- /docs/simplefoc_library/code/communication/step_dir.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: 步进方向接口 4 | nav_order: 2 5 | permalink: /step_dir_interface 6 | parent: 内置通信接口 7 | grand_parent: 代码 8 | grand_grand_parent: Arduino SimpleFOClibrary 9 | --- 10 | 11 | 12 | # 步进-方向监听器接口 13 | 14 | 步进/方向通信是运行步进电机最常用最基本的通信接口之一。它使用的是两个数字信号——`step` 和`direction`。`step`步进信号产生短脉冲,以表示电机将按设定的步长进行步进,`step` 信号确定运动方向(例如,`HIGH`向前,`LOW`向后)。 15 | 16 | 如上所述,该接口因其运动是以步进为特征的设计而特别使用于步进电机。但同时这个接口也能用于很多与步进电机无关的不同方式中。 通常step/dir接口可以作为一个双向计数器,其中`direction`信号为计数方向,`step`为要计数的脉冲数: 17 | 18 | ```cpp 19 | // 阶跃信号 20 | if(direction == HIGH) counter++; 21 | else counter--; 22 | ``` 23 | 最后,只需将当前计数器值乘以步长即可获得你想要的值: 24 | ```cpp 25 | received_value = counter*my_step; 26 | ``` 27 | 28 | ## 如何使用步进-方向监听器 29 | 为了以更简洁的方式执行此操作,SimpleFOClibrary基于 `StepDirListener` 实现了基于中断的接口的版本: 30 | 31 | ```cpp 32 | // StepDirListener(step, dir, counter_to_value) 33 | // - step - step 引脚编号 34 | // - dir - dir 引脚编号 35 | // - step_per_rotation - 采用步进计数法进行变量变换(电机角度(弧度)) 36 | StepDirListener step_dir = StepDirListener( 2, 5, _2PI/200.0 ); 37 | ``` 38 | 一旦定义了`StepDirListener`,则会在`init()`函数中配置引脚。`init()`函数需要添加到`setup()` 函数中。 39 | 40 | ```cpp 41 | // 初始化 step 和 dir 引脚 42 | step_dir.init(); 43 | ``` 44 | 此外,该库用中断的方法来进行实际计数,因此`StepDirListener`提供了只需封装的 `handle()` 函数,例如: 45 | 46 | ```cpp 47 | // 静态封装函数 48 | void onStep() { step_dir.handle(); } 49 | ``` 50 | 你可以往`enableInterrupt()`函数传入封装函数来启用计数器: 51 | 52 | ```cpp 53 | // 启用中断 54 | step_dir.enableInterrupt(onStep); 55 | ``` 56 | 57 | 有两种方法来获取接收到的值。既可以通过getValue()`函数来读取: 58 | ```cpp 59 | float my_variable = step_dir.getValue(); 60 | ``` 61 | 也可以绑定希望`StepDirListener`每次更新计数器时更新的变量。 62 | 63 | ```cpp 64 | // 用户可以更新部分变量 65 | float my_value; 66 | // 可在每步绑定更新变量(可选) 67 | step_dir.attach(&my_value); 68 | ``` 69 | 70 |

⚠️ 注意:次优性能

71 | 最简单的通信形式(如step/dir)是在硬件和软件中处理,基于中断的实现通常不是最佳解决方案。它将为用户提供良好的测试基础,但很难保证长期的鲁棒性。 to be translate 72 |
73 | 74 | 75 | 76 | ## 示例代码 77 | 这是一个简单的step-dir监听器的代码。请参阅示例库`examples/utils/communication_test/step_dir`文件夹中的更多示例。 78 | 79 | ```cpp 80 | /** 81 | * 关于读取 step/dir 通信的简单实例 82 | * - 本实例使用中断 83 | */ 84 | 85 | #include 86 | 87 | // 角度 88 | float received_angle = 0; 89 | 90 | // StepDirListener( step_pin, dir_pin, counter_to_value) 91 | StepDirListener step_dir = StepDirListener(2, 3, 360.0/200.0); // 接收角度数 92 | void onStep() { step_dir.handle(); } 93 | 94 | void setup() { 95 | 96 | Serial.begin(115200); 97 | 98 | // 初始化 step 和 dir 引脚 99 | step_dir.init(); 100 | // 启用中断 101 | step_dir.enableInterrupt(onStep); 102 | // 可在每步附上更新变量(可选) 103 | // 调用 step_dir.getValue(),可异步处理同样的更新 104 | step_dir.attach(&received_angle); 105 | 106 | Serial.println(F("Step/Dir listenning.")); 107 | _delay(1000); 108 | } 109 | 110 | void loop() { 111 | Serial.print(received_angle); // 通过 StepDirListener class 自动更新 112 | Serial.print("\t"); 113 | Serial.println(step_dir.getValue()); // 获取 StepDirListener class 114 | _delay(500); 115 | } 116 | ``` 117 | -------------------------------------------------------------------------------- /docs/simplefoc_library/code/current_sense/high_side.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: 高侧电流检测 4 | nav_order: 3 5 | permalink: /high_side_current_sense 6 | parent: 电流检测 7 | grand_parent: 代码 8 | grand_grand_parent: Arduino SimpleFOClibrary 9 | --- 10 | 11 | # 高侧电流检测 12 | 高侧电流检测可能是本库所讨论的三种电流检测中最不常见的一种。主要原因是因为它需要有支持高压的放大器。采样电阻位于高侧MOSFET和电源之间,会令放大器始终会有高压差。这种方法的另一个缺点是,由于只有相应的高侧mosfet开启时,通过采样电阻的电流才是相电流,而我们只能在这些时刻测量到相电流。PWM频率通常为20至50 kHz,这意味着低侧MOSFET每秒开关20000至50000次,因此PWM设置和ADC采集之间的同步非常重要。。 13 | 14 | 当本项目支持在线检测和低侧检测后,高侧电流检测会相继开发。目前的主要问题是PWM生成和ADC触发需要特定的硬件的同步程序。因此,低侧电流检测可能会先在其中一种MCU结构中先完成。 15 | 16 | -------------------------------------------------------------------------------- /docs/simplefoc_library/code/current_sense/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: 电流检测 4 | nav_order: 5 5 | parent: 代码 6 | permalink: /current_sense 7 | grand_parent: Arduino SimpleFOClibrary 8 | has_children: True 9 | has_toc: False 10 | --- 11 | 12 | # 电流检测 13 | 14 | ArduinoSimpleFOClibrary 的目标是通过(至少)三种最标准的电流传感支持FOC: 15 | 16 | - 在线电流检测 17 | - 低压侧电流检测 18 | - 高压侧电流检测 - *暂不支持* 19 | 20 | 21 | 22 | 23 | 24 | 25 | 截至目前,Arduino SimpleFOC 库只支持在线电流检测模式,以及支持ESP32 开发板 , stm32 (f1, f4 and g4 系列 - 单电机), samd21开发板 (单电机) 和 stm32 based B_G431B_ESC1开发板的低压侧电流检测模式. 26 | 27 | 当前的每一种检测类别都将实现所有必要的功能,以实现简单鲁棒的FOC算法: 28 | - 硬件配置 29 | - ADC分辨率与频率 30 | - 自动零偏移查找 31 | - 驱动器同步 32 | - ADC模拟量采集的事件触发 33 | - 驱动器相位自适应对准 34 | - 读取相电流 35 | - 电流矢量幅值的计算 36 | - FOC d和q电流的计算 37 | 38 | 每个实现的类都可以用作独立类,它们也可以用于读取Arduino SimpleFOClibrary范围之外的BLDC驱动器输出的电流值,请参见`utils > current_sense_test`中的示例代码。 39 | 40 | 为了使FOC算法工作,电流检测类与`BLDCMotor` 类相链接,该类使用驱动器读取FOC电流。 41 | 42 | ## 🎯我们的执行目标 43 | 电流检测代码希望支持尽可能多的不同驱动程序,同时也希望可以完全互换。由于针对不同MCU架构,ADC采集会有不同的硬件实现,以及不同电流传感方法对驱动器/ADC同步要求非常不同,该任务可能是SmpleFOC库中最复杂的挑战之一远的因此,这项工作将在迭代中完成,并且每个版本都将越来越好地提供支持。请确保遵循github并[检查发行版](https://github.com/simplefoc/Arduino-FOC/releases). 44 | 45 | 同时确保关注我们的[社区论坛](https://community.simplefoc.com),许多关于当前传感及其应用的讨论正在进行中! 46 | 47 | ## 各MCU架构支持列表 48 | 49 | | MCU | 在线电流检测 | 低压侧电流检测 | 高压侧电流检测 | 50 | | ------------------ | ------------ | -------------- | -------------- | 51 | | Arduino (8-bit) | ✔️ | ❌ | ❌ | 52 | | Arduino DUE | ✔️ | ❌ | ❌ | 53 | | stm32 (in general) | ✔️ | ❌ | ❌ | 54 | | stm32f1 family | ✔️ | ✔️ (单电机) | ❌ | 55 | | stm32f4 family | ✔️ | ✔️ (单电机) | ❌ | 56 | | stm32g4 family | ✔️ | ✔️ (单电机) | ❌ | 57 | | stm32 B_G431B_ESC1 | ✔️ | ✔️ | ❌ | 58 | | esp32 | ✔️ | ✔️ | ❌ | 59 | | esp8266 | ❌ | ❌ | ❌ | 60 | | samd21 | ✔️ | ✔️ (单电机) | ❌ | 61 | | samd51 | ✔️ | ❌ | ❌ | 62 | | teensy | ✔️ | ❌ | ❌ | 63 | | Raspberry Pi Pico | ✔️ | ❌ | ❌ | 64 | | Portenta H7 | ✔️ | ❌ | ❌ | 65 | 66 | ## 深入挖掘 67 | 有关当前传感及其与FOC和运动的集成的更多理论解释和源代码实现,请查看[深入挖掘](http://simplefoc.cn/#/simplefoc_translation/3.5%E6%B7%B1%E5%85%A5%E7%A0%94%E7%A9%B6/3.5.0%E6%B7%B1%E5%85%A5%E7%A0%94%E7%A9%B6)。 68 | 69 | -------------------------------------------------------------------------------- /docs/simplefoc_library/code/drivers/bldc_driver/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: 无刷直流驱动器配置 4 | nav_order: 1 5 | permalink: /bldcdriver 6 | parent: 驱动器 7 | grand_parent: 代码 8 | grand_grand_parent: Arduino SimpleFOClibrary 9 | has_children: True 10 | has_toc: False 11 | --- 12 | 13 | # 无刷直流驱动器配置 14 | 15 |
16 | 17 |
18 | 19 | Arduino SimpleFOClibrary 支持2种无刷直流驱动器控制接口:
20 | - [3PWM ](bldcdriver3pwm) - 类 `BLDCDriver3PWM` 21 | - [6PWM ](bldcdriver6pwm) - 类 `BLDCDriver6PWM` 22 | 23 | `BLDCDriver3PWM` 类和 `BLDCDriver6PWM` 类为支持的平台提供所有硬件/平台特定代码的抽象层: atmega328, esp32, stm32 and teensy 。 24 | 他们可以实现: 25 | 26 | - PWM 配置 27 | - PWM 频率 28 | - PWM 中心-对齐 29 | - 互补通道 (6PWM) 30 | - 死区时间 (6PWM) 31 | - PWM 占空比设置 32 | - 电压限制 33 | 34 | 这些类可以作为独立类使用,可以用于为无刷电机驱动器输出特定的PWM,参见 `utils > driver_standalone_test` 实例。 35 | 36 | 为了运行FOC算法, `BLDCDriverxPWM` 类连接到 `BLDCMotor` 类,该类使用驱动器来设置适当的相位电压。 37 | 38 | 该代码可以适应不同的驱动器,并且通用性高。 39 | 40 | ## Digging deeper(深入挖掘) 41 | 更多实现的 FOC 算法的理论解释、源代码和运动控制方法,请参阅 [深入挖掘的部分](digging_deeper) 。 42 | -------------------------------------------------------------------------------- /docs/simplefoc_library/code/drivers/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: 驱动器 4 | nav_order: 3 5 | parent: 代码 6 | permalink: /drivers_config 7 | grand_parent: Arduino SimpleFOClibrary 8 | has_children: True 9 | has_toc: False 10 | --- 11 | 12 | # 驱动器配置 13 | 14 |
15 | 16 |
17 | 18 | Arduino SimpleFOClibrary 支持无刷直流电机和步进电机: 19 | 20 | - 无刷直流电机 21 | 22 | - **3 路PWM 信号** ( 3 相 ) - `BLDCDriver3PWM` 23 | - **6 路PWM 信号** ( 3 相 ) - `BLDCDriver6PWM` 24 | - 步进电机 25 | 26 | - **4路PWM信号** ( 2 相 ) - `StepperDriver4PWM` 27 | - **2路PWM信号** ( 2 相 ) - `StepperDriver2PWM` 28 | 29 | 该代码可以适应不同的驱动器,通用性高。 30 | 这些类可以作为独立的类使用,可以用来设置某些PWM值作为驱动器输出,参见 `utils > driver_standalone_test` 中的实例代码。 31 | 32 | 33 | 34 | ## 各MCU架构的支持模式 35 | 36 | | MCU | 2路 PWM 模式 | 4路PWM 模式 | 3 路PWM 模式 | 6路 PWM 模式 | pwm频率配置 | 37 | | ----------------- | ------------ | ----------- | ------------ | ------------ | ------------------------ | 38 | | Arduino (8-bit) | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ (either 4kHz or 32kHz) | 39 | | Arduino DUE | ✔️ | ✔️ | ✔️ | ❌ | ✔️ | 40 | | stm32 | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | 41 | | esp32 | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | 42 | | esp8266 | ✔️ | ✔️ | ✔️ | ❌ | ✔️ | 43 | | samd21/51 | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | 44 | | teensy | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | 45 | | Raspberry Pi Pico | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | 46 | | Portenta H7 | ✔️ | ✔️ | ✔️ | ❌ | ✔️ | -------------------------------------------------------------------------------- /docs/simplefoc_library/code/drivers/stepper_driver/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: 步进驱动程序配置 4 | nav_order: 2 5 | permalink: /stepperdriver 6 | parent: 驱动器 7 | grand_parent: 代码 8 | grand_grand_parent: Arduino SimpleFOClibrary 9 | has_children: True 10 | has_toc: False 11 | 12 | --- 13 | 14 | # 步进驱动程序配置 15 | 16 |
17 | 18 |
19 | 20 | Arduino SimpleFOClibrary 实现了对两种类型的步进驱动程序控制接口的支持:
21 | 22 | - [4PWM ](stepper_driver_4pwm) - class `StepperDriver4PWM` 23 | - [2PWM ](stepper_driver_2pwm) - class `StepperDriver2PWM` 24 | 25 | `StepperDriver2PWM`和`StepperDriver4PWM`为所有受支持的平台提供了所有硬件/平台特定代码的抽象层:atmega328、esp32、stm32、sam、samd和teensy。 26 | 它们执行: 27 | 28 | - PWM配置 29 | - 脉宽调制频率 30 | - PWM中心对准 31 | - 方向通道处理(2PWM) 32 | - 互补方向通道(4PWM) 33 | - PWM占空比设置 34 | - 限压 35 | 36 | 这些类可作为独立类使用,并可用于设置步进驱动器输出的特定PWM值,请参见`utils > driver_standalone_test`. 37 | 38 | 为了使FOC算法工作,`StepperDriverxPWM`链接到`StepperMotor`,该类使用驱动器设置适当的相电压。 39 | 40 | 驱动程序代码的编写方式可以支持尽可能多的不同驱动程序,并且可以完全互换。 41 | 42 | ## 深入挖掘 43 | 有关FOC算法和运动控制方法的更多理论解释和源代码实现,请查看 [digging deeper section](digging_deeper)。 44 | 45 | -------------------------------------------------------------------------------- /docs/simplefoc_library/code/drivers_library.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: SimpleFOC Drivers Library 4 | nav_order: 9 5 | permalink: /drivers_library 6 | parent: Writing the Code 7 | grand_parent: Arduino SimpleFOClibrary 8 | has_children: False 9 | has_toc: False 10 | --- 11 | 12 | 13 | # SimpleFOC drivers library 14 | 15 | ![Library Compile](https://github.com/simplefoc/Arduino-FOC-Drivers/workflows/Library%20Compile/badge.svg) 16 | ![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg) 17 | ![arduino-library-badge](https://www.ardu-badge.com/badge/Simple%20FOC%20Drivers.svg?) 18 | 19 | SimpleFOClibrary 的主要目标是为无刷直流电机和步进电机提供有效的低电平运动控制。 20 | 21 | 在实现FOC控制的电机系统时,你可能会有大量的硬件和软件选择——比如整个驱动板、不同的传感器、集成驱动ic、不同的通信协议等等。 22 | 23 | 主库不可能涵盖所有这些选择而变得难以理解、维护和使用。因此,我们尽可能保持核心库的精简——只保留电机驱动的算法、不同MCU的PWM支持、以及一些通用的传感器和通信组件。 24 | 25 | 主库包含的核心内容足以解决主要的运动控制,此外其他库还有可用于系统其他功能的源代码。 26 | 27 | SimpleFOC drivers library就是其中一个库。 28 | 29 | ## 这是什么? 30 | 31 | SimpleFOClibrary 是驱动程序和源代码的集合。 32 | 33 | ## 库里面有什么? 34 | 35 | 目前库里有(以后会继续增加内容): 36 | 37 | - TI的三相电机驱动器DRV8316的驱动程序 38 | - 用于不同磁传感器IC的各种驱动程序 39 | - 用于I2C的通信驱动程序 40 | 41 | ## 它的优点? 42 | 43 | - 驱动库中的驱动程序让那些不能与标准核心库运行的组件能够启用。例如,通用的MagneticSensorSPI类不支持TLE5012B传感器,但是在驱动库中有一个特定的驱动程序可以启用它。 44 | - 驱动库中的驱动程序会有扩展的功能。例如AS5048A传感器是由通用的MagneticSensorSPI类支持的,它的特定驱动程序允许查询它的其他寄存器,允许检测传感器错误,而且更容易使用,因为它有设置“嵌入”。 45 | - 使用提供的通信驱动程序作为起点,不仅可以让您快速入门,而且还可以使您的解决方案结合其他解决方案一起使用(或更容易适应其他方案)。 46 | 47 | ## 怎么使用它? 48 | 49 | ```c++ 50 | #include "SimpleFOCDrivers.h" 51 | ``` 52 | 53 | 它在arduino库管理器中,称为“简单FOC驱动程序”。在arduino IDE或PlatformIO中正常安装arduino库。 54 | 55 | 要使用库中的某些代码,要包含特定驱动模块。例如: 56 | 57 | ```c++ 58 | #include "encoders/as5048a/MagneticSensorAS5048A.h" 59 | ``` 60 | 61 | 然后检查README的具体驱动程序的进一步说明,如果你有疑惑,可以在论坛中提问! 62 | 63 | ### GitHub 64 | 65 | 你可以在这里找到源代码: 66 | 67 | [https://github.com/simplefoc/Arduino-FOC-drivers](https://github.com/simplefoc/Arduino-FOC-drivers). 68 | 69 | 70 | ## 文档 71 | 72 | 每个模块/驱动程序都记录在其README文件中,该文件可以在其各自的子目录中找到。 73 | 74 | 主库的[README](https://github.com/simplefoc/Arduino-FOC-drivers)中有一个索引,可以帮助您查找内容。 75 | 76 | 77 | ## 我们是如何决定这个库放什么的? 78 | 79 | 在开发SimpleFOC库时,我们有时会开发一些代码来支持与核心库没有直接关系的项目,或者接收一些不太匹配的代码。在驱动库中可以找到这些代码。 80 | 81 | 因此,驱动库中的代码类别是: 82 | 83 | - 适用于特定硬件的代码,比如特定的传感器或驱动芯片 84 | - 解决了与电机控制相关的某些问题 85 | - 实现特定的通信协议 86 | 87 | 驱动库中的代码: 88 | 89 | - 不适用于大部分用户,所以没有测试得特别好 90 | - 不像核心库那样有完整的文档 91 | - 可能更适合有经验的用户 92 | 93 | -------------------------------------------------------------------------------- /docs/simplefoc_library/code/motion_control/closed_loop_control/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: 闭环控制 4 | description: "Arduino Simple Field Oriented Control (FOC) library ." 5 | permalink: /closed_loop_motion_control 6 | nav_order: 2 7 | has_children: True 8 | has_toc: False 9 | parent: 运动控制 10 | grand_parent: 代码 11 | grand_grand_parent: Arduino SimpleFOClibrary 12 | --- 13 | # 闭环运动控制 14 | 15 | + 25 | 26 | 位置控制 27 | 速度控制 28 | 力矩控制 29 | 30 | 31 | 32 | 33 | 34 | SimpleFOClibrary 提供给你三种不同的闭环控制方法: 35 | 36 | - [力矩控制环](torque_control) 37 | 38 | - [力矩控制环](voltage_loop) 39 | - [速度运动控制](velocity_loop) 40 | - [位置/角度运动控制](angle_loop) 41 | 42 | 你可以通过改变 `motor.controller` 变量。如果你想控制电机的角度,你可以设置 `controller` 到 `MotionControlType::angle`, 43 | 44 | 如果你想通过电压或电流来寻求无刷直流电机的扭矩,请使用 `MotionControlType::torque`如果你想控制电机的角速度 `MotionControlType::velocity`。 45 | 46 | ```cpp 47 | // 设置FOC运动控制环 48 | // MotionControlType::torque(力矩控制) 49 | // MotionControlType::velocity(速度控制) 50 | // MotionControlType::angle(角度控制) 51 | motor.controller = MotionControlType::angle; 52 | ``` 53 | 54 | 这有关运动控制策略的源代码实现的更多信息,请查看 [library source code documentation](motion_control_implementation) -------------------------------------------------------------------------------- /docs/simplefoc_library/code/motion_control/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: 运动控制 4 | parent: 代码 5 | description: "Arduino Simple Field Oriented Control (FOC) library ." 6 | permalink: /motion_control 7 | nav_order: 6 8 | has_children: True 9 | has_toc: False 10 | grand_parent: Arduino SimpleFOClibrary 11 | --- 12 | # 运动控制 13 | SimpleFOClibrary 有两个主要参数来定义要使用的运动控制架构(每个参数都可以实时修改): 14 | 15 | - 运动控制模式 - `motor.controller` 16 | - [Closed-loop motion control](closed_loop_motion_control) - -带有位置传感器 17 | - [Open-loop motion control](open_loop_motion_control) - 无位置传感器 18 | - [力矩控制模式](torque_control) - `motor.torque_controller` 19 | - 仅用于闭环控制模式 20 | 21 | ## 力矩控制模式 22 | 在SimpleFOClibrary中有三种扭矩控制类型: 23 | - 电压 - `TorqueControlType::voltage` 24 | - 直流电流 - `TorqueControlType::dc_current` 25 | - FOC电流 - `TorqueControlType::foc_current` 26 |
⚠️ 这个参数不用于开环控制下
27 | 28 | 它们可以通过改变运动属性来设置 `torque_controller`. 29 | ```cpp 30 | // 设置力矩模式 31 | // TorqueControlType::voltage (默认) 32 | // TorqueControlType::dc_current 33 | // TorqueControlType::foc_current 34 | motor.torque_controller = TorqueControlType::foc_current; 35 | ``` 36 | 37 | 有关不同扭矩模式的更深入的解释,请访问 [torque mode docs](torque_control) 38 | 39 | ## 运动控制模式 40 | SimpleFOClibrary 有两种运动控制模式: 41 | 42 | - [Closed-loop control](closed_loop_motion_control) - 带位置传感器 43 | - [Open-loop control](open_loop_motion_control) - 无位置传感器 44 | 45 | ### 闭环运动控制 46 | 在SimpleFOClibrary的闭环有三种控制类型: 47 | - 力矩- `MotionControlType::torque` 48 | - 速度 - `MotionControlType::velocity` 49 | - 角 - `MotionControlType::angle` 50 | 51 | 通过改变电机的`controller`控制器参数来设定。 52 | 53 | ```cpp 54 | // 设置运动控制环 55 | // MotionControlType::torque 56 | // MotionControlType::velocity 57 | // MotionControlType::angle 58 | motor.controller = MotionControlType::angle; 59 | ``` 60 | 如果了解更多关于不同闭环控制的深入解释,请访问: [closed-loop control docs](closed_loop_motion_control) 61 | 62 | ### 开环控制 63 | 此外,你可以运行电机在开环,没有位置传感器反馈,以及: 64 | - 速度开环控制- `MotionControlType::velocity_openloop` 65 | - 位置开环控制 - `MotionControlType::angle_openloop` 66 | 67 |
索引搜索使用也使用开环位置控制,但有一些额外的参数,见 index search
68 | 你也可以通过设置电机的`controller`参数来实现。 69 | 70 | ```cpp 71 | // MotionControlType::velocity_openloop - 开环速度控制 72 | // MotionControlType::angle_openloop - 开环位置控制 73 | motor.controller = MotionControlType::angle_openloop; 74 | ``` 75 | 关于不同的闭环控制的深入解释,请访问[open-loop control docs](open_loop_motion_control) 76 | 77 | 有关运动控制策略的源代码实现的更多信息,请查看 [library source code documentation](motion_control_implementation) -------------------------------------------------------------------------------- /docs/simplefoc_library/code/motion_control/open_loop/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: 开环控制 4 | description: "Arduino Simple Field Oriented Control (FOC) library ." 5 | permalink: /open_loop_motion_control 6 | nav_order: 3 7 | has_children: True 8 | has_toc: False 9 | parent: 运动控制 10 | grand_parent: 代码 11 | grand_grand_parent: Arduino SimpleFOClibrary 12 | --- 13 | # 开环运动控制 14 | 15 | 25 | 位置控制 26 | 速度控制 27 | 28 | 29 | 30 | 31 | SimpleFOClibrary 为你提供两种不同的开环控制方法,控制方法无需位置传感器 32 | 33 | - [开环速度控制](velocity_openloop) 34 | - [开环位置控制](angle_openloop) 35 | 36 |
索引搜索也使用开环位置控制,但有一些额外的参数,见 index search
37 | ```cpp 38 | // MotionControlType::velocity_openloop - 开环速度控制 39 | // MotionControlType::angle_openloop - 开环位置控制 40 | motor.controller = MotionControlType::angle_openloop; 41 | ``` 42 | 43 | 有关运动控制策略的源代码实现的更多信息,请查看 [library source code documentation](motion_control_implementation) 44 | 45 | -------------------------------------------------------------------------------- /docs/simplefoc_library/code/motion_control/open_loop/index_search.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: 索引搜索程序 4 | nav_order: 3 5 | permalink: /index_search_loop 6 | parent: Open-Loop control 7 | grand_parent: Motion Control 8 | grand_grand_parent: Writing the Code 9 | grand_grand_grand_parent: Arduino SimpleFOClibrary 10 | --- 11 | 12 | # 索引搜索程序 13 | 只有当`Encoder` 的构造函数提供了索引引脚时,才能执行索引搜索程序。该程序首先使电机恒定转速运动,而后便进行索引引脚的搜索。要设置电机的转速,可以修改参数: 14 | 15 | ```cpp 16 | // 索引搜索速度 - 默认为1rad/s 17 | motor.velocity_index_search = 2; 18 | ``` 19 | 索引搜索会在`motor.initFOC()`函数中执行。 20 | 21 | 该程序的速度控制环实际上与 [开环速度](/velocity_loop) 控制相同,唯一的区别是电压设定值将不在是`motor.volatge_limit` (或 `motor.curren_limit*motor.phase_resistance`)而是`motor.voltage_sensor_align`. 22 | 23 | 24 | 25 | ## 使用索引搜索的代码示例 26 | 27 | 这是一个运动控制的例程,它使用编码器作为位置传感器,特别是带索引的编码器。索引搜索速度设置为`3 RAD/s`: 28 | 29 | ```cpp 30 | // 索引搜索速度 [rad/s] 31 | motor.velocity_index_search = 3; 32 | ``` 33 | 34 | 在 `motor.initFOC()`中通过索引搜索对齐电机和位置传感器后,电机将以角速度 `2 RAD/s` 开始旋转并保持此速度。 35 | 36 | ```cpp 37 | #include 38 | 39 | // 电机实例 40 | BLDCMotor motor = BLDCMotor(11); 41 | // 驱动器实例 42 | BLDCDriver3PWM driver = BLDCDriver3PWM(9, 10, 11, 8); 43 | 44 | // 编码器实例 45 | Encoder encoder = Encoder(2, 3, 500, A0); 46 | // 回调通道A和B 47 | void doA(){encoder.handleA();} 48 | void doB(){encoder.handleB();} 49 | void doIndex(){encoder.handleIndex();} 50 | 51 | 52 | void setup() { 53 | 54 | // 初始化编码传感器硬件 55 | encoder.init(); 56 | encoder.enableInterrupts(doA, doB,doIndex); 57 | 58 | // 连接电机和传感器 59 | motor.linkSensor(&encoder); 60 | 61 | // 配置驱动器 62 | driver.init(); 63 | motor.linkDriver(&driver); 64 | 65 | // 索引搜索速度 [rad/s] 66 | motor.velocity_index_search = 3; // rad/s 67 | motor.voltage_sensor_align = 4; // Volts 68 | 69 | // 设置运动控制环 70 | motor.controller = MotionControlType::velocity; 71 | 72 | // 配置控制器 73 | // 默认参数见defaults.h 74 | 75 | // 速度PI控制器参数 76 | motor.PID_velocity.P = 0.2; 77 | motor.PID_velocity.I = 20; 78 | // 默认为电源电压 79 | motor.voltage_limit = 6; 80 | // 基于斜坡电压的急动控制 81 | // 默认值为300v/s,即0.3v/ms 82 | motor.PID_velocity.output_ramp = 1000; 83 | 84 | // 速度低通滤波时间常数 85 | motor.LPF_velocity.Tf = 0.01; 86 | 87 | 88 | // 监视串口 89 | Serial.begin(115200); 90 | // 如果不需要,可以注释掉此行 91 | motor.useMonitoring(Serial); 92 | 93 | // 初始化电机 94 | motor.init(); 95 | // 校准编码器,启用FOC 96 | motor.initFOC(); 97 | 98 | 99 | Serial.println("Motor ready."); 100 | _delay(1000); 101 | } 102 | 103 | // 角度设置点变量 104 | float target_velocity = 2; 105 | 106 | void loop() { 107 | // FOC算法主函数 108 | motor.loopFOC(); 109 | 110 | // 运动控制函数 111 | motor.move(target_velocity); 112 | 113 | } 114 | 115 | ``` 116 | -------------------------------------------------------------------------------- /docs/simplefoc_library/code/motors/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: 电机配置代码 4 | nav_order: 2 5 | parent: 代码 6 | permalink: /motors_config 7 | grand_parent: Arduino SimpleFOClibrary 8 | has_children: True 9 | has_toc: False 10 | --- 11 | 12 | # 电机配置代码 13 | 14 |
15 | 16 |
17 | 18 | Arduino SimpleFOClibrary 支持两种类型的无刷直流电机: 19 | 20 | - [BLDC motors(无刷直流电机) ](bldcmotor) 21 | - 3 相 (3 线) 22 | - 云台高性能无刷直流电机 23 | - [Stepper motors(步进电机) ](steppermotor) 24 | - 2 相 (4 线) 25 | 26 | 电机代码的编写可以支持多种不同的电机,并且可以实现可以实现替换。 27 | 28 | ## 深入挖掘 29 | 更多 FOC 算法和运动控制方法的理论解释和源代码实现,请查看 [深入挖掘的部分](digging_deeper) 。 -------------------------------------------------------------------------------- /docs/simplefoc_library/code/sensors/magnetic/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: 磁力传感器 4 | parent: 位置传感器 5 | grand_parent: 代码 6 | grand_grand_parent: Arduino SimpleFOClibrary 7 | description: "Arduino Simple Field Oriented Control (FOC) library ." 8 | nav_order: 3 9 | permalink: /magnetic_sensor 10 | has_children: True 11 | has_toc: False 12 | --- 13 | 14 | 15 | # 磁力传感器 16 |
17 | 18 |
19 | 20 | 21 | 磁力传感器在这个库中 ([current version ](https://github.com/simplefoc/Arduino-FOC/releases)) 支持的通信方式有: 22 | - **SPI** - [MagneticSensorSPI](magnetic_sensor_spi) 23 | - **I2C** - [MagneticSensorI2C](magnetic_sensor_i2c) 24 | - **Analog** - [MagneticSensorAnalog](magnetic_sensor_analog) 25 | - **PWM** - [MagneticSensorPWM](magnetic_sensor_pwm) 26 | - **ABI** - *equivalent to encoder sensors* - [encoder docs ](encoder) 27 | - **UVW** - *equivalent to hall sensors* - [hall sensors docs ](hall_sensors). 28 | 29 | -------------------------------------------------------------------------------- /docs/simplefoc_library/code/sensors/magnetic/magnetic_sensor_analog.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: 磁性传感器模拟输出设置 4 | parent: 磁力传感器 5 | grand_parent: 位置传感器 6 | grand_grand_parent: 代码 7 | grand_grand_grand_parent: Arduino SimpleFOClibrary 8 | description: "Arduino Simple Field Oriented Control (FOC) library ." 9 | nav_order: 3 10 | permalink: /magnetic_sensor_analog 11 | --- 12 | 13 | 14 | # 磁性传感器模拟输出设置 15 | 16 | 要用磁性位置传感器的模拟输出,首先创建一个`MagneticSensorAnalog` 的实例: 17 | 18 | ```cpp 19 | // MagneticSensorAnalog(uint8_t _pinAnalog, int _min, int _max) 20 | // pinAnalog - 此引脚可以从磁性传感器读取模拟输出 21 | // min_raw_count - 预期读取的最小数值 22 | // max_raw_count - 读取的最大数值 23 | MagneticSensorAnalog sensor = MagneticSensorAnalog(A1, 14, 1020); 24 | ``` 25 | 26 | 这个类的参数有: 27 | - `pinAnalog` - 读取磁性传感器模拟输出的引脚, , 28 | - `min_raw_count` - 最小的预期读数。虽然你可能期望它是O,但通常是0~15。如果出现这种错误,将导致每次旋转会轻轻咔哒一下。 29 | - `max_raw_count` - 读取的最大值。虽然你可能期望它是2^10 = 1023,但它通常是1020~1023。注意:仅对于ESP32(带有12位ADC的MCU会接近4096) 30 | 31 |

💡 求最小值和最大值

32 | 每种mcu,每种传感器都有一点不同,所以我们建议你使用提供的例程 examples/sensor_test/magentic_sensor_analog_example/find_raw_min_max来确定你的传感器的最大值和最小值 33 |
34 | 35 | 36 | 最后,在初始化之后,唯一需要做的事情就是调用 `init()` 函数。该函数初始化传感器硬件。所以你的磁性传感器初始化代码如下: 37 | 38 | ```cpp 39 | MagneticSensorAnalog sensor = MagneticSensorAnalog(A1, 14, 1020); 40 | 41 | void loop(){ 42 | ... 43 | sensor.init(); 44 | ... 45 | } 46 | ``` 47 | 48 | 如果你希望使用多个模拟输出的磁性传感器,请确保将它们的模拟输出引脚连接到不同的arduino ADC引脚上,并遵循上面的相同想法,这里是一个简单的例子: 49 | 50 | ```cpp 51 | MagneticSensorAnalog sensor1 = MagneticSensorAnalog(A1, 14, 1020); 52 | MagneticSensorAnalog sensor2 = MagneticSensorAnalog(A2, 14, 1020); 53 | 54 | void loop(){ 55 | ... 56 | sensor1.init(); 57 | sensor2.init(); 58 | ... 59 | } 60 | ``` 61 | 62 | 请检查 `magnetic_sensor_analog_example.ino` 举个例子来了解更多。 63 | 64 | 65 | ## 实时使用磁性传感器 66 | 67 | . 在这个库中有两种方法来使用磁性传感器: 68 | 69 | - 作为电机位置传感器,用于FOC算法 70 | - 作为独立位置传感器。 71 | 72 | ### 用于FOC算法的位置传感器 73 | 74 | 在本库中要用位置传感器来实现FOC算法的话,一旦初始化了 `sensor.init()` ,就需要链接到无刷直流电机: 75 | 76 | ```cpp 77 | motor.linkSensor(&sensor); 78 | ``` 79 | 80 | ### 独立的传感器 81 | 82 | 要在任意时刻获取磁性传感器输出的速度和角度,可以用下面的公共函数: 83 | 84 | ```cpp 85 | class MagneticSensorSPI{ 86 | public: 87 | // 获取轴速度 88 | float getVelocity(); 89 | // 获取轴角度 90 | float getAngle(); 91 | } 92 | ``` 93 | 94 | ```cpp 95 | class MagneticSensorAnalog{ 96 | public: 97 | // 获取轴速度 98 | float getVelocity(); 99 | // 获取轴角度 100 | float getAngle(); 101 | } 102 | ``` 103 | 104 | 下面是一个使用AS5600磁性传感器模拟输出的快速示例: 105 | 106 | ```cpp 107 | #include 108 | 109 | // MagneticSensorAnalog(uint8_t _pinAnalog, int _min, int _max) 110 | // pinAnalog - 此引脚可以从磁性传感器读取模拟输出 111 | // min_raw_count - 预期读取的最小数值 112 | // max_raw_count - 读取的最大数值 113 | MagneticSensorAnalog sensor = MagneticSensorAnalog(A1, 14, 1020); 114 | 115 | void setup() { 116 | // 监视点 117 | Serial.begin(115200); 118 | 119 | // 初始化磁性传感器硬件 120 | sensor.init(); 121 | 122 | Serial.println("Sensor ready"); 123 | _delay(1000); 124 | } 125 | 126 | void loop() { 127 | // 在终端显示角度和角速度 128 | Serial.print(sensor.getAngle()); 129 | Serial.print("\t"); 130 | Serial.println(sensor.getVelocity()); 131 | } 132 | ``` -------------------------------------------------------------------------------- /docs/simplefoc_library/digging_deeper/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: 深入研究 4 | nav_order: 7 5 | parent: Arduino SimpleFOClibrary 6 | description: "Arduino Simple Field Oriented Control (FOC) library ." 7 | permalink: /digging_deeper 8 | has_children: True 9 | has_toc: false 10 | --- 11 | 12 | # 深入挖掘SimpleFOClibrary 13 | 14 | 此部分内容专为帮助你更好地理解底层算法,学会将此算法扩展到你的程序而设。 15 |
16 |
17 | 18 | 19 |

Library库源代码

20 |
21 |

深入讲解library库的实现方案以及传感、运动控制、FOC算法。

22 |
23 |
24 | 25 | 26 |

理论爱好者中心

27 |
28 |

讨论算法和SimpleFOClibrary不同部分的理论知识。

29 |
30 |
31 | 32 | 33 | -------------------------------------------------------------------------------- /docs/simplefoc_library/digging_deeper/libray_source/communication.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: 电机命令 4 | parent: Arduino SimpleFOClibrary 源代码 5 | nav_order: 4 6 | permalink: /commands_source 7 | grand_parent: 深入研究 8 | grand_grand_parent: Arduino SimpleFOClibrary 9 | --- 10 | 11 | # **电机命令列表**[v2.1](https://github.com/simplefoc/Arduino-FOC/releases) 12 | 13 | 从输入指令界面输入命令ID,调用库源中由头文件中的默认值定义:`src/communication/commands.h`,hre是hte命令的列表: 14 | 15 | ```cpp 16 | 17 | // 命令列表 18 | #define CMD_C_D_PID 'D' //!< 电流d PID和LPF 19 | #define CMD_C_Q_PID 'Q' //!< 电流q PID和LPF 20 | #define CMD_V_PID 'V' //!< 电压 PID和LPF 21 | #define CMD_A_PID 'A' //!< 角度 PID 和 LPF 22 | #define CMD_STATUS 'E' //!< 电机状态启用/禁用 23 | #define CMD_LIMITS 'L' //!< 限制电流/电压/速度 24 | #define CMD_MOTION_TYPE 'C' //!< 运动控制类型 25 | #define CMD_TORQUE_TYPE 'T' //!< 转矩控制类型 26 | #define CMD_SENSOR 'S' //!< 传感器补偿 27 | #define CMD_MONITOR 'M' //!< 监控 28 | #define CMD_RESIST 'R' //!< 电机相阻抗 29 | 30 | // commander配置 31 | #define CMD_SCAN '?' //!< 命令扫描网络 - 仅为commander 32 | #define CMD_VERBOSE '@' //!< 命令设置输出模式 - 仅为commander 33 | #define CMD_DECIMAL '#' //!< 命令设置小数点 - 仅为commander 34 | 35 | // subcomands 36 | //pid - lpf 37 | #define SCMD_PID_P 'P' //!< PID增益P 38 | #define SCMD_PID_I 'I' //!< PID增益I 39 | #define SCMD_PID_D 'D' //!< PID增益D 40 | #define SCMD_PID_RAMP 'R' //!< PID坡道 41 | #define SCMD_PID_LIM 'L' //!< PID限制 42 | #define SCMD_LPF_TF 'F' //!< 通滤波器时间常数 43 | // limits 44 | #define SCMD_LIM_CURR 'C' //!< 极限电流 45 | #define SCMD_LIM_VOLT 'U' //!< 极限电压 46 | #define SCMD_LIM_VEL 'V' //!< 极限速度 47 | //sensor 48 | #define SCMD_SENS_MECH_OFFSET 'M' //!< 传感器补偿 49 | #define SCMD_SENS_ELEC_OFFSET 'E' //!< 传感器电零点补偿 50 | // monitoring 51 | #define SCMD_DOWNSAMPLE 'D' //!< 监控下行样本值 52 | #define SCMD_CLEAR 'C' //!< 清除所有监控变量 53 | #define SCMD_GET 'G' //!< 只获取变量的一个值 54 | #define SCMD_SET 'S' //!< 设置要监视的变量 55 | ``` 56 | 57 | 通过修改该头文件,你可以修改整个库的默认命令字符。 58 | -------------------------------------------------------------------------------- /docs/simplefoc_library/digging_deeper/libray_source/examples.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: 库实例 4 | parent: Arduino SimpleFOClibrary 源代码 5 | nav_order: 5 6 | permalink: /library_examples 7 | grand_parent: 深入研究 8 | grand_grand_parent: Arduino SimpleFOClibrary 9 | --- 10 | 11 | # **库实例**[v1.6](https://github.com/simplefoc/Arduino-FOC/releases) 12 | 13 | 此库附带“32”个文档化示例,展示了库的基本用法,包括: 14 | 15 | - **不同的微控制器架构**: 16 | - Arduino UNO,Nucleo:除了 `hardware_specific_examples`以外的所有内容 17 | - Bluepill:`bluepill_position_control.ino` 18 | - HMBGC万向节控制器: `position_control.ino`、`voltage_control.ino` 19 | - ESP32控制器 : `position_control.ino`、 `voltage_control.ino` 20 | - **不同位置传感器**: 21 | - 编码器 22 | - 磁传感器(SPI、I2C、模拟), 23 | - 霍尔传感器 24 | - **不同的BLDC驱动器**: 25 | - SimpleFOCShield 26 | - HMBGC万向节控制器: `HMBGC_example` 27 | - DRV8302: `DRV8305_driver` 28 | - **不同的运动控制**: 29 | - 力矩/电压控制: `torque_voltage_control.ino` 30 | - 速度控制: `velocity_motion_control.ino` 31 | - 位置/角度控制: `position_motion_control.ino` 32 | - 开环速度: `open_loop_velocity_example.ino` 33 | - 开环位置/角度: `open_loop_position_example.ino` 34 | - **大量的实用功能**: 35 | - 求极对数: `find_pole_pair_number.ino` 36 | - 寻找零偏移和传感器方向: `find_sensor_offset_and_direction.ino` 37 | - 传感器对准和电机齿槽测试: `alignment_and_cogging_test.ino` 38 | 39 | ## 例程文件夹结构 40 | 41 | ```shell 42 | > examples 43 | ├───hardware_specific_examples 44 | │ ├───Bluepill_examples # STM32 Bluepill 代码示例 45 | │ │ ├───encoder 46 | │ │ └───magnetic_sensor 47 | │ ├───DRV8305_driver # 使用DRV8302配置的代码示例 48 | │ │ └───motor_full_control_serial_examples 49 | │ ├───ESP32 # ESP32控制器代码的示例 50 | │ │ ├───encoder 51 | │ │ └───magnetic_sensor 52 | │ └───HMBGC_example # HMBGC控制器代码的示例 53 | │ ├───position_control 54 | │ └───voltage_control 55 | ├───motion_control 56 | │ ├───open_loop_motor_control # 开环电机控制的示例 57 | │ │ ├───open_loop_position_example 58 | │ │ └───open_loop_velocity_example 59 | │ ├─── position_motion_control # 具有配置的角度/位置运动控制回路的示例 60 | │ ├─── torque_voltage_control # 具有配置的电压/转矩控制回路的例子 61 | │ └─── velocity_motion_control # 带有配置的速度运动控制回路的示例 62 | | 63 | ├───motor_commands_serial_examples 64 | │ ├───encoder 65 | │ ├───hall_sensor 66 | │ └───magnetic_sensor 67 | └───utils 68 | ├───alignment_and_cogging_test # 预校准和锯齿性能的示例 69 | ├───find_pole_pair_number # 估计电机的极子对数的示例 70 | ├───find_sensor_offset_and_direction # 确定传感器零电位偏移量和自然方向的示例 71 | └───sensor_test # 传感器测试示例 72 | ├───encoder 73 | │ ├───encoder_example 74 | │ └───encoder_software_interrupts_example 75 | ├───hall_sensors 76 | │ ├───hall_sensor_example 77 | │ └───hall_sensor_software_interrupts_example 78 | └───magnetic_sensors 79 | ├───magnetic_sensor_analog_example 80 | ├───magnetic_sensor_i2c_example 81 | └───magnetic_sensor_spi_example 82 | ``` 83 | -------------------------------------------------------------------------------- /docs/simplefoc_library/digging_deeper/libray_source/sensors.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: 支持的传感器 4 | parent: Arduino SimpleFOClibrary 源代码 5 | grand_parent: 深入研究 6 | grand_grand_parent: Arduino SimpleFOClibrary 7 | nav_order: 3 8 | permalink: /sensor_support 9 | --- 10 | 11 | # 支持附加传感器 [v2.1](https://github.com/simplefoc/Arduino-FOC/releases) 12 | 13 | 为了能够使用一种新型传感器,该传感器采用Arduino SimpleFOClibrary实现的FOC算法,需要将其封装在一个扩展`Sensor`的类中。它只需要实现几个通用函数。 14 | 15 | ```cpp 16 | class Sensor{ 17 | public: 18 | // 获得当前角度(rad) 19 | virtual float getAngle() = 0; 20 | // 获得当前角速度(rad/s) 21 | // 已实现 22 | virtual float getVelocity(); 23 | // 如果需要搜索绝对零,则返回0 24 | // 1 - 编码器与引脚 (没找到引脚) 25 | // 0 - 每一个传感器 26 | // 默认返回0 27 | virtual int needsSearch(); 28 | } 29 | ``` 30 | 31 | ## 步骤1 头文件`MySensor.h ` 32 | 让我们制作一个新传感器实现的模型示例。我们从`MySensor.h `文件开始: 33 | 34 | ```cpp 35 | #include 36 | 37 | class MySensor: public Sensor{ 38 | public: 39 | MySensor(...); 40 | 41 | // 初始化传感器硬件 42 | void init(); 43 | 44 | // 实现 Sensor 抽象函数 45 | // 获得当前角度(rad) 46 | float getAngle(); 47 | }; 48 | ``` 49 | 50 | ## 步骤2 类实现文件 `MySensor.cpp` 51 | 现在让我们实现`MySensor.cpp` 文件: 52 | 53 | ```cpp 54 | #include "MySensor.h" 55 | 56 | MySensor::MySensor(...){ 57 | // 定义所有必要的传感器变量 58 | // 如果没有必要,也可以空着 59 | } 60 | MySensor::init(){ 61 | // 安装所有需要的传感器硬件 62 | // 例如 63 | sensor.hardwareInit(); 64 | } 65 | 66 | // 实现 Sensor 抽象函数 67 | // 获得当前角度(rad) 68 | MySensor::getAngle(){ 69 | // 直接从传感器获取位置值 70 | // 例如 71 | return sensor.read() ; 72 | } 73 | ``` 74 | 75 | ## 步骤3 Arduino项目 76 | 最后,我们将能够在Arduino代码中使用它: 77 | ```cpp 78 | #include 79 | #include "MySensor.h" 80 | 81 | // 实例化 MySensor 82 | MySensor my_sensor = MySensor(...); 83 | 84 | // 实例化运动 85 | BLDCMotor motor = BLDCMotor(...) 86 | 87 | // 驱动器 88 | BLDCDriver3PWM driver = BLDCDriver3PWM(...) 89 | 90 | void setup(){ 91 | // init MySensor 位置跟踪 92 | my_sensor.init(); 93 | 94 | // 连接 MySensor 与电机 95 | motor.linkSensor(&my_sensor); 96 | 97 | // 驱动程序配置 98 | driver.init(); 99 | motor.linkDriver(&driver); 100 | 101 | // 准备 FOC 102 | motor.init(); 103 | motor.initFOC(); 104 | } 105 | void loop(){ 106 | // do FOC 107 | motor.loopFOC(); 108 | motor.move(target); 109 | } 110 | 111 | ``` 112 | 113 | 114 | 115 | -------------------------------------------------------------------------------- /docs/simplefoc_library/digging_deeper/theory/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: 理论 4 | parent: 深入研究 5 | grand_parent: Arduino SimpleFOClibrary 6 | description: "Arduino Simple Field Oriented Control (FOC) library ." 7 | nav_order: 1 8 | permalink: /theory_corner 9 | has_children: True 10 | has_toc: False 11 | --- 12 | 13 | # 相关理论研究 14 | 15 | 本节旨在解释 Arduino Simple FOC library实现的一些有趣的理论特性。目前,我只简要地写了几个主题,但计划涵盖更多的主题,更深入。 16 | 17 |
18 |
19 | 20 |

基于电压的力矩控制

21 |
22 |

简短地解释和论证了用电压代替电流的力矩控制。

23 |
24 |
25 | 26 |

Field Oriented Control(FOC)算法

27 |
28 |

简要概述了用于无刷直流电机的FOC算法的调制方法和主要使用规则。

29 |
30 |
31 | 32 |

低通滤波理论

33 |
34 |

低通滤波器微分方程和实现细节。

35 |
36 |
37 | 38 |

PID控制器理论

39 |
40 |

PID控制器微分方程及实现细节。

41 |
42 |
43 | 44 | 45 | -------------------------------------------------------------------------------- /docs/simplefoc_library/digging_deeper/theory/low_pass_filtering.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: 低通滤波器 4 | parent: 理论 5 | grand_parent: 深入研究 6 | grand_grand_parent: Arduino SimpleFOClibrary 7 | description: "Arduino Simple Field Oriented Control (FOC) library ." 8 | nav_order: 4 9 | permalink: /low_pass_filter 10 | --- 11 | 12 | # 低通速度滤波器v2.0.2](https://github.com/simplefoc/Arduino-FOC/releases) 13 | 14 | 控制器的低通滤波器传递函数为: 15 | 16 | $$ 17 | G_f = \frac{1}{1+sT_f} 18 | $$ 19 | 20 | 离散化为: 21 | 22 | $$ 23 | v_f(k)=\frac{T_f}{T_f+T_s}v_f(k-1)+\frac{T_S}{T_f+T_s}v(k) 24 | $$ 25 | 26 | 27 | 其中vf(k)为k时刻的滤波值, v(k)k时刻的速度测量值, Tf是滤波时间常数,Ts是采样时间(或上述式子的时间间隔)。 28 | 这个低通滤波器也可以写成这样的形式: 29 | $$ 30 | v_f(k)=\alpha v_f(k-1)+(1-\alpha)v(k) 31 | $$ 32 | 其中: 33 | 34 | $$ 35 | \alpha=\frac{T_f}{T_f+T_s} 36 | $$ 37 | 38 | 39 | 40 | 41 | 上面的式子更直观地表示了在低通滤波器中常量Tf的意义。如果你的采样时间大约是1毫秒(对于arduino UNO,这可以作为平均值),那么设置 `T_f = 0.01` 将得到: 42 | 43 | ```cpp 44 | alpha = 0.01/(0.01 + 0.001) = 0.91 45 | ``` 46 | 47 | 上式表示实际的速度测量值v会通过系数1-alpha = 0.09影响到滤波后的值vf,从而令速度的变化更加平滑(平滑程序取决于实际应用)。 48 | 49 | # 实现细节 50 | 51 | 要在SimpleFOC library中是名为`LowPassFilter`的类来实现低通滤波的。 52 | 这个类在构造函数中接收时间常量: 53 | 54 | ```cpp 55 | LowPassFilter filter = LowPassFilter(0.001); // Tf = 1ms 56 | ``` 57 | 58 | 59 | 滤波的实现如下: 60 | 61 | ```cpp 62 | // 低通滤波函数 63 | float LowPassFilter::operator(float input){ 64 | unsigned long timestamp = _micros(); 65 | float dt = (timestamp - timestamp_prev)*1e-6f; 66 | // 快速修复错误的情况 (micros overflow) 67 | if (dt < 0.0f || dt > 0.5f) dt = 1e-3f; 68 | 69 | // 计算过滤 70 | float alpha = Tf/(Tf + dt); 71 | float y = alpha*y_prev + (1.0f - alpha)*x; 72 | 73 | // 保存的变量 74 | y_prev = y; 75 | timestamp_prev = timestamp; 76 | return y; 77 | } 78 | ``` 79 | 你可以在代码中调用它: 80 | ```cpp 81 | float signal_filtered = filter(signal); 82 | ``` 83 | 也可以随时改变滤波的时间常数: 84 | ```cpp 85 | filter.Tf = 0.01; // 改变为10ms 86 | ``` 87 | 这个低通滤波器是在motor中实现的,它的时间常数可以通过调用改变: 88 | 89 | ```cpp 90 | motor.LPF_velocity.Tf = 0.01;// 设置为10ms 91 | ``` 92 | 93 | -------------------------------------------------------------------------------- /docs/simplefoc_library/digging_deeper/theory/pid_controller.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: PID 控制理论 4 | parent: 理论 5 | grand_parent: 深入研究 6 | grand_grand_parent: Arduino SimpleFOClibrary 7 | description: "Arduino Simple Field Oriented Control (FOC) library ." 8 | nav_order: 3 9 | permalink: /pi_controller 10 | --- 11 | 12 | 13 | # PID控制器的理论 [v2.1](https://github.com/simplefoc/Arduino-FOC/releases) 14 | 该库实现的PID控制器传递函数为: 15 | 16 | $$ 17 | G_PID=\frac{v(s)}{e(S)}=P+\frac{I}{s}+D_s 18 | $$ 19 | 20 | 21 | 连续PID离散化,可以描述为三个分量的和: 22 | 23 | $$ 24 | u(k)=u_P(k)+u_I(k)+u_D(k) 25 | $$ 26 | 27 | 28 | 比例环: 29 | $$ 30 | u_P(k)=P_e(k) 31 | $$ 32 | 33 | 34 | 积分环: 35 | $$ 36 | u_I(k)=u_I(k-1)+I\frac{e(k)+e(k-1)}{2}T_s 37 | $$ 38 | 39 | 40 | 微分环: 41 | $$ 42 | u_D(k)=D\frac{e(k)-e(k-1)}{T_s} 43 | $$ 44 | 45 | 46 | 其中 u(k) 为k时刻的控制信号(本例中为电压Uq) ,e(k),e(k-1)为当前时刻k和前一时刻k-1的跟踪误差,跟踪误差是指目标速度值 vd与实测速度 v之间的差异。 47 | $$ 48 | e(k)=v_d(k)-v_f(k) 49 | $$ 50 | 51 | 52 | 53 | ## 实现细节 54 | PID算法在 `PIDController` 中的SimpleFOClibrary中实现。通过指定参数实例化类: 55 | 56 | ```cpp 57 | PIDController(float P, float I, float D, float ramp, float limit); 58 | ``` 59 | 该类只有一个函数: 60 | ```cpp 61 | // PID控制器的功能 62 | float PIDController::operator() (float error){ 63 | // 计算最新调用的时间 64 | unsigned long timestamp_now = _micros(); 65 | float Ts = (timestamp_now - timestamp_prev) * 1e-6; 66 | // 快速修复错误的情况 (micros overflow) 67 | if(Ts <= 0 || Ts > 0.5) Ts = 1e-3; 68 | 69 | // u(s) = (P + I/s + Ds)e(s) 70 | // 实现离散 71 | // 成比例的部分 72 | // u_p = P *e(k) 73 | float proportional = P * error; 74 | // 积分部分的Tustin变换 75 | // u_ik = u_ik_1 + I*Ts/2*(ek + ek_1) 76 | float integral = integral_prev + I*Ts*0.5*(error + error_prev); 77 | // 限制输出电压q 78 | integral = _constrain(integral, -limit, limit); 79 | // 离散的推导 80 | // u_dk = D(ek - ek_1)/Ts 81 | float derivative = D*(error - error_prev)/Ts; 82 | 83 | // 求和所有的分量 84 | float output = proportional + integral + derivative; 85 | // 限制输出变量 86 | output = _constrain(output, -limit, limit); 87 | 88 | // 通过提高输出来限制加速度 89 | float output_rate = (output - output_prev)/Ts; 90 | if (output_rate > output_ramp) 91 | output = output_prev + output_ramp*Ts; 92 | else if (output_rate < -output_ramp) 93 | output = output_prev - output_ramp*Ts; 94 | 95 | // 为下一浏览存储 96 | integral_prev = integral; 97 | output_prev = output; 98 | error_prev = error; 99 | timestamp_prev = timestamp_now; 100 | return output; 101 | } 102 | ``` 103 | 因此,你可以很容易地将PID集成到你的代码中,只需调用: 104 | 105 | ```cpp 106 | void setup(){ 107 | ... 108 | PIDController some_pid = PIDController{.....}; 109 | ... 110 | } 111 | void loop(){ 112 | float control = some_pid(target-measurement); 113 | } 114 | ``` 115 | 116 | 这个PID是在`BLDCMotor`和 `StepperMotor`中实现的,用于处理运动控制速度(`motor.PID_velocity`)和位置 (`motor.P_angle`)。你可以通过更改这些PID控制器的公共变量来更改它们的参数 117 | 118 | ```cpp 119 | // PID控制器组态结构 120 | class PIDController 121 | { 122 | ..... 123 | float P; //!< 成比例增加 124 | float I; //!< 积分增益 125 | float D; //!< 微分增益 126 | .... 127 | }; 128 | ``` 129 | 例如: 130 | ```cpp 131 | motor.PID_velocity.P = 1; 132 | motor.P_angle.P = 10; 133 | ``` -------------------------------------------------------------------------------- /docs/simplefoc_library/digging_deeper/theory/voltage_torque_control.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: 转矩控制 4 | parent: 理论 5 | grand_parent: 深入研究 6 | grand_grand_parent: Arduino SimpleFOClibrary 7 | description: "Arduino Simple Field Oriented Control (FOC) library ." 8 | nav_order: 1 9 | permalink: /voltage_torque_control 10 | --- 11 | 12 | # 基于电压的扭矩控制[v2.0.2](https://github.com/simplefoc/Arduino-FOC/releases) 13 | 14 | 在这个库中,我们使用电压作为扭矩控制参数的替代品,这是为什么,它是如何运行的? 15 | 16 | ## 这到底是如何运行的? 17 | 18 | 19 | 20 | 电压控制算法从位置传感器读取角度a,从用户获取目标Uq电压值,通过FOC算法设置电机合适的U aU bU c。FOC算法确保这些电压在电机转子中产生的磁力与其永磁体的90度偏移,这保证了最大扭矩,这称为换相。 21 | 22 | 对于精确实现直流电机原理来说这是一种困难的方法。因为对于直流电动机来说,转子所产生的磁场与定子所产生的永磁场之间的90度角是基于硬件实现的。现在,当你有FOC算法保证的90度约束,你可以使用这个电压控制方法去控制任何其他直流电机。 23 | 24 | 因此,对于直流电动机,我们知道电机扭矩 `T`与电流`I`成正比: 25 | 26 | ```cpp 27 | T = I*K 28 | ``` 29 | 其中 `K` 是由其硬件定义的电机常数。 30 | 我们还知道,电流与设定的电压`U`成正比: 31 | 32 | ```cpp 33 | I = (U - EMF)/R 34 | ``` 35 | 36 | 其中 `R`是电机内阻,`EMF`是产生的反EMF电压。这个方程没有考虑任何动力学因素,但总的来说还是很有效的。 37 | 38 | 所以我们可以从所有这些中得出的结论是(如果我们忽略EMF): 39 | 40 | ```cpp 41 | T ~ I ~ U 42 | ``` 43 | 这意味着扭矩与电流成比例。而由于电流与电压成比例,那么扭矩也与电压成比例。 44 | 45 |

注意:上述方法的约束!

这个成比例的假设只适用于静力学而不适用于动力学,这意味着由于不同的动力学效应将会有一些电流峰值。但如果电流不是很大,这些影响可以忽略。电流<5A。
46 | 对于真正的力矩控制环,我们需要测量电流,但用于电流测量的硬件在低功耗应用中并不常见,因此这种力矩控制实现是唯一绕过它的方法。
47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /docs/simplefoc_library/examples/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: 实例项目 4 | description: "Arduino Simple Field Oriented Control (FOC) library ." 5 | nav_order: 7 6 | permalink: /examples 7 | has_children: true 8 | has_toc: false 9 | parent: Arduino SimpleFOClibrary 10 | --- 11 | # SimpleFOClibrary 例程项目 12 | 13 | 19 | 25 | 31 | 37 | 43 | 49 | 55 | -------------------------------------------------------------------------------- /docs/simplefoc_library/hardware/drivers/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: 驱动板 4 | parent: 支持的硬件 5 | nav_order: 2 6 | description: "Arduino Simple Field Oriented Control (FOC) library ." 7 | permalink: /drivers 8 | grand_parent: Arduino SimpleFOClibrary 9 | has_children: true 10 | has_toc: false 11 | --- 12 | 13 | # 支持的驱动板 14 | 15 |
16 | 17 |
18 | Arduino SimpleFOClibrary的目标是支持尽可能多的无刷直流电机和步进电机驱动器。到目前为止,这个库支持两种驱动器类型: 19 | 20 | - [无刷直流电机驱动器 ](bldc_drivers) 21 | - **3路PWM信号**(3相) 22 | - **6路PWM信号**(3相) 23 | - 云台电机驱动器或高性能驱动器 24 | - [步进电机驱动器 ](stepper_drivers) 25 | - **4路PWM信号**(2相) 26 | - 步进驱动器或双直流电机驱动器 27 | 28 | # 📢在确定使用何种类型驱动之前一定要读一下这篇文章! 29 | 30 | 在用SFOC运行任何无刷电机前请首先确保你的运行硬件能够通过足够大的电机所需的电流。 31 | 32 | 最简单的方法是通过检查电机的相电阻`R`。检查你的电机的数据表,查找电阻值,或者用万用表自己测量。然后检查你的电源电压 `V_dc` 的值,测量出来的数值能帮助你推算出最大电流 `I_max` 值。 33 | 34 | ```cpp 35 | I_max = V_dc/R 36 | ``` 37 | 最后,根据驱动板数据表检查最大电流 `I_max` 值。如果 `I_max` 过高,可以降低电源电压`V_dc` ,以防止电流峰值过高。如果你不能改变你的供电电压,可以在软件中限制电机的电压设置。 38 | 39 |
40 |

注意

41 | 由上式可以计算出最坏情况下的最大电流I_max,而大多数情况下计算出的I_max会大于实际值。实际最大电流取决于电机硬件,如绕组配置和控制算法。 42 |
43 | -------------------------------------------------------------------------------- /docs/simplefoc_library/hardware/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: 支持的硬件 4 | nav_order: 2 5 | parent: Arduino SimpleFOClibrary 6 | description: "Arduino Simple Field Oriented Control (FOC) library ." 7 | permalink: /supported_hardware 8 | has_children: True 9 | has_toc: false 10 | --- 11 | 12 | # 支持SimpleFOClibrary的硬件 13 | 14 |

15 | 16 |

17 | Arduino SimpleFOClibrary的目标是使FOC算法能够普及到爱好者的日常开发中。基于这种想法,该库正在不断开发,以支持尽可能多的电机+传感器+驱动器+单片机组合。 18 | 19 | 目前支持的硬件是: 20 | 21 | - **[电机 ](motors)** 22 | 23 | - 无刷直流电机 24 | - 步进电机 25 | 26 | - **[驱动器 ](drivers)** 27 | - 无刷直流电机驱动器 28 | - 云台电机驱动器 29 | - 步进电机驱动器 30 | - **[位置传感器 ](position_sensors)** 31 | - 编码器 32 | - 磁传感器 33 | - 霍尔传感器 34 | - 开环控制 35 | - **[单片机 ](microcontrollers)** 36 | - Arduino 37 | - STM32 38 | - ESP32 39 | - Teensy 40 | 41 | # 设置示例 42 | 43 | 有关如何连接BLDC电机、驱动器、单片机和传感器的更多信息,请查看[设置示例](setup_examples) 页面。 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /docs/simplefoc_library/hardware/mcus/nRF52_mcu.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: nRF52 控制板 4 | nav_order: 9 5 | description: "Arduino Simple Field Oriented Control (FOC) library ." 6 | permalink: /nrf52_mcu 7 | parent: 单片机 8 | grand_parent: 支持的硬件 9 | grand_grand_parent: Arduino SimpleFOClibrarynRF52 boards support 10 | --- 11 | 12 | # 支持 nRF52 板 13 | 14 | MCU | 2路PWM模式 | 4路PWM模式 | 3路PWM模式 | 6路PWM模式 | pwm频率配置 15 | --- | --- |--- |--- |--- |--- 16 | nRF52 | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ 17 | 18 | 由于[@Polyphe](https://github.com/Polyphe)投入了大量的努力,Arduino SimpleFOClibrary现已开始支持nRF52板。以下这些板子目前已通过测试: 19 | 20 | 板子示意图 | 名字 | 规格 | 链接 | 价格 21 | ---- | --- | --- | --- | --- 22 | [](https://store.arduino.cc/arduino-mkr1000-wifi) | Arduino Nano 33 BLE | ARM Cortex M4F
- 3.3V logic
- 12 PWMs
- all pins interrupts
- 8 adc pins
- 64Mhz| [Arduino Store](https://store.arduino.cc/arduino-mkr1000-wifi) | 18€ 23 | [](https://www.adafruit.com/product/3406) | Adafruit Feather nRF52 Bluefruit | ARM Cortex M4F
- 3.3V logic
- 12 PWMs
- all pins interrupts
- 8 adc pins
- 64Mhz|[Adafruit Store](https://www.adafruit.com/product/3406) | 22€ 24 | 25 | 26 | ## Arduino IDE支持包 27 | 为了在 Arduino IDE 中使用 nRF52 板,请使用 Arduino IDE 板子管理器安装 nRF52 板支持包。 28 | 29 | 对于某些板子,你可能需要在你的板管理器额外安装 Adafruit nRF52 支持包到 Arduino nRF52 支持包里。 以下是一个教你如何在 Arduino IDE中使用 Adafruit 支持包的 [快速教程](https://learn.adafruit.com/bluefruit-nrf52-feather-learning-guide/arduino-bsp-setup) 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /docs/simplefoc_library/hardware/mcus/portenta.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: Portenta H7 开发板 4 | nav_order: 8 5 | description: "Arduino Simple Field Oriented Control (FOC) library ." 6 | permalink: /portenta_mcu 7 | parent: 单片机 8 | grand_parent: 支持的硬件 9 | grand_grand_parent: Arduino SimpleFOClibrary 10 | --- 11 | 12 | # Arduino PRO Portenta H7 开发板 13 | 14 | MCU | 2 路PWM 模式 | 4路PWM 模式 | 3路 PWM 模式 | 6路 PWM 模式 | pwm频率配置 15 | --- | --- |--- |--- |--- |--- 16 | Portenta H7 | ✔️ | ✔️ | ✔️ | ❌ | ✔️ 17 | 18 | Arduino SimpleFOC库目前已经通过在Arduino的合作下支持Portenta H7 开发板了。虽然尚处于初步阶段,但是大部分PWM相关的特性已经可以使用了。 19 | 20 | 21 | 22 | | 开发板 | 名称 | 规格 | 链接 | 售价 | 23 | | ------------------------------------------------------------ | ----------- | ------------------------------------------------------------ | ------------- | ---- | 24 | | [](https://store.arduino.cc/products/portenta-h7) | Portenta H7 | ST STM32H747XI 双核处理器
- 2 M Flash
- WiFi/BT 模块
- 22个定时器
- 4路DMA控制器
- 32路adc通道
- 480 MHz主频
| Arduino Store | 90€ | 25 | 26 | 27 | 28 |

提醒: 电流限制 ⚠️

29 | Portenta H7 尚处于初步支持阶段. PWM模式中的大部分已通过大量传感器的测试,但是6路PWM模式尚不可用。目前只有底板的引脚可以使用,但不适用扩展板. 30 |
31 | 32 | 33 | ## Arduino IDE 支持包 34 | 在 Arduino IDE 管理器中安装 Arduino MBED OS Poertenta H7 boards支持包后即可在Arduino IDE中使用Portenta H7开发板了。如果你不清楚如何具体操作,请点击这里的[快速入门](https://docs.arduino.cc/tutorials/portenta-h7/por-ard-gs)查看: 35 | 36 | 点击下方视频观看具体操作: 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /docs/simplefoc_library/hardware/mcus/rpi_pico.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: 树莓派 Pico 4 | nav_order: 7 5 | description: "Arduino Simple Field Oriented Control (FOC) library ." 6 | permalink: /rpi_mcu 7 | parent: 单片机 8 | grand_parent: 支持的硬件 9 | grand_grand_parent: Arduino SimpleFOClibrary 10 | --- 11 | 12 | 13 | 14 | # 支持 Rapspberry Pi Pico (rp2040) 板 15 | 16 | MCU | 2路PWM模式 | 4路PWM模式 | 3路PWM模式 | 6路PWM模式 | pwm频率配置 17 | --- | --- |--- |--- |--- |--- 18 | (RP2040) RPI Pico | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ 19 | 20 | 由于[@runger1101001](https://github.com/runger1101001)投入了大量的努力,Arduino SimpleFOClibrary现已开始支持Raspberry pi Pico板。虽然这种支持仍处于初始阶段,但大多数PWM相关功能已经实现。 21 | 22 | 板子示意图 | 名称 | 规格 | 链接 | 价格 23 | ---- | --- | --- | --- | --- 24 | [](https://www.adafruit.com/product/4883) | Raspberry Pi Pico RP2040 | Dual ARM Cortex-M0+
- 3.3V logic
- 16 PWMs
- DMA controller
- 4 adc pins
- 133MHz |[Adafruit Store](https://www.adafruit.com/product/4883) | 5€ 25 | 26 |

注意:当前实现的局限性⚠️

27 | Raspberry Pi Pico只得到了早期阶段的支持。PWM功能工作得很好,并已经过测试,大多数传感器都工作得很好 28 |
29 | 30 | 31 | # Arduino IDE支持包 32 | 33 | 为了在 Arduino IDE 中使用 Pico 板,请使用 Arduino IDE 板子管理器安装 Arduino MBED OS RP2040 板支持包。 34 | 35 | 如果使用 windows,你可能必须设置下USB驱动程序,但过程是相当快速和简单的。更多如何做到这一点的信息在此[链接](https://arduino-pico.readthedocs.io/en/latest/install.html#uploading-sketches)。 36 | 37 | 下面是一个简短的视频,告诉你该怎么做: 38 | 39 | 40 | -------------------------------------------------------------------------------- /docs/simplefoc_library/hardware/mcus/samd.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: SAMD21/51 4 | nav_order: 6 5 | description: "Arduino Simple Field Oriented Control (FOC) library ." 6 | permalink: /samd_mcu 7 | parent: 单片机 8 | grand_parent: 支持的硬件 9 | grand_grand_parent: Arduino SimpleFOClibrary 10 | --- 11 | 12 | # 支持SAMD21 驱动板 13 | 14 | MCU | 2路PWM模式 | 4路PWM模式 | 3路PWM模式 | 6路PWM模式 | pwm频率配置 15 | --- | --- |--- |--- |--- |--- 16 | SAMD21 | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ 17 | SAMD51 | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ 18 | 19 | 由于[@runger1101001](https://github.com/runger1101001)的大量投入,Arduino SimpleFOClibrary现已开始支持SAMD21/SAMD51设备。以下是到目前为止已经测试过的驱动板: 20 | 21 | 板子示意图 | 名称 | 规格 | 链接 | 价格 22 | ---- | --- | --- | --- | --- 23 | [](https://store.arduino.cc/arduino-mkr1000-wifi) | Arduino MKR1000 WIFI | SAMD21 Cortex®-M0+
- 3.3V logic
- 12 PWMs
- 10 interrupts
- 7 adc pins
- 48Mhz|[Arduino Store](https://store.arduino.cc/arduino-mkr1000-wifi) | 30€ 24 | [](https://store.arduino.cc/arduino-mkr-wifi-1010) | Arduino MKR1010 WIFI | SAMD21 Cortex®-M0+
- 3.3V logic
- 13 PWMs
- 10 interrupts
- 7 adc pins
- 48Mhz|[Arduino Store](https://store.arduino.cc/arduino-mkr-wifi-1010) | 30€ 25 | [](https://store.arduino.cc/arduino-nano-33-iot) | Arduino MKR1000 WIFI | SAMD21 Cortex®-M0+
- 3.3V logic
- 12 PWMs
- 10 interrupts
- 7 adc pins
- 48Mhz| [Arduino Store](https://store.arduino.cc/arduino-nano-33-iot) | 16€ 26 | [](https://www.sparkfun.com/products/13672) |SparkFun SAMD21 Dev Breakout | SAMD21 Cortex®-M0+
- 3.3V logic
- 10 PWMs
- interrupts all pins
- 14 adc pins
- 48Mhz|[Sparkfun Store](https://www.sparkfun.com/products/13672) | 25€ 27 | [](https://www.adafruit.com/product/2772) | Adafruit Feather M0 Basic | SAMD21 Cortex®-M0
- 3.3V logic
- all pins PWMs
- interrupts all pins
- 12 adc pins
- 48Mhz|[Adafruit Store](https://www.adafruit.com/product/2772) | 20€ 28 | [](https://www.adafruit.com/product/2772) | Adafruit Feather M4 Express | SAMD51 Cortex®-M4
- 3.3V logic
- all pins PWMs
- interrupts all pins
- 16 adc pins
- 120Mhz|[Adafruit Store](https://www.adafruit.com/product/3857) | 20€ 29 | [](https://learn.adafruit.com/adafruit-metro-m4-express-featuring-atsamd51) | Adafruit Feather M4 Express | SAMD51 Cortex®-M4
- 3.3V logic
- 22 pins PWMs
- interrupts all pins
- 8 adc pins
- 120Mhz|[Adafruit Store](https://www.adafruit.com/product/3382) | 25€ 30 | 31 | 32 | ## Arduino IDE 支持包 33 | 为了使用 Arduino IDE 中的 SAMD21/ SAMD51板,请使用 Arduino IDE 板子管理器安装 SAMD21/ SAMD51支持包。 34 | 35 | 对于某些板,除了在板子管理器中安装 Arduino SAMD 包外,你可能还需要安装 Adafruit SAMD包。这里是如何在 Arduino IDE 中启用 Adafruit 包的[一个快速指南](https://learn.adafruit.com/adafruit-metro-m4-express-featuring-atsamd51/setup)。 -------------------------------------------------------------------------------- /docs/simplefoc_library/hardware/mcus/teensy.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: Teensy 4 | nav_order: 5 5 | description: "Arduino Simple Field Oriented Control (FOC) library ." 6 | permalink: /teensy_mcu 7 | parent: 单片机 8 | grand_parent: 支持的硬件 9 | grand_grand_parent: Arduino SimpleFOClibrary 10 | --- 11 | 12 | # 支持 Teensy 13 | 14 | MCU | 2路PWM模式 | 4路PWM模式 | 3路PWM模式 | 6路PWM模式 | pwm频率配置 15 | --- | --- |--- |--- |--- |--- 16 | teensy | ✔️ | ✔️ | ✔️ | ❌ | ✔️ 17 | 18 | Arduino SimpleFOClibrary最近也开始支持Teensy boards。我们用来测试的测试板是 Teensy 4.1 和 Teensy 3.2,但大多数4.x和3.X系列的板子实际上都可以开箱即用,与库一起工作。 19 | 20 | 板子示意图 | 名称 | 规格 | 链接 | 价格 21 | ---- | --- | --- | --- | --- 22 | [](https://www.pjrc.com/store/teensy41.html) | Teensy 4.1 | ARM Cortex-M7
- 3.3V logic
- 35 PWMs
- 18个模拟输入
- 600 MHz | [pjrc.com](https://www.pjrc.com/store/teensy41.html)| 25€ 23 | [](https://www.pjrc.com/store/teensy32.html) | Teensy 3.2 | ARM Cortex-M4
- 3.3V logic
- 12 PWMs
- 21个模拟输入
- 72 MHz | [pjrc.com](https://www.pjrc.com/store/teensy32.html)| 20€ 24 | 25 | 如果你对你的驱动板有问题或者有兴趣扩展支持,请不要犹豫,马上在[社区论坛](https://community.simplefoc.com)发帖! 26 | 27 | ## Arduino IDE支持包 28 | 为了使用 Arduino IDE 中的 Teensy 板子,请按照[Teensyduino addon](https://www.pjrc.com/teensy/td_download.html)中的步骤安装 Teensy 支持包。 -------------------------------------------------------------------------------- /docs/simplefoc_library/hardware/motors/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: 电机 4 | nav_order: 1 5 | description: "Arduino Simple Field Oriented Control (FOC) library ." 6 | permalink: /motors 7 | parent: 支持的硬件 8 | grand_parent: Arduino SimpleFOClibrary 9 | has_children: true 10 | has_toc: false 11 | --- 12 | 13 | # 支持的BLDC无刷直流电机 14 | 15 |
16 | 17 |
18 | Arduino SimpleFOClibrary 支持两种类型的无刷直流电机: 19 | 20 | - [无刷直流电机 ](bldc_motors) 21 | - 3相(3线): 22 | - 云台和高性能无刷直流电机 23 | - [步进电机 ](stepper_motors) 24 | - 2相(4线) 25 | 26 | # 📢在确定使用何种类型电机之前一定要读一下这篇文章! 27 | 28 | 在用SFOC运行任何无刷电机前请首先确保你的运行硬件能够通过足够大的电机所需的电流。 29 | 30 | 最简单的方法是通过检查电机的相电阻`R`。检查你的电机的数据表,查找电阻值,或者用万用表自己测量。然后检查你的电源电压 `V_dc` 的值,测量出来的数值能帮助你推算出最大电流 `I_max` 值。 31 | 32 | ```cpp 33 | I_max = V_dc/R 34 | ``` 35 | 36 | 最后,根据驱动板数据表检查最大电流 `I_max` 值。如果 `I_max` 过高,可以降低电源电压`V_dc` ,以防止电流峰值过高。如果你不能改变你的供电电压,可以在软件中限制电机的电压设置。 37 | 38 |
39 |

注意

40 | 由上式可以计算出最坏情况下的最大电流I_max,而大多数情况下计算出的I_max会大于实际值。实际最大电流取决于电机硬件,如绕组配置和控制算法。 41 |
42 | 43 | 44 | -------------------------------------------------------------------------------- /docs/simplefoc_library/hardware/motors/stepper_motors.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: 步进电机 4 | nav_order: 2 5 | description: "Arduino Simple Field Oriented Control (FOC) library ." 6 | permalink: /stepper_motors 7 | parent: 电机 8 | grand_parent: 支持的硬件 9 | grand_grand_parent: Arduino SimpleFOClibrary 10 | --- 11 | 12 | # 步进电机 13 | 14 | Arduino SimpleFOClibrary支持绝大多数常见的步进电机。 15 | 16 | 步进电机是无刷直流电机的子集,以下是它们的一些特点: 17 | 18 | - 2相4线 19 | - 相对较高的极对数 >50 20 | - 内阻一般 >5Ω 21 | - 电流一般 <5A 22 | 23 | 步进电机是最常见的电机之一。它们随处可见。使用步进电机的主要好处是: 24 | 25 | - 价格实惠——电机和驱动器都很便宜 26 | - 使用简便——通过方向和步进接口就可使用 27 | - 性能良好—持续扭矩大,速度可达1000rpm 28 | 29 | # 步进电机使用FOC控制算法的好处 30 | 31 | 在开环(无位置传感器)控制模式下使用步进电机的主要问题是,我们不得不忽略电机的负载和其动力学问题。因此,在使用步进电机的时候,我们往往会选择强劲的超过我们应用需求的电机,以弥补无感时候的控制缺陷。 32 | 33 | 这在3D打印机中很容易看到,例如,如果你设置打印机的运动速度过高,电机将开始跳步(漏步或不能跟上),然后你的打印就废了。因此,打印机通常有一个时间常数来使得电机能够跟上单片机发送的运动指令,避免电机跟不上导致打印失败。 34 | 35 | 步进电机开环控制的另一个问题是不知道电机此时的运动位置,这使得控制算法无法对环境干扰做出响应。同样以3D打印为例,如果3D打印机的喷嘴卡住了一秒钟,但是由于3D打印机不知道这一状况的发生,因此它将继续向电机发送命令,最后导致打印失败。 36 | 37 | 因此,将FOC算法用于步进电机的一些好处可归纳为: 38 | 39 | - 动力更强 40 | - 再适当的步进驱动器+位置传感器+ 单片机的基础下 41 | - 不会丢步 42 | - 抗干扰能力强 43 | - 更节能 44 | - 自适应调整电机电压,使定位误差最小化— 45 | 46 | # 部分支持的电机 47 | 48 | 以下列举了一些不同价格范围、并且成功测试过可用于SFOC的步进电机。 49 | 50 | 示例 | 描述 | 规格 | 链接 | 价格 51 | ---- | ---- | ---- | ---- | ---- 52 | [](https://www.ebay.com/itm/New-Geeetech-Nema14-35-BYGHW-stepper-motor-for-3d-printer-Reprap-Prusa/272847009701) | NEMA14 BYGHW | - 50PP (200 steps)
- 18N.cm
- 12V/1.2A
- 8.8Ω
- 35x35x35mm| [Ebay](https://www.ebay.com/itm/New-Geeetech-Nema14-35-BYGHW-stepper-motor-for-3d-printer-Reprap-Prusa/272847009701) | 10$ 53 | [](https://www.ebay.com/itm/NEMA-17-Stepper-Motor-12V-0-4A-for-CNC-Reprap-3D-Printer-Extruder-36oz-in-26Ncm/401853894019?hash=item5d905bcd83:g:u04AAOSwRBFdp-IP) | NEMA17 42BYGH34-0400A | - 50PP (200 steps)
- 26N.cm
- 12V/0.4A
- 30Ω
- 42x42x34mm| [Ebay](https://www.ebay.com/itm/NEMA-17-Stepper-Motor-12V-0-4A-for-CNC-Reprap-3D-Printer-Extruder-36oz-in-26Ncm/401853894019?hash=item5d905bcd83:g:u04AAOSwRBFdp-IP) | 12$ 54 | [](https://www.ebay.com/itm/Nema-17-Stepper-Motor-Bipolar-2A-59Ncm-83-6oz-in-48mm-Body-4-lead-3D-Printer-CNC/282285186801?hash=item41b9821ef1:g:7dUAAOSwEzxYSl25) | NEMA 17HS19-2004S1 | - 50PP (200 steps)
- 59N.cm
- 12V/2A
- 4Ω
- 42x42x48mm| [Ebay](https://www.ebay.com/itm/Nema-17-Stepper-Motor-Bipolar-2A-59Ncm-83-6oz-in-48mm-Body-4-lead-3D-Printer-CNC/282285186801?hash=item41b9821ef1:g:7dUAAOSwEzxYSl25) | 17$ 55 | [](https://www.ebay.com/itm/Nema-23-Stepper-Motor-4-Wire-Bipolar-2-Phase-1-8-57BYGH-for-CNC-3D-Printer/372619819064) | NEMA23 57BYGH | - 50PP (200 steps)
- >100N.cm
- 12V/2.5A
- 1.2Ω
- 56x56x56mm| [Ebay](https://www.ebay.com/itm/Nema-23-Stepper-Motor-4-Wire-Bipolar-2-Phase-1-8-57BYGH-for-CNC-3D-Printer/372619819064) | 30$ 56 | -------------------------------------------------------------------------------- /docs/simplefoc_library/hardware/setup_examples/arduino_l6234.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: L6234 转接板 4 | parent: 设置实例 5 | description: "Arduino Simple Field Oriented Control (FOC) library ." 6 | nav_order: 2 7 | permalink: /arduino_l6234 8 | grand_parent: 支持的硬件 9 | grand_grand_parent: Arduino SimpleFOClibrary 10 | --- 11 | 12 | # Arduino UNO + L6234 芯片 13 | [Drotek 的 L6234 评估板](https://store-drotek.com/212-brushless-gimbal-controller-l6234.html)是一款简易的三相无刷直流电机驱动器,非常适合作为入门开启你的FOC之旅。以下连接展示了两个关于这款驱动板和 Arduino UNO 的接线示例: 14 | 15 | - [Arduino UNO + Drotek L6134 + 编码器](#encoder-example) 16 | - [Arduino UNO + Drotek L6234 + 磁传感器 AS5048A](#magnetic-sensor-as5048-example) 17 | 18 | 19 | 20 | # 编码器示例 21 | 22 |

23 | ### 编码器 24 | - 编码器`A`和`B` 连接到Arduino的外部中断引脚 `2` 和 `3`。 25 | 26 | - 如果你的编码器有`index` (基准)信号,可以将它连接到任何可用的引脚,上图连接的是引脚 `4`。 27 | 28 | - 对于 Arduino UNO 这种没有3个硬件中断的板子,最好将I信号接在A0-A5口,这会使得性能更强。 29 | - 反之,如若你使用其他有3个硬件中断引脚或以上的开发板,将I引脚连接到至其中一个中断引脚即可。 30 | 31 | 32 | 33 | ### L6234 评估板 34 | - 连接到arduino引脚`9`、`10`和 `11`(你也可以使用 `5` 和 `6`)。 35 | - 此外,你可以连接`enable` 引脚到arduino的任何支持数字量的引脚,图片上采用的是引脚`8`。当然,你也可以将驱动器使能端直接连接到5v。 36 | - 电源记住要共地 37 | 38 | ### 电机 39 | - 电机 `a`相、 `b`相 和`c`相直接连接到6234的输出口。 40 | 41 | ### 连接示例 42 |

43 | ## 以磁传感器AS5048为例 44 | 45 |

46 | 47 |

48 | 49 | ### 磁传感器 50 | - 磁传感器(AS5048) SPI接口信号`SCK`,`MISO`和 `MOSI`连接到Arduino的 `SPI`引脚(Arduino UNO`13`,`12`和`11`)。 51 | - 如果程序需要用到多个传感器,所有传感器之间可并联。 52 | - 在使用多个传感器时,每个传感器都要将其片选引脚单独于Arduino板子上的IO口连接。 53 | 54 | ### L6234 评估板 55 | - 连接到arduino引脚 `3`、`5` 和 `6` (你也可以使用`9` 和 `10`,但`11` 是由SPI接口采取)。 56 | - 此外,你可以连接`enable` 引脚到arduino的任何支持数字量的引脚,图片上采用的是引脚2。当然,你也可以将驱动器使能端直接连接到5v。 57 | - 电源记住要共地 58 | 59 | ### 电机 60 | - 电机 `a`相、 `b`相 和`c`相直接连接到6234的输出口。 61 | 62 |

校准

63 | 电机a相、b相、c相和编码器通道AB 以及磁传感器计数方向必须正确,算法才能正常工作。但别太担心。最开始按照你的想法连接即可,如果电机运行不正常调转电机的两根相线就可以解决问题 64 |
65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /docs/simplefoc_library/hardware/setup_examples/bluepill_conneciton.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: STM32 Bluepill 4 | parent: 设置实例 5 | description: "Arduino Simple Field Oriented Control (FOC) library ." 6 | nav_order: 5 7 | permalink: /bluepill_connection 8 | grand_parent: 支持的硬件 9 | grand_grand_parent: Arduino SimpleFOClibrary 10 | 11 | --- 12 | 13 | 14 | # Stm32 Bluepill 上使用 Arduino SimpleFOCShield 15 | 16 | SimpleFOCShield 是一个BLDC驱动,不仅可以与带有 Arduino UNO 类型的开发板使用,也可以作为一个独立的驱动板与其他单片机连接。 17 | 18 | 以下是使用Stm32 Bluepill 和 SimpleFOCShield连接的示例: 19 | 20 |

21 | 更多信息,请点击 [Arduino Simple FOC Shield](arduino_simplefoc_shield_showcase). 22 | 23 | 24 |

25 |

Bluepill 引脚

确保在分配BLDC驱动器引脚之前确认引脚必须支持PWM。
26 | ## 编码器 27 | 28 | - 通道`A`和 `B` 连接到 `PB9`和 `PB8`。 29 | - 如果你的编码器有`index` (基准)信号,你也可以将它连接到电路板上,例如在`PB7`上。 30 |

注意

任何支持数字量的引脚都可以是STM32板上的外部中断引脚。
31 | ## 连接 SimpleFOCShield 32 | 33 | - 将`PWMa`,`PWMb`和 `PWMc`信号连接到Bluepill的 `PA10`, `PA9` 和 `PA8`。 34 | - 连接 `enable`引脚到任何支持数字量的引脚,如 `PA11`。 35 | - 共地。 36 | - 连接电源线。 37 | 38 | ## 电机 39 | - 电机`a`相、`b` 相和 `c`相 直接连接接线柱 `TB_M1`。 40 | 41 | 42 | ## 连接示例 43 |

44 | -------------------------------------------------------------------------------- /docs/simplefoc_library/hardware/setup_examples/drv8302.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: DRV8302 4 | parent: 设置实例 5 | description: "Arduino Simple Field Oriented Control (FOC) library ." 6 | nav_order: 6 7 | permalink: /drv8302_connection 8 | grand_parent: 支持的硬件 9 | grand_grand_parent: Arduino SimpleFOClibrary 10 | --- 11 | 12 | 13 | # Arduino UNO 连接DRV8302评估板 14 | 15 | DRV8302 是一款高性能的无刷电机驱动板,能够支持持续放电电流15A,瞬间峰值电流27A。此外,它具有温度和过流保护,反电势和三相电流检测。它还可以使用3 相 PWM 信号驱动,这使得它于 SimpleFOC 库兼容。 16 | 17 | 下面是它和Arduino Uno的连接示范 18 | 19 |

20 | ## DRV8302 21 | - 像其他基于本库的无刷电机驱动板一样,此驱动板能接收3路PWM信号: 分别是 pwm `a`、`b` 和 `c`。这三路信号可以在 `INHA`、 `INHB` 和 `INHC` 三个引脚引入 22 | - 此外,连接使能引脚至引脚 `EN-GATE` 23 | - 配置无刷电机驱动板我们需要到三个引脚(图中左边紫部分色) 24 | - `M_PWM` :高电平为3PWM模式,低电平为6PWM模式 25 | - `M_OC` : 设置低电平使能过流保护 26 | - `OC_ADJ` :可以通过模拟输入信号来调节过流保护的限幅值,如果你不需要此功能,可以将这个引脚拉成高电平 27 | - 可以从以下两个引脚读取错误信息 28 | - `nFAULT` :驱动板故障状态时为高电平 29 | - `nOCTW` :达到过流限制时为高电平 30 | 31 | ## 编码器 32 | - 通道 `A` 和 `B` 连接到外部中断引脚 `2` 和 `3` 33 | - 如果你的编码器有 `index` 信号,可以连接到任何可用的支持数字信号传输的引脚。这儿我们将其连接到引脚 `4` 34 | 35 | ## 电机 36 | - 电机 `a`相、 `b` 相和 `c`相直接连接到驱动板端子 `OUTA`、 `OUTB` 和 `OUTC`。 37 | 38 | 39 | ## 连接示例 40 |

--> 41 | -------------------------------------------------------------------------------- /docs/simplefoc_library/hardware/setup_examples/foc_shield.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: SimpleFOCShield 4 | parent: 设置实例 5 | description: "Arduino Simple Field Oriented Control (FOC) library ." 6 | nav_order: 1 7 | permalink: /arduino_simplefoc_shield 8 | grand_parent: 支持的硬件 9 | grand_grand_parent: Arduino SimpleFOClibrary 10 | --- 11 | 12 | # ArduinoSimpleFOCShield  13 | 14 | SimpleFOC Shield是一个基于Arduino UNO开发的板子,兼容与Arduino UNO引脚排列一致的开发板直接插入使用。 15 | 16 |

17 | ## 接线柱描述 18 | - 电机和编码器接线柱 19 | - 电机相位为`a`、`b` 和 `c` 20 | - 电源线(12V ~ 24V) 21 | - 编码器接线柱 22 | - 集成上拉电阻 23 | 24 | 更多信息请点击此链接:[Arduino Simple FOC Shield](arduino_simplefoc_shield_showcase)。 25 | 26 | ## 编码器 27 | - `A` 和 `B`连接到编码器接线柱`P_ENC`,`A` 和 `B`位置 。 28 | - 如果你的编码器有`index`(基准) 信号,你也可以将它连接到编码器接线柱 `I`位置。 29 | 30 | ## 电机 31 | - 电机`a`相, `b`相和 `c`相直接连接电机接线柱 `TB_M1` 32 | 33 | 34 | ## 连接示例 35 |

36 | -------------------------------------------------------------------------------- /docs/simplefoc_library/hardware/setup_examples/hmbgc.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: HMBGC V2.2 4 | parent: 设置实例 5 | description: "Arduino Simple Field Oriented Control (FOC) library ." 6 | nav_order: 3 7 | permalink: /hmbgc 8 | grand_parent: 支持的硬件 9 | grand_grand_parent: Arduino SimpleFOClibrary 10 | --- 11 | 12 | 13 | # HMBGC V2.2 14 | 使用HMBGC控制器进行FOC控制,需要将电机连接到其中一个电机接线柱,并将编码器连接到开发板的模拟信号引脚。下图为其接线实例: 15 | 16 |

17 | ## 编码器 18 |

引脚限制

19 | HMBGC不能访问Arduino的外部中断引脚23,我们唯一可以访问的引脚是模拟引脚A0-A7. 20 | 因此我们需要使用软件中断库来读取编码器,请查看编码器代码实现 获得更多信息。
21 | 22 | 23 | 请参考HMBGC代码例程(`HMBGC_example.ino`')来测试所有功能。 24 | 25 | - 编码器A` 和 `B`连接到引脚`A0` 和 `A1`。 26 | - 如果你的编码器有`index`(索引)信号,可以将它连接到任何可用的引脚,上图连接的是引脚 `A2`。 27 | 28 | ## 电机 29 | - 电机`a`相,`b` 相和`c`相直接连接到驱动器输出 30 | 31 | - 电机接线`M1`使用Arduino引脚`9`、`10`、`11` ,接线 `M2`使用 `3`、`5`、`6` 32 | 33 | 34 | 35 |
HMBGC板不支持磁传感器,因为它没有必需的SPI基础设施
36 | ## 连接实例 37 | 38 |

39 |

-------------------------------------------------------------------------------- /docs/simplefoc_library/hardware/setup_examples/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: 设置实例 4 | parent: 支持的硬件 5 | description: "Arduino Simple Field Oriented Control (FOC) library ." 6 | nav_order: 5 7 | permalink: /setup_examples 8 | has_children: true 9 | has_toc: false 10 | grand_parent: Arduino SimpleFOClibrary 11 | --- 12 | 13 | # SimpleFOClibrary 设置示例 14 | 20 | 26 | 32 | 38 | 44 | -------------------------------------------------------------------------------- /docs/simplefoc_library/hardware/setup_examples/nucleo_conneciton.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: STM32 Nucelo-64 4 | parent: 设置实例 5 | description: "Arduino Simple Field Oriented Control (FOC) library ." 6 | nav_order: 4 7 | permalink: /nucleo_connection 8 | grand_parent: 支持的硬件 9 | grand_grand_parent: Arduino SimpleFOClibrary 10 | --- 11 | 12 | 13 | # Stm32 Nucleo-64 上使用 Arduino SimpleFOCShield 14 | SimpleFOC Shield是一个基于Arduino UNO开发的板子,兼容与Arduino UNO引脚排列一致的开发板直接插入使用,其中之一就是STM32 Nucleo-64 15 | 16 | 这里是Arduino SimpleFOCShield连接范例: 17 | 18 |

19 | ## 连接器类型 20 | - 电机和编码器接线柱 21 | - 电机相位为`a`、`b` 和 `c` 22 | - 电源线(12V ~ 24V) 23 | - 编码器接线柱 24 | - 集成上拉电阻 25 | 26 | 更多信息请点击此链接:[Arduino Simple FOC Shield](arduino_simplefoc_shield_showcase)。 27 | 28 | ## 编码器 29 | 30 | - `A` 和 `B`连接到编码器接线柱`P_ENC`,`A` 和 `B`位置 。 31 | - 如果你的编码器有`index`(基准) 信号,你也可以将它连接到编码器接线柱 `I`位置。 32 | 33 | ## 电机 34 | 35 | - 电机`a`相, `b`相和 `c`相直接连接电机接线柱 `TB_M1` 36 | 37 | 38 | ## 连接示例 39 | 40 |

41 | -------------------------------------------------------------------------------- /docs/simplefoc_library/installation/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: 安装 4 | nav_order: 1 5 | parent: Arduino SimpleFOClibrary 6 | description: "Arduino Simple Field Oriented Control (FOC) library ." 7 | permalink: /installation 8 | has_children: True 9 | has_toc: false 10 | --- 11 | 12 | 13 | # 安装SimpleFOClibrary 14 | 15 | 16 | 根据编写的代码和用途,可以选择以下两种不同方式安装Arduino库。 17 | 18 | - [完整Arduino库安装](library_download) 19 | - 即插即用 20 | - 例程丰富 21 | - 易于通过Arduino IDE访问 22 | - [最小项目工程](minimal_download) 23 | - 具有Arduino集成完整库的核心程序 24 | - 更加便于进行实验,能够直接与库的源代码进行交互 25 | 26 | 33 | 34 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /docs/simplefoc_library/installation/library_download.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: 库安装 4 | parent: 安装 5 | nav_order: 1 6 | description: "Arduino Simple Field Oriented Control (FOC) library ." 7 | permalink: /library_download 8 | grand_parent: Arduino SimpleFOClibrary 9 | --- 10 | 11 | # 安装完整的 SimpleFOClibrary 12 | 13 | ## 通过Arduino Library Manager安装 14 | 最简单的方式是直接通过 `Arduino IDE`中的 *Arduino Library Manager* 获取库。 15 |

16 | - 打开Arduino IDE, 点击 `Tools > Manage Libraries...`,启动 *Arduino Library Manager*。 17 | - 搜索 *"Simple FOC"* 库并安装 [最新版本 .](https://github.com/simplefoc/Arduino-FOC/releases) 18 | - 重新打开Arduino IDE,就能在 `File > Examples > Simple FOC`中看到库例程。 19 | 20 | ## 通过Github安装 21 | 如果你更倾向于从[github仓库](https://github.com/simplefoc/Arduino-FOC)直接下载库,请看以下指引。 22 | 23 | ### 压缩包下载 24 | - 进入 [ main](https://github.com/simplefoc/Arduino-FOC) 。 25 | - 首先点击 `Clone or Download > Download ZIP`。 26 | - 解压下载的压缩包到`Arduino Libraries` 文件夹( 文件夹路径 Windows: `Documents > Arduino > libraries`)。 27 | - 重新打开Arduino IDE,就能在 `File > Examples > Simple FOC`中看到库例程。 28 | 29 | ### 电脑终端克隆 30 | - 打开电脑终端并运行下列代码: 31 | ```sh 32 | cd #arduino 库文件夹 33 | git clone https://github.com/simplefoc/Arduino-FOC.git 34 | ``` 35 | - 重新打开Arduino IDE,就能在 `File > Examples > Simple FOC`中看到库例程。 36 | -------------------------------------------------------------------------------- /docs/simplefoc_library/installation/minimal_download.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: 最小项目工程 4 | parent: 安装 5 | nav_order: 2 6 | description: "Arduino Simple Field Oriented Control (FOC) library ." 7 | permalink: /minimal_download 8 | grand_parent: Arduino SimpleFOClibrary 9 | --- 10 | 11 | # 安装 SimpleFOClibrary 最小项目工程 12 | 13 | 对于想要测试和修改源代码的朋友,建议使用 [ 最小项目工程](https://github.com/simplefoc/Arduino-FOC/tree/minimal) 版本 14 |

注意

这个版本的代码是完全独立的,像其他Arduino程序一样,无需要调用任何库来运行它。
15 | ## 安装 16 | 你可以直接通过github接口访问这个版本的源代码。 17 | ### 压缩包下载 18 | - 进入 [ minimal](https://github.com/simplefoc/Arduino-FOC/tree/minimal)。 19 | - 通过点击 `Clone or Download > Download ZIP`下载源代码。 20 | ### 电脑终端克隆 21 | - 打开电脑终端并运行下列代码: 22 | ```sh 23 | cd *to you desired directory* 24 | git clone -b minimal https://github.com/simplefoc/Arduino-FOC.git 25 | ``` 26 | 27 | ## 最小项目工程创建指南 28 | 下载好源代码后,请根据minimal branch中的readme文件选择你项目需要的文件或者使用其中一个例程项目文件。 29 | 30 |

31 | -------------------------------------------------------------------------------- /docs/simplefoc_library/work_roadmap.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: 技术路线 4 | parent: Arduino SimpleFOClibrary 5 | nav_order: 8 6 | permalink: /roadmap 7 | 8 | --- 9 | 10 | # 技术路线 11 | 12 | 有关库版本功能的更多信息,请访问 [github releases ](https://github.com/simplefoc/Arduino-FOC/releases). 13 | 14 | 这个页面并没有时常维护,有时可能会过时。 15 | 16 | ## 运动控制与FOC算法 17 | - [ ] 电机控制:低压侧电流感应-No.1 18 | - [ ] 错误修正:浮点角度溢出- No.2 19 | - [ ] 电机控制:带DMA的内联电流感应 - No.3 20 | - [ ] 电机控制:高压侧电流感应 21 | - [x] 电机控制:内联电流感应 22 | - [x] 电机控制:支持步进电机 23 | - [x] 电机控制:支持霍尔传感器换向 24 | - [x] 电机控制:支持完全开环操作(无传感器) 25 | - [x] 添加对加速斜坡的支持 26 | - [x] 速度低通滤波器 27 | - [x] 计时器中断执行,而不是在`loop()`中”:❌ 没有真正的性能改进 28 | - [x] 正弦波查找表的实现 29 | - [X] 实现空间矢量调制的方法:SVM 30 | - [x] 实现空间矢量调制的方法:PWM-SVM 31 | 32 | ## MCU 支持 33 | - [ ] Raspberry pi Pico - [PR #78](https://github.com/simplefoc/Arduino-FOC/pull/78) 34 | - [x] SAM - Arduino DUE 35 | - [x] SAMD21/51 36 | - [x] Teensy support 37 | - [x] ESP32 support 38 | - [x] STM32 Nucleo support 39 | - [x] STM32 BLuepill support 40 | - [x] 特定于硬件的代码分离 : 更容易在设备之间进行转移 `hardware_utils.cpp/.h` 41 | 42 | ## 驱动器支持 43 | - [ ] 支持: 在6PWM模式下禁用PAHSE 44 | - [x] 支持: 对高低侧MOSFET的控制 45 | - [x] 支持: DRV8302 borads 46 | 47 | ## 传感器 support 48 | 49 | - [ ] IMU 作为位置传感器 50 | - [ ] 支持Back-EMF 51 | - [ ] 支持Senosrless-FOC 52 | - [ ] 支持磁性编码器SSI 53 | - [x] 支持磁性编码器PWM 54 | - [x] 支持磁编码器模拟 55 | - [x] 支持磁性编码器I2C 56 | - [x] 支持磁性编码器ABI 57 | - [x] 支持磁性编码器SPI 58 | - [x] 霍尔传感器 59 | - [x] 合适的编码器索引 60 | 61 | ## 用户交互 62 | 63 | - [ ] Commander为内存较低的设备制作最低版本 64 | - [ ] 瞬时位置、速度、扭矩设定的目标设定界面(例如`q 10 20 1`) 65 | - [x] 执行电机指令 66 | - [x] 支持监控 67 | 68 | ## 可用性 69 | 70 | - [ ] 更多文档和示例 71 | - [x] SimpleFOClibrary 入门页面 72 | - [x] SimpleFOCShield 入门页面 73 | - [x] 在Arduino库管理器中访问库 74 | - [x] 制作arduino代码的最低版本-全部包含在一个arduino文件中 75 | - [x] 文档与 自述文件 README 的分离 76 | - [x] Arduino SimpleFOCShield 的介绍 77 | 78 | ## 视频 79 | 80 | - [ ] 视频:发布使用库和示例的视频教程 81 | - [ ] 视频:编码设置和程序视频 82 | - [x] 视频:HMBGC上运行的两个电机示例 83 | - [x] 视频:简单演示的视频 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /extras/ArduinoFOCShieldV12.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/ArduinoFOCShieldV12.pdf -------------------------------------------------------------------------------- /extras/Images/0.5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/0.5.jpg -------------------------------------------------------------------------------- /extras/Images/0.6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/0.6.jpg -------------------------------------------------------------------------------- /extras/Images/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/1.jpg -------------------------------------------------------------------------------- /extras/Images/3pwm_driver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/3pwm_driver.png -------------------------------------------------------------------------------- /extras/Images/6pwm_driver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/6pwm_driver.png -------------------------------------------------------------------------------- /extras/Images/AFSV11_bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/AFSV11_bottom.png -------------------------------------------------------------------------------- /extras/Images/B-G431B-ESC1_SPL.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/B-G431B-ESC1_SPL.jpg -------------------------------------------------------------------------------- /extras/Images/BTS7960B.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/BTS7960B.jpg -------------------------------------------------------------------------------- /extras/Images/LPF_alpha.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/LPF_alpha.png -------------------------------------------------------------------------------- /extras/Images/PID_der.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/PID_der.png -------------------------------------------------------------------------------- /extras/Images/PID_eq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/PID_eq.png -------------------------------------------------------------------------------- /extras/Images/PID_int.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/PID_int.png -------------------------------------------------------------------------------- /extras/Images/PID_pro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/PID_pro.png -------------------------------------------------------------------------------- /extras/Images/SHIELD_IFX007T.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/SHIELD_IFX007T.jpg -------------------------------------------------------------------------------- /extras/Images/align_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/align_diagram.png -------------------------------------------------------------------------------- /extras/Images/alm.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/alm.gif -------------------------------------------------------------------------------- /extras/Images/alpha.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/alpha.png -------------------------------------------------------------------------------- /extras/Images/angle_loop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/angle_loop.png -------------------------------------------------------------------------------- /extras/Images/angle_loop_i.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/angle_loop_i.png -------------------------------------------------------------------------------- /extras/Images/angle_loop_v.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/angle_loop_v.png -------------------------------------------------------------------------------- /extras/Images/arduino_connection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/arduino_connection.png -------------------------------------------------------------------------------- /extras/Images/arduino_connection_magnetic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/arduino_connection_magnetic.png -------------------------------------------------------------------------------- /extras/Images/arduino_uno.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/arduino_uno.jpg -------------------------------------------------------------------------------- /extras/Images/as5600.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/as5600.jpg -------------------------------------------------------------------------------- /extras/Images/back_shield.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/back_shield.jpg -------------------------------------------------------------------------------- /extras/Images/battery.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/battery.jpg -------------------------------------------------------------------------------- /extras/Images/bgc31.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/bgc31.jpg -------------------------------------------------------------------------------- /extras/Images/bgc_30.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/bgc_30.jpg -------------------------------------------------------------------------------- /extras/Images/big.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/big.jpg -------------------------------------------------------------------------------- /extras/Images/bigger.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/bigger.jpg -------------------------------------------------------------------------------- /extras/Images/bluepill.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/bluepill.jpg -------------------------------------------------------------------------------- /extras/Images/bluepill_foc_shield.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/bluepill_foc_shield.jpg -------------------------------------------------------------------------------- /extras/Images/bluepill_foc_shield_thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/bluepill_foc_shield_thumb.jpg -------------------------------------------------------------------------------- /extras/Images/bluepill_foc_shield_v13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/bluepill_foc_shield_v13.png -------------------------------------------------------------------------------- /extras/Images/bluepill_pinout.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/bluepill_pinout.jpg -------------------------------------------------------------------------------- /extras/Images/c2216.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/c2216.png -------------------------------------------------------------------------------- /extras/Images/closed_loop.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/closed_loop.gif -------------------------------------------------------------------------------- /extras/Images/cmd1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/cmd1.png -------------------------------------------------------------------------------- /extras/Images/cmd2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/cmd2.png -------------------------------------------------------------------------------- /extras/Images/cmd3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/cmd3.png -------------------------------------------------------------------------------- /extras/Images/cmd4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/cmd4.png -------------------------------------------------------------------------------- /extras/Images/cmd5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/cmd5.png -------------------------------------------------------------------------------- /extras/Images/cmd6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/cmd6.png -------------------------------------------------------------------------------- /extras/Images/cmd7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/cmd7.png -------------------------------------------------------------------------------- /extras/Images/cmd_motor.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/cmd_motor.gif -------------------------------------------------------------------------------- /extras/Images/cmd_motor_get.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/cmd_motor_get.gif -------------------------------------------------------------------------------- /extras/Images/community.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/community.png -------------------------------------------------------------------------------- /extras/Images/comparison_cs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/comparison_cs.png -------------------------------------------------------------------------------- /extras/Images/connection.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/connection.gif -------------------------------------------------------------------------------- /extras/Images/connection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/connection.png -------------------------------------------------------------------------------- /extras/Images/contPID.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/contPID.png -------------------------------------------------------------------------------- /extras/Images/cont_LPF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/cont_LPF.png -------------------------------------------------------------------------------- /extras/Images/d1_r32.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/d1_r32.jpg -------------------------------------------------------------------------------- /extras/Images/dagor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/dagor.png -------------------------------------------------------------------------------- /extras/Images/dc_current_mode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/dc_current_mode.png -------------------------------------------------------------------------------- /extras/Images/dc_motor.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/dc_motor.gif -------------------------------------------------------------------------------- /extras/Images/dead_zone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/dead_zone.png -------------------------------------------------------------------------------- /extras/Images/dis_LPF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/dis_LPF.png -------------------------------------------------------------------------------- /extras/Images/dis_PI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/dis_PI.png -------------------------------------------------------------------------------- /extras/Images/drv8301.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/drv8301.png -------------------------------------------------------------------------------- /extras/Images/drv8302.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/drv8302.png -------------------------------------------------------------------------------- /extras/Images/drv8302_arduino_connection.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/drv8302_arduino_connection.jpg -------------------------------------------------------------------------------- /extras/Images/drv8302_connection.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/drv8302_connection.jpg -------------------------------------------------------------------------------- /extras/Images/drv8302_connection_thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/drv8302_connection_thumb.jpg -------------------------------------------------------------------------------- /extras/Images/drv8302_example.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/drv8302_example.jpg -------------------------------------------------------------------------------- /extras/Images/due.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/due.jpg -------------------------------------------------------------------------------- /extras/Images/ebay.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/ebay.jpg -------------------------------------------------------------------------------- /extras/Images/ebay2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/ebay2.jpg -------------------------------------------------------------------------------- /extras/Images/enc.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/enc.jpg -------------------------------------------------------------------------------- /extras/Images/enc0.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/enc0.jpg -------------------------------------------------------------------------------- /extras/Images/enc1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/enc1.png -------------------------------------------------------------------------------- /extras/Images/esp32.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/esp32.jpg -------------------------------------------------------------------------------- /extras/Images/feather_basic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/feather_basic.jpg -------------------------------------------------------------------------------- /extras/Images/feather_express.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/feather_express.jpg -------------------------------------------------------------------------------- /extras/Images/foc_current_mode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/foc_current_mode.png -------------------------------------------------------------------------------- /extras/Images/foc_modulation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/foc_modulation.png -------------------------------------------------------------------------------- /extras/Images/foc_modulation_svm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/foc_modulation_svm.png -------------------------------------------------------------------------------- /extras/Images/foc_pendulum.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/foc_pendulum.jpg -------------------------------------------------------------------------------- /extras/Images/foc_shield_v13.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/foc_shield_v13.jpg -------------------------------------------------------------------------------- /extras/Images/foc_shield_v13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/foc_shield_v13.png -------------------------------------------------------------------------------- /extras/Images/foc_shield_v13_analog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/foc_shield_v13_analog.png -------------------------------------------------------------------------------- /extras/Images/foc_shield_v13_enc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/foc_shield_v13_enc.png -------------------------------------------------------------------------------- /extras/Images/foc_shield_v13_hall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/foc_shield_v13_hall.png -------------------------------------------------------------------------------- /extras/Images/foc_shield_v13_magI2C.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/foc_shield_v13_magI2C.png -------------------------------------------------------------------------------- /extras/Images/foc_shield_v13_magSPI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/foc_shield_v13_magSPI.png -------------------------------------------------------------------------------- /extras/Images/foc_shield_v13_nucleo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/foc_shield_v13_nucleo.png -------------------------------------------------------------------------------- /extras/Images/foc_shield_video.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/foc_shield_video.jpg -------------------------------------------------------------------------------- /extras/Images/gauge_connection.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/gauge_connection.jpg -------------------------------------------------------------------------------- /extras/Images/hall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/hall.png -------------------------------------------------------------------------------- /extras/Images/hall1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/hall1.png -------------------------------------------------------------------------------- /extras/Images/hall_schema.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/hall_schema.jpg -------------------------------------------------------------------------------- /extras/Images/hallw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/hallw.png -------------------------------------------------------------------------------- /extras/Images/haptics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/haptics.png -------------------------------------------------------------------------------- /extras/Images/high-side.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/high-side.png -------------------------------------------------------------------------------- /extras/Images/high_side_sync.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/high_side_sync.png -------------------------------------------------------------------------------- /extras/Images/hmbgc_connection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/hmbgc_connection.png -------------------------------------------------------------------------------- /extras/Images/hmbgc_v22.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/hmbgc_v22.jpg -------------------------------------------------------------------------------- /extras/Images/hmbgc_v22_velocity_control.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/hmbgc_v22_velocity_control.jpg -------------------------------------------------------------------------------- /extras/Images/hor_cad_shield.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/hor_cad_shield.jpg -------------------------------------------------------------------------------- /extras/Images/in-line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/in-line.png -------------------------------------------------------------------------------- /extras/Images/interactive_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/interactive_example.png -------------------------------------------------------------------------------- /extras/Images/inverse_clarke.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/inverse_clarke.png -------------------------------------------------------------------------------- /extras/Images/inverse_park.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/inverse_park.png -------------------------------------------------------------------------------- /extras/Images/jk42.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/jk42.png -------------------------------------------------------------------------------- /extras/Images/l298n.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/l298n.jpg -------------------------------------------------------------------------------- /extras/Images/l6234.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/l6234.jpg -------------------------------------------------------------------------------- /extras/Images/library_.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/library_.png -------------------------------------------------------------------------------- /extras/Images/library_min_.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/library_min_.png -------------------------------------------------------------------------------- /extras/Images/limits.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/limits.png -------------------------------------------------------------------------------- /extras/Images/low-side.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/low-side.png -------------------------------------------------------------------------------- /extras/Images/low_side_sync.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/low_side_sync.png -------------------------------------------------------------------------------- /extras/Images/mad5008.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/mad5008.png -------------------------------------------------------------------------------- /extras/Images/mag.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/mag.jpg -------------------------------------------------------------------------------- /extras/Images/mag0.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/mag0.jpg -------------------------------------------------------------------------------- /extras/Images/mag2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/mag2.jpg -------------------------------------------------------------------------------- /extras/Images/mega.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/mega.png -------------------------------------------------------------------------------- /extras/Images/minimal.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/minimal.gif -------------------------------------------------------------------------------- /extras/Images/mkr1000.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/mkr1000.jpg -------------------------------------------------------------------------------- /extras/Images/mkr1010.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/mkr1010.jpg -------------------------------------------------------------------------------- /extras/Images/ml4114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/ml4114.png -------------------------------------------------------------------------------- /extras/Images/mot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/mot.jpg -------------------------------------------------------------------------------- /extras/Images/mot2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/mot2.jpg -------------------------------------------------------------------------------- /extras/Images/mot3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/mot3.jpg -------------------------------------------------------------------------------- /extras/Images/motor_cmd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/motor_cmd.png -------------------------------------------------------------------------------- /extras/Images/ms1508.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/ms1508.jpg -------------------------------------------------------------------------------- /extras/Images/n2830.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/n2830.png -------------------------------------------------------------------------------- /extras/Images/nano.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/nano.png -------------------------------------------------------------------------------- /extras/Images/nano33.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/nano33.png -------------------------------------------------------------------------------- /extras/Images/nema14.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/nema14.jpg -------------------------------------------------------------------------------- /extras/Images/nema17_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/nema17_1.jpg -------------------------------------------------------------------------------- /extras/Images/nema17_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/nema17_2.jpg -------------------------------------------------------------------------------- /extras/Images/nema23.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/nema23.jpg -------------------------------------------------------------------------------- /extras/Images/nucleo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/nucleo.jpg -------------------------------------------------------------------------------- /extras/Images/nucleo_foc_shield.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/nucleo_foc_shield.jpg -------------------------------------------------------------------------------- /extras/Images/nucleo_foc_shield_connection.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/nucleo_foc_shield_connection.jpg -------------------------------------------------------------------------------- /extras/Images/open_loop.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/open_loop.gif -------------------------------------------------------------------------------- /extras/Images/open_loop_angle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/open_loop_angle.png -------------------------------------------------------------------------------- /extras/Images/open_loop_velocity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/open_loop_velocity.png -------------------------------------------------------------------------------- /extras/Images/pico.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/pico.jpg -------------------------------------------------------------------------------- /extras/Images/pinout.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/pinout.jpg -------------------------------------------------------------------------------- /extras/Images/plotter.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/plotter.jpg -------------------------------------------------------------------------------- /extras/Images/pololu.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/pololu.jpg -------------------------------------------------------------------------------- /extras/Images/position.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/position.png -------------------------------------------------------------------------------- /extras/Images/position_control_example.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/position_control_example.jpg -------------------------------------------------------------------------------- /extras/Images/powershield.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/powershield.jpg -------------------------------------------------------------------------------- /extras/Images/pwm_sensor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/pwm_sensor.png -------------------------------------------------------------------------------- /extras/Images/sd_m13.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/sd_m13.jpg -------------------------------------------------------------------------------- /extras/Images/shield_bo_v13.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/shield_bo_v13.jpg -------------------------------------------------------------------------------- /extras/Images/shield_bot_v131.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/shield_bot_v131.png -------------------------------------------------------------------------------- /extras/Images/shield_bot_v131_config_double.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/shield_bot_v131_config_double.png -------------------------------------------------------------------------------- /extras/Images/shield_bot_v131_config_double_ard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/shield_bot_v131_config_double_ard.png -------------------------------------------------------------------------------- /extras/Images/shield_bot_v131_config_double_nucleo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/shield_bot_v131_config_double_nucleo.png -------------------------------------------------------------------------------- /extras/Images/shield_bot_v131_config_single.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/shield_bot_v131_config_single.png -------------------------------------------------------------------------------- /extras/Images/shield_bot_v131_pinout.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/shield_bot_v131_pinout.gif -------------------------------------------------------------------------------- /extras/Images/shield_bot_v131_pullup_enable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/shield_bot_v131_pullup_enable.png -------------------------------------------------------------------------------- /extras/Images/shield_bot_v131_side.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/shield_bot_v131_side.png -------------------------------------------------------------------------------- /extras/Images/shield_bot_v132_i2c_pullup_enable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/shield_bot_v132_i2c_pullup_enable.png -------------------------------------------------------------------------------- /extras/Images/shield_bot_v201_pinout.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/shield_bot_v201_pinout.gif -------------------------------------------------------------------------------- /extras/Images/shield_monster.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/shield_monster.jpg -------------------------------------------------------------------------------- /extras/Images/shield_to_v13.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/shield_to_v13.jpg -------------------------------------------------------------------------------- /extras/Images/shield_top_v13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/shield_top_v13.png -------------------------------------------------------------------------------- /extras/Images/shield_top_v131.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/shield_top_v131.png -------------------------------------------------------------------------------- /extras/Images/shield_v13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/shield_v13.png -------------------------------------------------------------------------------- /extras/Images/shiled_stepper.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/shiled_stepper.jpg -------------------------------------------------------------------------------- /extras/Images/shiled_stepper1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/shiled_stepper1.jpg -------------------------------------------------------------------------------- /extras/Images/shiled_stepper3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/shiled_stepper3.jpg -------------------------------------------------------------------------------- /extras/Images/side2_shield.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/side2_shield.jpg -------------------------------------------------------------------------------- /extras/Images/side_shield.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/side_shield.jpg -------------------------------------------------------------------------------- /extras/Images/simple_foc_shield_v13_small.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/simple_foc_shield_v13_small.gif -------------------------------------------------------------------------------- /extras/Images/sine_foc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/sine_foc.png -------------------------------------------------------------------------------- /extras/Images/source_docs.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/source_docs.jpg -------------------------------------------------------------------------------- /extras/Images/steer_by_wire_connection.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/steer_by_wire_connection.jpg -------------------------------------------------------------------------------- /extras/Images/stepper4pwm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/stepper4pwm.png -------------------------------------------------------------------------------- /extras/Images/stepper_2pwm_one_dir.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/stepper_2pwm_one_dir.png -------------------------------------------------------------------------------- /extras/Images/stepper_2pwm_two_dir.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/stepper_2pwm_two_dir.png -------------------------------------------------------------------------------- /extras/Images/stepper_connection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/stepper_connection.png -------------------------------------------------------------------------------- /extras/Images/stepper_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/stepper_example.png -------------------------------------------------------------------------------- /extras/Images/stepper_limits.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/stepper_limits.png -------------------------------------------------------------------------------- /extras/Images/strom.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/strom.jpg -------------------------------------------------------------------------------- /extras/Images/svm0.5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/svm0.5.jpg -------------------------------------------------------------------------------- /extras/Images/svm_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/svm_1.png -------------------------------------------------------------------------------- /extras/Images/svm_dc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/svm_dc.png -------------------------------------------------------------------------------- /extras/Images/teensy32.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/teensy32.jpg -------------------------------------------------------------------------------- /extras/Images/teensy41_4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/teensy41_4.jpg -------------------------------------------------------------------------------- /extras/Images/terminal.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/terminal.jpg -------------------------------------------------------------------------------- /extras/Images/top_shield.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/top_shield.jpg -------------------------------------------------------------------------------- /extras/Images/torque_loop_i.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/torque_loop_i.png -------------------------------------------------------------------------------- /extras/Images/torque_loop_v.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/torque_loop_v.png -------------------------------------------------------------------------------- /extras/Images/torque_modes.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/torque_modes.gif -------------------------------------------------------------------------------- /extras/Images/track.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/track.png -------------------------------------------------------------------------------- /extras/Images/uno_l6234.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/uno_l6234.jpg -------------------------------------------------------------------------------- /extras/Images/uno_l6234_velocity.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/uno_l6234_velocity.jpg -------------------------------------------------------------------------------- /extras/Images/v2_adc.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/v2_adc.gif -------------------------------------------------------------------------------- /extras/Images/v2_ard1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/v2_ard1.jpg -------------------------------------------------------------------------------- /extras/Images/v2_ard2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/v2_ard2.jpg -------------------------------------------------------------------------------- /extras/Images/v2_hall.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/v2_hall.jpg -------------------------------------------------------------------------------- /extras/Images/v2_i2c.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/v2_i2c.jpg -------------------------------------------------------------------------------- /extras/Images/v2_ldo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/v2_ldo.jpg -------------------------------------------------------------------------------- /extras/Images/v2_nuc1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/v2_nuc1.jpg -------------------------------------------------------------------------------- /extras/Images/v2_nuc2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/v2_nuc2.jpg -------------------------------------------------------------------------------- /extras/Images/v2_single.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/v2_single.jpg -------------------------------------------------------------------------------- /extras/Images/velocity_loop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/velocity_loop.png -------------------------------------------------------------------------------- /extras/Images/velocity_loop_i.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/velocity_loop_i.png -------------------------------------------------------------------------------- /extras/Images/velocity_loop_v.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/velocity_loop_v.png -------------------------------------------------------------------------------- /extras/Images/voltage_loop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/voltage_loop.png -------------------------------------------------------------------------------- /extras/Images/voltage_mode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/voltage_mode.png -------------------------------------------------------------------------------- /extras/Images/youtube.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/youtube.png -------------------------------------------------------------------------------- /extras/Images/youtube_drv8302.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/youtube_drv8302.png -------------------------------------------------------------------------------- /extras/Images/youtube_haptic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/youtube_haptic.png -------------------------------------------------------------------------------- /extras/Images/youtube_pendulum.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/youtube_pendulum.png -------------------------------------------------------------------------------- /extras/Images/youtube_stepper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/Images/youtube_stepper.png -------------------------------------------------------------------------------- /extras/fabrication/3d_model.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/fabrication/3d_model.zip -------------------------------------------------------------------------------- /extras/fabrication/BOM.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/fabrication/BOM.xlsx -------------------------------------------------------------------------------- /extras/fabrication/Gerber.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/fabrication/Gerber.zip -------------------------------------------------------------------------------- /extras/fabrication/schematic.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/extras/fabrication/schematic.pdf -------------------------------------------------------------------------------- /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simplefoc/docs_chinese/23e1c8c8d07e760f596c12932e91567ac334cc32/favicon.ico -------------------------------------------------------------------------------- /just-the-docs.gemspec: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | Gem::Specification.new do |spec| 4 | spec.name = "just-the-docs" 5 | spec.version = "0.2.8" 6 | spec.authors = ["Patrick Marsceill"] 7 | spec.email = ["patrick.marsceill@gmail.com"] 8 | 9 | spec.summary = %q{A modern, highly customizable, and responsive Jekyll theme for documention with built-in search.} 10 | spec.homepage = "https://github.com/pmarsceill/just-the-docs" 11 | spec.license = "MIT" 12 | 13 | spec.files = `git ls-files -z`.split("\x0").select { |f| f.match(%r{^(assets|bin|_layouts|_includes|lib|Rakefile|_sass|LICENSE|README)}i) } 14 | spec.executables << 'just-the-docs' 15 | 16 | spec.add_runtime_dependency "bundler", "~> 2.1.4" 17 | spec.add_runtime_dependency "jekyll", ">= 3.8.5", "< 4.1.0" 18 | spec.add_runtime_dependency "jekyll-seo-tag", "~> 2.0" 19 | spec.add_runtime_dependency "rake", ">= 12.3.1", "< 13.1.0" 20 | 21 | end 22 | -------------------------------------------------------------------------------- /lib/tasks/search.rake: -------------------------------------------------------------------------------- 1 | namespace :search do 2 | desc 'Generate the files needed for search functionality' 3 | task :init do 4 | puts 'Creating search data json file...' 5 | mkdir_p 'assets/js' 6 | touch 'assets/js/search-data.json' 7 | content = %Q[{{ page.content | markdownify | replace: '