Giter Club home page Giter Club logo

light_trace's Introduction

light_trace

  • 基于stm32和openmv的色块追踪云台
  • STM32F103C8T6作为本系统的主控芯片,在实时接收openmv传来的数据的同时控制舵机云台进行目标追踪

系统主控软件控制流程图

设计方案

  • 舵机脉冲波角度化:舵机的脉冲控制周期为0.5ms2.5ms,控制频率在50Hz330Hz之间。本系统采用的舵机为180°数字舵机,并以50Hz频率控制。即0.5ms为0°,2.5ms为180°,X角度需要的脉冲时间为0.5ms + x/180°* 2ms。
  • 追踪算法:stm32在接收到openmv的串口数据后,即得到了坐标反馈,并以此得到了angle_error,这里采用了PID算法,分别精准控制roll_angle和pitch_angle,使得激光落点位置误差达到最小。
  • Openmv程序设计:采用最传统的色块追踪,通过调用相关库函数来实现色块的追踪的功能。并通过调用pyb写入串口发送函数,将blob.cx和blob.cy实时发送至Stm32。
  • 串口通信协议:串口通信协议采用的数据帧格式,即帧头、数据、校验位、帧尾。这样可以保证数据的准确性和效率性。由于数据可能大于8位,所以我采用了数据高八位和低八位分别传输,保证了数据的准确性。校验位采用数据位之和并对255进行取余。具体的程序设计中,openmv是通过右移实现发送,STM32通过左移实现接收,并且在STM32的串口程序设计中,采用了逐字节判断的方法来接收数据包,当检测到最后一个字节0xfe并且校验成功时,把坐标值传至全局变量中。

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.