toantech / dengfoc_lib Goto Github PK
View Code? Open in Web Editor NEWFOC Lib for DengFOC
License: GNU General Public License v2.0
FOC Lib for DengFOC
License: GNU General Public License v2.0
DFOC_M0_set_Velocity_Angle函数中DFOC_M0_VEL_PID
函数的输入应该是DFOC_M0_ANGLE_PID
的输出(即期望的速度)减去当前的速度,这样才是正确的双环控制策略。
因此,DFOC_M0_set_Velocity_Angle
函数可以修改为如下形式:
void DFOC_M0_set_Velocity_Angle(float Target)
{
float sensor_angle = DFOC_M0_Angle();
float sensor_vel = DFOC_M0_Velocity();
float target_vel = DFOC_M0_ANGLE_PID((Target - sensor_angle)*180/PI);
setTorque(DFOC_M0_VEL_PID(target_vel - sensor_vel), _electricalAngle());
}
函数首先计算出当前的角度和速度,然后将角度误差输入到角度环PID控制器,得到期望的速度。再将期望的速度和当前的速度做差,得到速度误差,再输入到速度环PID控制器,得到最终的输出。
Hi sir, good day.
iam interesting with your project.
It is posible to drive motor by step/dir???
And it posible to make big driver for ac servo 220v(used cipos igbt with driver or mosfet with driver like ir2101). and posible with 2000ppr encorder sir??
So i want to used stm32f103c8t6
And posible to used current measure by acs712 on phasa U & V???
I will wait for your reply.
Thank uou so much
在数据发送和引脚功能配置上可否加入类似如下的代码以加强在各类嵌入式平台的可移植性和可兼容性
#include "deng_foc_interface.h"
status I2C_send_interface(some pra)
{
/*添加输入您库的代码*/
}
status I2C_read_interface(some pra)
{
/*添加输入您库的代码*/
}
status delay_interface(some pra)
{
/*添加输入您库的输入代码*/
}
status create_mutex_interface(some pra)
{
/*添加输入您库的代码*/
}
status take_mutex_interface(some pra)
{
/*添加输入您库的代码*/
}
status release_mutex_interface(some pra)
{
/*添加输入您库的代码*/
}
status create_msg_interface(some pra)
{
/*添加输入您库的代码*/
}
status take_msg_interface(some pra)
{
/*添加输入您库的代码*/
}
stauts release_msg_interface(some pra)
{
/*添加输入您库的代码*/
}
/*等等如果需要的话*/
如果有的话,可能仅仅需要完成该文件的移植,所有的代码在移植上就基本完成了,也需逻辑部分也是可以完全通用的
以此类推,也需这样的模块也是不错的
#include "hardware.h"
status some_hardware_init(some pra)
{
/*添加输入您库的代码*/
}
status some_hardware_update(some pra)
{
/*添加输入您库的代码*/
}
/*等等如果需要的话*/
这样的话算法部分和硬件部分就可以最大程度的分割开来。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.