Coder Social home page Coder Social logo

paper-count's Introduction

paper-count

完成阶段一:计数器basic-count

实现原理

对P3.7进行触发:接通GND,再断开,类似按键工作

再用P1.3进行记录,将脉冲发送到T0计数器端口P3.4,计数器在一次脉冲+1

功能

联合串口输入输出实现功能:

  • 输入‘d’:展示现在的计数器数值

  • 输入‘r’:重置计数器数值

完成阶段二:计时器add-timer

实现原理

使用T2定时器,这是C52相比C51增加的资源,通过设定自动装载能够在50ms时产生中断的值,产生秒数

功能

每秒通过串口输出*,每分通过串口输出&

完成阶段三:卡尔曼滤波器add-frequency

实现原理

通过卡尔曼滤波器,将以上两阶段的计数器与计时器之比做为频率测量值Z,进行一维常量模式下的卡尔曼滤波,不断更新预测值。

功能

每秒通过串口输出,固定周期下的计数值sum 此周期的频率freq 以及经过滤波更新的测量值kalman

完成阶段四:数码管显示与按键交互add-interactive

实现原理

详情查看如下文章:

拟合部分有两种实现:

  • 最小二乘法
  • 中间值法

功能

通过数码管显示,引导用按键进行操作,校正并得到测量结果

改进

在测量固定电容时基本没有问题,但测量纸张稳定性不好,需要对软硬件进行修改。 软件部分:

  • 直接把555的输入接到T0(P3.4)处,避免二次加工
  • TODO:
    • √ 减小测量区间(加快测量速度
    • √ 确定终结点-当偏差小于一定值时停止
    • √ 进一步减小误差! 硬件部分:
  • 有时很稳定,有时不稳定
  • 夹子是金属的,加上一层纸进行绝缘。
  • 减小电路走线

进展

4/24 15:35 激动人心的事发生了:由于幸运更改了代码,现在的输出和纸张数几乎成线性正比!
4/29 终期验收,10以内测量符合要求,但超过10张存在误差,原因是频率与纸张数并非精确的线性关系,校正选择的数据只是2.4.8张
对超过此限度的数据可靠性没有保证。为了达到基本要求:对11~15张纸的准确测量,重新测量数据进行可视化分析 fitCurve

可以看出,整个样本点可分为3个区域,分别为低端、中端与高端
因为在随着纸张数增多,在高端逐渐趋于线性不可分,那么我们主要研究低端和中端。不妨将测量分为两个区域,正如图中所示,在第二个区域(中端)测量得到的拟合曲线可以在该区域准确反映变化。

paper-count's People

Contributors

easilylazy avatar

Watchers

 avatar  avatar

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.