Giter Site home page Giter Site logo

Comments (6)

gpmontt avatar gpmontt commented on May 28, 2024 1

Hi everyone, @zhangcaocao have you tried to calibrate your PID? normally PWM value work beetween 1ms and 2ms as a servo

maybe, you need to give the correct values in your PID instance.

#include "PID.h"
PID pid( -255, 255, 0.05, 0.9, 0.1);
/*PID(float min_val, float max_val, float kp, float ki, float kd)
 * min_val = min output PID value
 * max_val = max output PID value
 * kp = PID - P constant
 * ki = PID - I constant
 * di = PID - D constant
 */

float setpoint = 30;
float measured_value = 0;
void setup() 
{
    Serial.begin(9600);
}

void loop() 
{
    Serial.println(pid.compfoute(setpoint, measured_value));
    delay(1000);
    measured_value++;
}

from linorobot.

AllofLife avatar AllofLife commented on May 28, 2024

你需要自己标定pid

from linorobot.

zhangcaocao avatar zhangcaocao commented on May 28, 2024

@AllofLife ,不是标定问题好吧,而是PID的error太大了,输入到电调中电机无法正常动作。

from linorobot.

zhuwei avatar zhuwei commented on May 28, 2024

我觉得跟pid没关系啊。
源码直接把rpm写入pwm了。
问题是pwm是8位,最大也就255,rpm不一定,有可能600。
虽然PID::compute有限制范围,但我觉得应该按比例转换成pwm,而不是把rpm当做pwm。
搞不清楚作者为什么这么做。

from linorobot.

zhuwei avatar zhuwei commented on May 28, 2024

@zhangcaocao @AllofLife 大佬,能不能加个联系方式。PID整定不会,能不能指导一下。

from linorobot.

AllofLife avatar AllofLife commented on May 28, 2024

wechat r15297833965

from linorobot.

Related Issues (20)

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.