风洞稳定小球系统----- 基于Arduino实现的PID距离PWM控制

Posted Mnster_Lu

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了风洞稳定小球系统----- 基于Arduino实现的PID距离PWM控制相关的知识,希望对你有一定的参考价值。

Arduino真的是好用,

已经上瘾。

这次做的是风洞稳定小球系统

一、元件模块

Arduino正面

Arduino引脚接线

驱动板,反正是freescale小破车上用的那款

电源。

 

风洞

风扇型号

二、Arduino代码

一言不合就上代码

#include <PID_v1.h>

      int inputPin=4;  // define ultrasonic signal receiver pin  ECHO to D4
      int outputPin=5; // define ultrasonic signal transmitter pin  TRIG to D5
      int pwm = 6;  //pwm输出D6
      int dis=0;
      double  Setpoint, Input, Output;
      PID myPID(&Input, &Output, &Setpoint,0.7,5.3,0.8, DIRECT);
      void setup()
      {
        Serial.begin(9600);
        pinMode(inputPin, INPUT);
        pinMode(outputPin, OUTPUT);
        pinMode(pwm, OUTPUT);
        Setpoint=160;
        Input=150;
        myPID.SetMode(AUTOMATIC);
       }
       
     void loop()
       {
        dis=distanceM();
        Input=255-map(dis,0,45,20,200);
        myPID.Compute();
        analogWrite(pwm, Output);
        Serial.print("  ");
        Serial.print(Input);
        Serial.print("  ");
        Serial.println(Output);
      }

     int distanceM()
     {
        digitalWrite(outputPin, LOW);
        delayMicroseconds(2);
        digitalWrite(outputPin, HIGH); // Pulse for 10μs to trigger ultrasonic detection
        delayMicroseconds(10);
        digitalWrite(outputPin, LOW);  
        int distance = pulseIn(inputPin, HIGH);  // Read receiver pulse time
        distance= distance/58;   // Transform pulse time to distance
        Serial.print(distance);   //Ourput distance                
        delay(50); 
        return distance;
      }

 

之前已经说过连接了

再发一遍

传感器SRF05超声波

 VCC ------------5V

 GND  ------------GND

 PIN  ECHO -----D4
 PIN  TRIG ----- D5

 代码里使用了一个自带库PID_v1.h

myPID(&Input, &Output, &Setpoint,0.7,5.3,0.8, DIRECT);

输入,输出,稳定收敛位置点,Kp,Ki,Kd,直接方式。

 

Input=255-map(dis,0,45,20,200);

这里是一个映射,因为我的传感器放在了风洞的上端

这样距离顶端越近数值就越小,所以需要改个符号。

让它的数值和高度成正比。

而PWM正好是0-255的数值,所以这样改。

PWM的输出脚是D6,

频率是1kHz,虽然频率低了但是还够用。

 

三、参数调试

 

接下来用串口数据来看

分别是距离,input,output。

 

 

我把数据拿下来用matlab来plot

 

红色代表高度,还是比较稳定的

黄色就是PWM的值。

因为之前测试传感器非常稳定,

所以数据输入我并没有用Kalman filter来处理。

还有,数据在这里

46  51.00  255.00
45  55.00  255.00
46  51.00  255.00
48  43.00  255.00
46  51.00  255.00
46  51.00  255.00
46  51.00  255.00
46  51.00  255.00
45  55.00  255.00
45  55.00  255.00
44  59.00  255.00
43  63.00  255.00
42  67.00  255.00
40  75.00  255.00
38  83.00  80.50
36  91.00  80.50
35  95.00  142.50
33  103.00  142.50
31  111.00  38.50
31  111.00  38.50
27  127.00  14.50
26  131.00  14.50
24  139.00  76.50
24  139.00  76.50
21  151.00  58.50
20  155.00  58.50
19  159.00  126.50
18  163.00  126.50
17  167.00  114.50
17  167.00  114.50
15  175.00  102.50
15  175.00  102.50
12  187.00  0.00
11  191.00  0.00
10  195.00  50.50
8  203.00  50.50
7  207.00  0.00
5  215.00  0.00
4  219.00  0.00
3  223.00  0.00
3  223.00  0.00
2  227.00  0.00
2  227.00  0.00
2  227.00  0.00
2  227.00  0.00
2  227.00  0.00
3  223.00  15.50
2  227.00  15.50
4  219.00  21.50
4  219.00  21.50
3  223.00  0.00
3  223.00  0.00
4  219.00  21.50
5  215.00  21.50
6  211.00  113.50
7  207.00  113.50
8  203.00  125.50
9  199.00  125.50
9  199.00  51.50
10  195.00  51.50
10  195.00  57.50
10  195.00  57.50
9  199.00  0.00
10  195.00  0.00
9  199.00  0.00
9  199.00  0.00
9  199.00  0.00
9  199.00  0.00
9  199.00  0.00
10  195.00  0.00
10  195.00  57.50
10  195.00  57.50
10  195.00  0.00
11  191.00  0.00
12  187.00  149.50
13  183.00  149.50
15  175.00  252.50
15  175.00  252.50
16  171.00  107.50
16  171.00  107.50
16  171.00  36.50
15  175.00  36.50
15  175.00  0.00
15  175.00  0.00
13  183.00  0.00
12  187.00  0.00
11  191.00  0.00
11  191.00  0.00
11  191.00  0.00
10  195.00  0.00
10  195.00  0.00
11  191.00  0.00
11  191.00  63.50
11  191.00  63.50
12  187.00  69.50
12  187.00  69.50
13  183.00  75.50
13  183.00  75.50
14  179.00  82.50
14  179.00  82.50
15  175.00  93.50
15  175.00  93.50
15  175.00  18.50
13  183.00  18.50
12  187.00  0.00
12  187.00  0.00
12  187.00  0.00
11  191.00  0.00
11  191.00  0.00
11  191.00  0.00
11  191.00  0.00
11  191.00  0.00
11  191.00  0.00
12  187.00  0.00
12  187.00  69.50
13  183.00  69.50
15  175.00  252.50
15  175.00  252.50
16  171.00  107.50
16  171.00  107.50
17  167.00  126.50
16  171.00  126.50
16  171.00  0.00
15  175.00  0.00
15  175.00  0.00
13  183.00  0.00
12  187.00  0.00
11  191.00  0.00
11  191.00  0.00
10  195.00  0.00
10  195.00  0.00
9  199.00  0.00
9  199.00  0.00
10  195.00  0.00
11  191.00  143.50
10  195.00  143.50
10  195.00  0.00
11  191.00  0.00
11  191.00  63.50
11  191.00  63.50
11  191.00  0.00
11  191.00  0.00
11  191.00  0.00
11  191.00  0.00
11  191.00  0.00
12  187.00  0.00
13  183.00  155.50
14  179.00  155.50
15  175.00  172.50
15  175.00  172.50
16  171.00  107.50
16  171.00  107.50
16  171.00  36.50
15  175.00  36.50
15  175.00  0.00
15  175.00  0.00
13  183.00  0.00
12  187.00  0.00
11  191.00  0.00
11  191.00  0.00
11  191.00  0.00
11  191.00  0.00
11  191.00  0.00
11  191.00  0.00
11  191.00  0.00
11  191.00  0.00
12  187.00  69.50
12  187.00  69.50
15  175.00  252.50
15  175.00  252.50
16  171.00  107.50
16  171.00  107.50
16  171.00  36.50
16  171.00  36.50
16  171.00  45.50
15  175.00  45.50
15  175.00  0.00
15  175.00  0.00
15  175.00  49.50
15  175.00  49.50
15  175.00  54.50
15  175.00  54.50
15  175.00  59.50
15  175.00  59.50
15  175.00  64.50
15  175.00  64.50
15  175.00  69.50
15  175.00  69.50
16  171.00  164.50
16  171.00  164.50
15  175.00  3.50
15  175.00  3.50
15  175.00  88.50
15  175.00  88.50
14  179.00  3.50
13  183.00  3.50
12  187.00  0.00
12  187.00  0.00
11  191.00  0.00
11  191.00  0.00
11  191.00  36.50
11  191.00  36.50
11  191.00  25.50
11  191.00  25.50
11  191.00  14.50
11  191.00  14.50
12  187.00  93.50
12  187.00  93.50
13  183.00  96.50
15  175.00  96.50
15  175.00  193.50
15  175.00  193.50
15  175.00  38.50
15  175.00  38.50
14  179.00  0.00
13  183.00  0.00
12  187.00  0.00
11  191.00  0.00
11  191.00  0.00
11  191.00  0.00
10  195.00  0.00
10  195.00  0.00
10  195.00  0.00
10  195.00  0.00
10  195.00  0.00
10  195.00  0.00
10  195.00  0.00
11  191.00  0.00
12  187.00  149.50
12  187.00  149.50
15  175.00  252.50
15  175.00  252.50
16  171.00  107.50
16  171.00  107.50
16  171.00  36.50
16  171.00  36.50
15  175.00  0.00
15  175.00  0.00
15  175.00  40.50
14  179.00  40.50
13  183.00  0.00
12  187.00  0.00
12  187.00  0.00
12  187.00  0.00
12  187.00  5.50
12  187.00  5.50
12  187.00  0.00
13  183.00  0.00
14  179.00  171.50
15  175.00  171.50
15  175.00  102.50
15  175.00  102.50
16  171.00  117.50
16  171.00  117.50
16  171.00  46.50
15  175.00  46.50
15  175.00  0.00
15  175.00  0.00
15  175.00  50.50
13  183.00  50.50
12  187.00  0.00
12  187.00  0.00
12  187.00  18.50
11  191.00  18.50
11  191.00  0.00
11  191.00  0.00
12  187.00  80.50
12  187.00  80.50
12  187.00  0.00
13  183.00  0.00
13  183.00  76.50
15  175.00  76.50
15  175.00  173.50
15  175.00  173.50
15  175.00  18.50
15  175.00  18.50
15  175.00  23.50
15  175.00  23.50
15  175.00  28.50
15  175.00  28.50
14  179.00  0.00
14  179.00  0.00
15  175.00  114.50
14  179.00  114.50
15  175.00  39.50
15  175.00  39.50
15  175.00  44.50
15  175.00  44.50
15  175.00  49.50
15  175.00  49.50
15  175.00  54.50
15  175.00  54.50
15  175.00  59.50
15  175.00  59.50
16  171.00  154.50
16  171.00  154.50
16  171.00  83.50
16  171.00  83.50
16  171.00  92.50
16  171.00  92.50
16  171.00  101.50
15  175.00  101.50
15  175.00  20.50
12  187.00  20.50
11  191.00  0.00
10  195.00  0.00
10  195.00  0.00
9  199.00  0.00
9  199.00  0.00
8  203.00  0.00
7  207.00  0.00
8  203.00  0.00
6  211.00  0.00
6  211.00  0.00
7  207.00  39.50
8  203.00  39.50
7  207.00  0.00
7  207.00  0.00
8  203.00  45.50
8  203.00  45.50
9  199.00  51.50
10  195.00  51.50
10  195.00  57.50
11  191.00  57.50
12  187.00  149.50
13  183.00  149.50
15  175.00  252.50
15  175.00  252.50
15  175.00  17.50
15  175.00  17.50
15  175.00  22.50
15  175.00  22.50
13  183.00  0.00
12  187.00  0.00
12  187.00  0.00
12  187.00  0.00
11  191.00  0.00
11  191.00  0.00
11  191.00  0.00
12  187.00  0.00
12  187.00  69.50
12  187.00  69.50
14  179.00  162.50
15  175.00  162.50
15  175.00  93.50
15  175.00  93.50
16  171.00  108.50
15  175.00  108.50
15  175.00  0.00
15  175.00  0.00
14  179.00  0.00
13  183.00  0.00
12  187.00  0.00
11  191.00  0.00
11  191.00  0.00
11  191.00  0.00
10  195.00  0.00
11  191.00  0.00
11  191.00  63.50
10  195.00  63.50
11  191.00  0.00
11  191.00  0.00
11  191.00  0.00
12  187.00  0.00
12  187.00  69.50
13  183.00  69.50
15  175.00  252.50
15  175.00  252.50
16  171.00  107.50
16  171.00  107.50
16  171.00  36.50
16  171.00  36.50
16  171.00  45.50
15  175.00  45.50
15  175.00  0.00
15  175.00  0.00
15  175.00  49.50
13  183.00  49.50
13  183.00  0.00
14  179.00  0.00
15  175.00  211.50
15  175.00  211.50
15  175.00  56.50
15  175.00  56.50
14  179.00  0.00
15  175.00  0.00
14  179.00  52.50
13  183.00  52.50
12  187.00  0.00
12  187.00  0.00
13  183.00  116.50
12  187.00  116.50
13  183.00  33.50
13  183.00  33.50
13  183.00  30.50
13  183.00  30.50
12  187.00  0.00
12  187.00  0.00
13  183.00  100.50
13  183.00  100.50
13  183.00  17.50
14  179.00  17.50
14  179.00  104.50
15  175.00  104.50
15  175.00  115.50
15  175.00  115.50
15  175.00  40.50
15  175.00  40.50
13  183.00  0.00
12  187.00  0.00
12  187.00  0.00
11  191.00  0.00
11  191.00  0.00
10  195.00  0.00
11  191.00  0.00
11  191.00  0.00
10  195.00  0.00
10  195.00  0.00
11  191.00  63.50
11  191.00  63.50
12  187.00  69.50
12  187.00  69.50
13  183.00  75.50
15  175.00  75.50
15  175.00  172.50
15  175.00  172.50
15  175.00  17.50
15  175.00  17.50
15  175.00  22.50
15  175.00  22.50
14  179.00  0.00
13  183.00  0.00
13  183.00  0.00
12  187.00  0.00
12  187.00  0.00
12  187.00  0.00
13  183.00  78.50
13  183.00  78.50
14  179.00  85.50
15  175.00  85.50
15  175.00  96.50
15  175.00  96.50
15  175.00  21.50
15  175.00  21.50
15  175.00  26.50
15  175.00  26.50
15  175.00  31.50
13  183.00  31.50
13  183.00  0.00
13  183.00  0.00
13  183.00  13.50
13  183.00  13.50
13  183.00  10.50
15  175.00  10.50
15  175.00  187.50
15  175.00  187.50
15  175.00  32.50
16  171.00  32.50
16  171.00  127.50
17  167.00  127.50
17  167.00  146.50
17  167.00  146.50
16  171.00  0.00
16  171.00  0.00
15  175.00  0.00
15  175.00  0.00
14  179.00  0.00
13  183.00  0.00
12  187.00  0.00
12  187.00  0.00
12  187.00  37.50
12  187.00  37.50
12  187.00  30.50
12  187.00  30.50
12  187.00  23.50
12  187.00  23.50
13  183.00  106.50
15  175.00  106.50
15  175.00  203.50
15  175.00  203.50
15  175.00  48.50
16  171.00  48.50
15  175.00  53.50
15  175.00  53.50
15  175.00  58.50
15  175.00  58.50
15  175.00  63.50
13  183.00  63.50
13  183.00  0.00
12  187.00  0.00
12  187.00  0.00
12  187.00  0.00
12  187.00  28.50
12  187.00  28.50
12  187.00  21.50
12  187.00  21.50
12  187.00  14.50
12  187.00  14.50
13  183.00  97.50
15  175.00  97.50
15  175.00  194.50
15  175.00  194.50
16  171.00  129.50
16  171.00  129.50
16  171.00  58.50
16  171.00  58.50
15  175.00  0.00
15  175.00  0.00
14  179.00  0.00
12  187.00  0.00
11  191.00  0.00
11  191.00  0.00
11  191.00  12.50
11  191.00  12.50
10  195.00  0.00
10  195.00  0.00
10  195.00  0.00
10  195.00  0.00
11  191.00  63.50
11  191.00  63.50
12  187.00  69.50
12  187.00  69.50
14  179.00  162.50
15  175.00  162.50
15  175.00  93.50
15  175.00  93.50
15  175.00  18.50
15  175.00  18.50
15  175.00  23.50
12  187.00  23.50
12  187.00  0.00
12  187.00  0.00
11  191.00  0.00
11  191.00  0.00
11  191.00  0.00
11  191.00  0.00
11  191.00  0.00
11  191.00  0.00
12  187.00  69.50
12  187.00  69.50
13  183.00  75.50
14  179.00  75.50
15  175.00  172.50
15  175.00  172.50
15  175.00  17.50
15  175.00  17.50
15  175.00  22.50
15  175.00  22.50
15  175.00  27.50
15  175.00  27.50
15  175.00  32.50
15  175.00  32.50
15  175.00  37.50
15  175.00  37.50
15  175.00  42.50
15  175.00  42.50
16  171.00  137.50
16  171.00  137.50
17  167.00  156.50
18  163.00  156.50
18  163.00  179.50
18  163.00  179.50
18  163.00  116.50
17  167.00  116.50
16  171.00  0.00
15  175.00  0.00
13  183.00  0.00
11  191.00  0.00
11  191.00  0.00
10  195.00  0.00
9  199.00  0.00
9  199.00  0.00
7  207.00  0.00
7  207.00  0.00
7  207.00  0.00
7  207.00  0.00
6  211.00  0.00
6  211.00  0.00
7  207.00  39.50
7  207.00  39.50
7  207.00  0.00
8  203.00  0.00
8  203.00  45.50
9  199.00  45.50
9  199.00  51.50
10  195.00  51.50
11  191.00  143.50
11  191.00  143.50
12  187.00  69.50
12  187.00  69.50
12  187.00  0.00
13  183.00  0.00
12  187.00  0.00
12  187.00  0.00
12  187.00  0.00
12  187.00  0.00
13  183.00  75.50
14  179.00  75.50
15  175.00  172.50
15  175.00  172.50
15  175.00  17.50
15  175.00  17.50
15  175.00  22.50
15  175.00  22.50
15  175.00  27.50
15  175.00  27.50
15  175.00  32.50
15  175.00  32.50
15  175.00  37.50
15  175.00  37.50
15  175.00  42.50
16  171.00  42.50
17  167.00  227.50
17  167.00  227.50
18  163.00  170.50
18  163.00  170.50
18  163.00  107.50
17  167.00  107.50
18  163.00  124.50
17  167.00  124.50
16  171.00  0.00
15  175.00  0.00
14  179.00  0.00
12  187.00  0.00
11  191.00  0.00
10  195.00  0.00
9  199.00  0.00
8  203.00  0.00
8  203.00  0.00
7  207.00  0.00
7  207.00  0.00
6  211.00  0.00
6  211.00  0.00
7  207.00  0.00
7  207.00  39.50
7  207.00  39.50
8  203.00  45.50
8  203.00  45.50
8  203.00  0.00
9  199.00  0.00
10  195.00  137.50
10  195.00  137.50
10  195.00  0.00
11  191.00  0.00
11  191.00  63.50
11  191.00  63.50
12  187.00  69.50
12  187.00  69.50
13  183.00  75.50
13  183.00  75.50
14  179.00  82.50
14  179.00  82.50
14  179.00  3.50
13  183.00  3.50
13  183.00  0.00
12  187.00  0.00
12  187.00  0.00
12  187.00  0.00
12  187.00  0.00
12  187.00  0.00
12  187.00  0.00
12  187.00  0.00
13  183.00  75.50
15  175.00  75.50
15  175.00  172.50
15  175.00  172.50
16  171.00  107.50
17  167.00  107.50
17  167.00  126.50
16  171.00  126.50
16  171.00  0.00
15  175.00  0.00
15  175.00  0.00
13  183.00  0.00
12  187.00  0.00
12  187.00  0.00
11  191.00  0.00
11  191.00  0.00
10  195.00  0.00
11  191.00  0.00
10  195.00  0.00
11  191.00  0.00
10  195.00  0.00
11  191.00  0.00
11  191.00  63.50
12  187.00  63.50
12  187.00  69.50
15  175.00  69.50
15  175.00  252.50
15  175.00  252.50
15  175.00  17.50
16  171.00  17.50
16  171.00  112.50
15  175.00  112.50
15  175.00  0.00
15  175.00  0.00
15  175.00  36.50
15  175.00  36.50
13  183.00  0.00
13  183.00  0.00
12  187.00  0.00
12  187.00  0.00
12  187.00  1.50
12  187.00  1.50
12  187.00  0.00
13  183.00  0.00
14  179.00  167.50
15  175.00  167.50
15  175.00  98.50
16  171.00  98.50
16  171.00  113.50
16  171.00  113.50
16  171.00  42.50
16  171.00  42.50
15  175.00  0.00
15  175.00  0.00
15  175.00  46.50
14  179.00  46.50
13  183.00  0.00
13  183.00  0.00
12  187.00  0.00
12  187.00  0.00
12  187.00  11.50
12  187.00  11.50
12  187.00  4.50
13  183.00  4.50
14  179.00  177.50
15  175.00  177.50
15  175.00  108.50
15  175.00  108.50
16  171.00  123.50
16  171.00  123.50
16  171.00  52.50
15  175.00  52.50
15  175.00  0.00
15  175.00  0.00
14  179.00  0.00
13  183.00  0.00
12  187.00  0.00
11  191.00  0.00
12  187.00  20.50
11  191.00  20.50
12  187.00  13.50
11  191.00  13.50
12  187.00  6.50
12  187.00  6.50
13  183.00  89.50
15  175.00  89.50
15  175.00  186.50
15  175.00  186.50
16  171.00  121.50
16  171.00  121.50
16  171.00  50.50
15  175.00  50.50
15  175.00  0.00
15  175.00  0.00
13  183.00  0.00
12  187.00  0.00
12  187.00  0.00
11  191.00  0.00
11  191.00  0.00
11  191.00  0.00
11  191.00  0.00
11  191.00  0.00
11  191.00  0.00
11  191.00  0.00
12  187.00  69.50
13  183.00  69.50
14  179.00  162.50
15  175.00  162.50
15  175.00  93.50
16  171.00  93.50
16  171.00  108.50
16  171.00  108.50
16  171.00  37.50
16  171.00  37.50
15  175.00  0.00
15  175.00  0.00
13  183.00  0.00
12  187.00  0.00
12  187.00  0.00
11  191.00  0.00
11  191.00  0.00
11  191.00  0.00
11  191.00  0.00
11  191.00  0.00
11  191.00  0.00
12  187.00  0.00
12  187.00  69.50
13  183.00  69.50
15  175.00  252.50
15  175.00  252.50
16  171.00  107.50
16  171.00  107.50
16  171.00  36.50
16  171.00  36.50
16  171.00  45.50
16  171.00  45.50
15  175.00  0.00
15  175.00  0.00
15  175.00  49.50
15  175.00  49.50
15  175.00  54.50
15  175.00  54.50
14  179.00  0.00
15  175.00  0.00
14  179.00  50.50
14  179.00  50.50
15  175.00  141.50
15  175.00  141.50
15  175.00  66.50
16  171.00  66.50
15  175.00  71.50
15  175.00  71.50
15  175.00  76.50
15  175.00  76.50
15  175.00  81.50
15  175.00  81.50
15  175.00  86.50
13  183.00  86.50
12  187.00  0.00
11  191.00  0.00
10  195.00  0.00
10  195.00  0.00
9  199.00  0.00
9  199.00  0.00
8  203.00  0.00
8  203.00  0.00
8  203.00  0.00
8  203.00  0.00
8  203.00  0.00
8  203.00  0.00
9  199.00  51.50
9  199.00  51.50
10  195.00  57.50
10  195.00  57.50
10  195.00  0.00
10  195.00  0.00
11  191.00  63.50
12  187.00  63.50
12  187.00  69.50
13  183.00  69.50
15  175.00  252.50
15  175.00  252.50
15  175.00  17.50
15  175.00  17.50
15  175.00  22.50
15  175.00  22.50
15  175.00  27.50
15  175.00  27.50
15  175.00  32.50
14  179.00  32.50
14  179.00  0.00
14  179.00  0.00
14  179.00  28.50
15  175.00  28.50
15  175.00  119.50
15  175.00  119.50
16  171.00  134.50
16  171.00  134.50
17  167.00  153.50
17  167.00  153.50
16  171.00  0.00
16  171.00  0.00
15  175.00  0.00
15  175.00  0.00
14  179.00  0.00
13  183.00  0.00
12  187.00  0.00
12  187.00  0.00
12  187.00  44.50
11  191.00  44.50
11  191.00  0.00
12  187.00  0.00
12  187.00  106.50
12  187.00  106.50
12  187.00  19.50
13  183.00  19.50
13  183.00  102.50
14  179.00  102.50
14  179.00  109.50
15  175.00  109.50
14  179.00  30.50
13  183.00  30.50
12  187.00  0.00
12  187.00  0.00
11  191.00  0.00
11  191.00  0.00
11  191.00  0.00
10  195.00  0.00
10  195.00  0.00
10  195.00  0.00
10  195.00  0.00
11  191.00  0.00
11  191.00  63.50
11  191.00  63.50
12  187.00  69.50
15  175.00  69.50
15  175.00  252.50
15  175.00  252.50
15  175.00  17.50
16  171.00  17.50
15  175.00  22.50
16  171.00  22.50
15  175.00  27.50
15  175.00  27.50
15  175.00  32.50
15  175.00  32.50
15  175.00  37.50
15  175.00  37.50
15  175.00  42.50
15  175.00  42.50
16  171.00  137.50
16  171.00  137.50
17  167.00  156.50
17  167.00  156.50
18  163.00  179.50
18  163.00  179.50
17  167.00  26.50
16  171.00  26.50
15  175.00  0.00
15  175.00  0.00
13  183.00  0.00
12  187.00  0.00
11  191.00  0.00
11  191.00  0.00
10  195.00  0.00
10  195.00  0.00
10  195.00  25.50
10  195.00  25.50
9  199.00  0.00
10  195.00  0.00
10  195.00  71.50
9  199.00  71.50
10  195.00  0.00
10  195.00  0.00
11  191.00  63.50
11  191.00  63.50
11  191.00  0.00
12  187.00  0.00
12  187.00  69.50
13  183.00  69.50
15  175.00  252.50
15  175.00  252.50
15  175.00  17.50
15  175.00  17.50
15  175.00  22.50
15  175.00  22.50
15  175.00  27.50
15  175.00  27.50
15  175.00  32.50
15  175.00  32.50
15  175.00  37.50
15  175.00  37.50
15  175.00  42.50
15  175.00  42.50
15  175.00  47.50
15  175.00  47.50
16  171.00  142.50
17  167.00  142.50
18  163.00  251.50
18  163.00  251.50
18  163.00  108.50
18  163.00  108.50
17  167.00  35.50
16  171.00  35.50
15  175.00  0.00
15  175.00  0.00
15  175.00  113.50
12  187.00  113.50
11  191.00  0.00
11  191.00  0.00
10  195.00  0.00
9  199.00  0.00
10  195.00  42.50
8  203.00  42.50
8  203.00  0.00
7  207.00  0.00
7  207.00  0.00
7  207.00  0.00
7  207.00  0.00
7  207.00  0.00
7  207.00  0.00
7  207.00  0.00
8  203.00  45.50
9  199.00  45.50
9  199.00  51.50
9  199.00  51.50
9  199.00  0.00
10  195.00  0.00
11  191.00  143.50
11  191.00  143.50
12  187.00  69.50
13  183.00  69.50
15  175.00  252.50
15  175.00  252.50
15  175.00  17.50
14  179.00  17.50
13  183.00  0.00
12  187.00  0.00
11  191.00  0.00
11  191.00  0.00
10  195.00  0.00
10  195.00  0.00
10  195.00  0.00
10  195.00  0.00
9  199.00  0.00
10  195.00  0.00
10  195.00  57.50
10  195.00  57.50
11  191.00  63.50
11  191.00  63.50
12  187.00  69.50
12  187.00  69.50
13  183.00  75.50
14  179.00  75.50
15  175.00  172.50
15  175.00  172.50
15  175.00  17.50
14  179.00  17.50
12  187.00  0.00
12  187.00  0.00
11  191.00  0.00
11  191.00  0.00
10  195.00  0.00
10  195.00  0.00
10  195.00  0.00
10  195.00  0.00
9  199.00  0.00
10  195.00  0.00
10  195.00  57.50
10  195.00  57.50
11  191.00  63.50
11  191.00  63.50
12  187.00  69.50
12  187.00  69.50
13  183.00  75.50
15  175.00  75.50
14  179.00  82.50
14  179.00  82.50
15  175.00  93.50
15  175.00  93.50
13  183.00  0.00
12  187.00  0.00
12  187.00  0.00
11  191.00  0.00
11  191.00  0.00
10  195.00  0.00
10  195.00  0.00
9  199.00  0.00
10  195.00  0.00
10  195.00  0.00
10  195.00  0.00
10  195.00  0.00
10  195.00  0.00
11  191.00  0.00
11  191.00  63.50
12  187.00  63.50
14  179.00  242.50
15  175.00  242.50
16  171.00  183.50
16  171.00  183.50
17  167.00  122.50
16  171.00  122.50
16  171.00  0.00
15  175.00  0.00
15  175.00  0.00
13  183.00  0.00
12  187.00  0.00
11  191.00  0.00
10  195.00  0.00
9  199.00  0.00
9  199.00  0.00
9  199.00  0.00
9  199.00  0.00
9  199.00  0.00
9  199.00  0.00
9  199.00  0.00
10  195.00  57.50
10  195.00  57.50
10  195.00  0.00
11  191.00  0.00
11  191.00  63.50
11  191.00  63.50
12  187.00  69.50
14  179.00  69.50
15  175.00  252.50
15  175.00  252.50
15  175.00  17.50
15  175.00  17.50
15  175.00  22.50
15  175.00  22.50
15  175.00  27.50
15  175.00  27.50
15  175.00  32.50
15  175.00  32.50
14  179.00  0.00
15  175.00  0.00
15  175.00  118.50
15  175.00  118.50
15  175.00  43.50
15  175.00  43.50
15  175.00  48.50
15  175.00  48.50
15  175.00  53.50
15  175.00  53.50
15  175.00  58.50
16  171.00  58.50
16  171.00  153.50
16  171.00  153.50
16  171.00  82.50
16  171.00  82.50
16  171.00  91.50
16  171.00  91.50
15  175.00  10.50
15  175.00  10.50
14  179.00  5.50
13  183.00  5.50
12  187.00  0.00
11  191.00  0.00
11  191.00  0.00
11  191.00  0.00
10  195.00  0.00
10  195.00  0.00
10  195.00  13.50
11  191.00  13.50
10  195.00  0.00
11  191.00  0.00
11  191.00  73.50
11  191.00  73.50
12  187.00  72.50
13  183.00  72.50
15  175.00  255.00
15  175.00  255.00
15  175.00  20.50
15  175.00  20.50
15  175.00  25.50
15  175.00  25.50
14  179.00  0.00
13  183.00  0.00
13  183.00  0.00
12  187.00  0.00
12  187.00  0.00
12  187.00  0.00
13  183.00  81.50
14  179.00  81.50
15  175.00  178.50
15  175.00  178.50
15  175.00  23.50
15  175.00  23.50
15  175.00  28.50
15  175.00  28.50
15  175.00  33.50
15  175.00  33.50
15  175.00  38.50
13  183.00  38.50
13  183.00  0.00
14  179.00  0.00
15  175.00  200.50
15  175.00  200.50
15  175.00  45.50

  最后,高能预警。

 

 

 

 

 

 

 

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

------------------------------------------------------------------------------------------------!!!!!--------------------------------------------------------------------------------------------

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 

 

 

 

 

 

 

 

 

 

 

 

被风扇砍了一刀,

 

综上,没有烂尾,万岁!

完结撒花。

以上是关于风洞稳定小球系统----- 基于Arduino实现的PID距离PWM控制的主要内容,如果未能解决你的问题,请参考以下文章

基于Arduino+LabVIEW的多路数据采集系统

基于Proteus,Arduino,Flask搭建的智能大棚管理系统

基于arduino的红外传感系统

FPGA开源项目:小球追踪系统设计(临时开源)

Java小程序之球球大作战(基于Java线程实现)

Java小程序之球球大作战(基于Java线程实现)