1 Star 1 Fork 2

downloade / CawFOC

forked from GuaikOrg / CawFOC 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

🦉 CAW-FOC

🎮 项目地址

Github: https://github.com/GUAIK-ORG/CawFOC

Gitee: https://gitee.com/GuaikOrg/CawFOC

📜 项目介绍

CAW FOC 项目由 3 部分组成,在 CAW-PACKAGES/ControlSystem/FOC 目录下存放相关的代码。

  • foc.h/foc.c:foc 相关的主要算法
  • foc_hal.h/foc_hal.c:用于配置编码器
  • foc_test.h/foc_test.c:测试程序

🎥 效果展示

https://www.bilibili.com/video/BV1Hh4y1M7nH/

https://www.bilibili.com/video/BV1BP411v7nA/

⏰ TODO

功能 状态
开环速度控制
闭环力矩控制
闭环位置控制
闭环速度控制

🎮 配置 & 编译项目

安装 arm-none-eabi-gcc

Windows

Mac

brew tap ArmMbed/homebrew-formulae
brew install arm-none-eabi-gcc

编译

切换到项目根目录然后运行: mingw32-make,即可在项目根目录中的 build 目录中找到编译生成的文件[CawFOC.elf | CawFOC.bin | CawFOC.hex]。

👨‍💻 使用示例

一下代码可以在freertos.c中查看

FOC_T foc1;
PID_T velPID1;
PID_T anglePID1;
LOWPASS_FILTER_T velFilter1;
FOC_Closeloop_Init(&foc1, &htim1, PWM_PERIOD, 12.6, 1, 7);
FOC_SetVoltageLimit(&foc1, 10.0);
FOC_HAL_Init(&foc1, &hi2c1);

PID_Init(&velPID1, 2, 0, 0, 100000, foc1.voltage_power_supply / 2);
PID_Init(&anglePID1, 2, 0, 0, 100000, 100);
LOWPASS_FILTER_Init(&velFilter1, 0.01);

FOC_AlignmentSensor(&foc1);

for (;;) {
    // 闭环位置控制
    // Foc_TestCloseloopAngle(&foc1, &anglePID1, 3.141592654);

    // 闭环速度控制
    Foc_TestCloseloopVelocity(&foc1, &velFilter1, &velPID1, 10);
    FOC_SensorUpdate();
    osDelay(1);
}

📚 参考资料

Park 变换:https://zhuanlan.zhihu.com/p/614244367

Clark 变换:https://zhuanlan.zhihu.com/p/613996592

DengFoc:http://dengfoc.com/#/

SimpleFOC 中文:http://simplefoc.cn/#/

MIT License Copyright (c) 2023 GUAIK-ORG Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

基于STM32 HAL库的FOC封装 展开 收起
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/downloade/CawFOC.git
git@gitee.com:downloade/CawFOC.git
downloade
CawFOC
CawFOC
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891