Code Monkey home page Code Monkey logo

dengfoc_lib's Issues

DFOC_M0_set_Velocity_Angle 代码bug

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控制器,得到最终的输出。

It is posible to implementatio for step/dir interface??

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)
{
    /*添加输入您库的代码*/
}

/*等等如果需要的话*/

这样的话算法部分和硬件部分就可以最大程度的分割开来。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.