y图网

割草机器人自动避障系统设计【论文+开题报告+任务书+翻译+毕业实习调研报告+中期检查表+审题表】 论文附录包含:超声波避障舵机转动编程、电路原理图

本站优惠价
50.00
9.0折 原价:¥55.5
  • 库存
  • 销量
  • 999997
  • 3
  • 服务
  • 由"毕业季"发货,并提供售后服务。
担保交易,完全保证,有问题可咨询客服协商处理,商品虚假、链接失效可申请补发或者退款
  • 分享

毕业季

  • 信誉:
  • 掌柜:
  • zyh
  • 宝贝:
  • 119050件
  • 认证:
  • 个人
  • 创店:
  • 2018-07-27
  • 描述
    4.99
  • 发货
    5.00
  • 售后
    4.99

割草机器人自动避障系统设计【论文+开题报告+任务书+翻译+毕业实习调研报告+中期检查表+审题表】

 

 

自动避障系统是割草机器人关键模块之一,是割草机器人自主、安全行走前提。本文首先对国内外市场上现存的智能割草机器人进行了介绍和比较,指出了现在智能割草机器人研制过程中需要注意的关键技术,并结合以往的成功经验和现在的实际需求,选择易于实验的小车结构。STC89C52单片机是宏晶科技推出的新一代高速/低功耗/超强抗干扰的单片机,指令代码完全兼容传统8051单片机,12时钟/机器周期和6时钟/机器周期可以任意选择。本课题以设计割草机器人自动避障为目的,采用STC89C52单片机作为控制核心,采用超声波传感器来检查路面上的障碍,来控制执行机构的自动避障,从而使执行机构完成左转、右转和后退的动作。其中采用的技术主要有:(1)超声波传感器的有效应用,(2)显示器的使用,(3)通过编程来控制执行机构的运动。

 

关键词:STC89C52单片机,超声波传感器,执行机构,显示器


Abstract

 

 

Automatic obstacle avoidance system is one of the key module robot mowers mowing robot, is independent, safe walking premise. This paper firstly introduced and compared to the domestic and foreign existing in the market of intelligent robot mowers, points out the key technologies in the development process of the Intelligent Robot Mower now, combined with the successful experiences and actual demand now, select the vehicle structure is easy to experiment.STC89C52SCM is the macro crystal technology, the introduction of a new generation of high / low power / super anti-jamming MCU, the instruction code is fully compatible with traditional 8051 SCM, 12 clock / machine cycle and 6 clock / machine cycle can be arbitrarily chosen.

The design of automatic obstacle avoidance for Robot Mower, using STC89C52 micro-controller as control core, using ultrasonic sensors to check the road barriers, automatic obstacle avoidance control actuator, the actuator to complete the left, right and back action. The main technology:(1)The effective application of ultrasonic sensor.(2) The use of the monitor. (3)Programmed to control the car.

 

Key words: STC89C52microcontroller, ultrasonic sensor, actuator , display


目录

中文摘要  I

Abstract  II

第一章 绪论  1

1.1选题背景及意义  1

1.1.1自动割草机器人概述  1

    1.1.2自动割草机器人优点  1

1.2割草机器人的发展简史及其研究现状  2

1.2.1发展简史  2

    1.2.2国外的研究现状  2

  1.2.3国内的研究现状  3

  1.3割草机器人自动避障系统  3

第二章 总体方案设计  5

2.1主要研究内容  5

2.2具体方案介绍  5

第三章 超声波测距  7

3.1超声波测距设计思路  7

3.1.1超声波测距原理  7

3.1.2超声波测距方法  7

3.1.3超声波模块的选择  7

3.1.4显示器的选择  8

第四章 超声波模块的硬件结构设计  9

4.1超声波模块电路设计  9

4.1.1 超声波模块的特点  9

4.1.2 超声波模块的工作原理  9

4.1.3模块参数  10


4.1.4超声波时序图  10

    4.1.5超声波发送与接收  11

4.2 STC89C52单片机功能及特点  12

4.2.1 STC89C52单片机参数  12

4.2.2 STC89C52单片机特性  13

4.3显示电路设计  15

4.3.1 1602液晶屏的优点  15

4.3.2 1602管脚定义  15

4.3.3 1602操作时序  16

第五章 超声波测距模块软件设计  18

5.1超声波测距算法设计  18

5.2主程序流程  18

5.2.1系统初始化程序  18

5.2.2超声波启动程序  19

5.2.3超声波计时程序  19

5.2.4测距程序  20

5.3实验结果  20

第六章 实验用执行机构硬件设计  22

6.1执行机构底盘  22

6.2执行机构驱动模块  22

6.2.1 L298N驱动模块说明  22

6.2.2 L298N参数  23

6.3 SG90舵机  24

6.3.1什么是舵机  24

6.3.2舵机工作原理  24

6.3.3利用单片机实现舵机转角控制  25

第七章 执行机构软件设计  26

7.1执行机构行走程序  26


7.2舵机转动控制执行机构行走程序  27

结论  30

致谢  31

参考文献  32

附录1超声波避障舵机转动编程  33

附录2 电路原理图  40


QQ截图20231219101708.png

附件1:

超声波避障舵机转动编程

#include<AT89x51.H>

#include <intrins.h>

 

#define Sevro_moto_pwm     P2_7    //接舵机信号端输入PWM信号调节速度

 

#define  ECHO  P2_4       //超声波接口定义

#define  TRIG  P2_5       //超声波接口定义

 

#define Left_moto_go      {P1_0=1,P1_1=0,P1_2=1,P1_3=0;}    //左边两个电机向前

    

#define Left_moto_back    {P1_0=0,P1_1=1,P1_2=0,P1_3=1;} //左边两个电机向后

  

#define Left_moto_Stop    {P1_0=0,P1_1=0,P1_2=0,P1_3=0;}    //左边两个电机停转                     

#define Right_moto_go     {P1_4=1,P1_5=0,P1_6=1,P1_7=0;} //右边两个电机向前

  

#define Right_moto_back   {P1_4=0,P1_5=1,P1_6=0,P1_7=1;} //右边两个电机向前

  

#define Right_moto_Stop   {P1_4=0,P1_5=0,P1_6=0,P1_7=0;} //右边两个电机停转  

 

Unsigned char const discode[] ={ 0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90,0xBF,0xff/*-*/};

unsigned char const positon[3]={ 0xfe,0xfd,0xfb};

unsigned char disbuff[4]   ={ 0,0,0,0,};

    unsigned char posit=0;

 

    unsigned char pwm_val_left  = 0;//变量定义

unsigned char push_val_left =14;//舵机归中,产生约,1.5MS 信号

    unsigned long S=0;

unsigned long S1=0;

unsigned long S2=0;

unsigned long S3=0;

unsigned long S4=0;

unsigned int  time=0;      //时间变量

unsigned int  timer=0;   //延时基准变量

unsigned char timer1=0;   //扫描时间变量    

 

   void delay(unsigned int k)   //延时函数

{    

     unsigned int x,y;

   for(x=0;x<k;x++)

     for(y=0;y<2000;y++);

}

 

#define LCD_Data P0

#define Busy    0x80 //用于检测LCD状态字中的Busy标识

 

sbit LCD_RS=P1^0;//定义引脚

sbit LCD_RW=P1^1;

sbit LCD_E=P1^2;

 

sbit RX = P2^1;  //模块引脚

sbit TX = P2^0;

 

unsigned char code net[] = {"             "};

unsigned char code qq[] = {"             "};

unsigned char code Cls[] =      {"                "};

  

unsigned int  time=0;

unsigned long S=0;

bit      flag =0;

unsigned char l_disbuff[4]    ={ 0,0,0,0,};//显示缓冲


void LCDInit(void)

{

  LCD_Data = 0;

  WriteCommandLCD(0x38,0); //三次模式设置,不检测忙信号

  Delay5Ms();

  WriteCommandLCD(0x38,0);

  Delay5Ms();

  WriteCommandLCD(0x38,0);

  Delay5Ms();

 

  WriteCommandLCD(0x38,1); //显示模式设置,开始要求每次检测忙信号

  WriteCommandLCD(0x08,1); //关闭显示

  WriteCommandLCD(0x01,1); //显示清屏

  WriteCommandLCD(0x06,1); //显示光标移动设置

  WriteCommandLCD(0x0C,1); //显示开及光标设置

}


void DisplayOneChar(unsigned char X, unsigned char Y, unsigned char DData)

{

  Y &= 0x1;

  X &= 0xF;    //限制X不能大于15,Y不能大于1

  if (Y) X |= 0x40;  //当要显示第二行时地址码+0x40;

  X |= 0x80;   //算出指令码

  WriteCommandLCD(X, 0); //这里不检测忙信号,发送地址码

  WriteDataLCD(DData);

}

 

void DisplayListChar(unsigned char X, unsigned char Y, unsigned char code *DData)

{

  unsigned char ListLength;

 

  ListLength = 0;

  Y &= 0x1;

  X &= 0xF;    //限制X不能大于15,Y不能大于1

  while (DData[ListLength]>=0x20){ //若到达字串尾则退出

     if (X <= 0xF){  //X坐标应小于0xF

       DisplayOneChar(X, Y, DData[ListLength]); //显示单个字符

       ListLength++;

       X++;

     }

   }

}

   

 void  StartModule()        //启动测距信号

   {

  TRIG=1;                   

  _nop_();

  _nop_();

  _nop_();

  _nop_();

  _nop_();

  _nop_();

  _nop_();

  _nop_();

  _nop_();

  _nop_();

  _nop_();

  _nop_();

  _nop_();

  _nop_();

  _nop_();

  _nop_();

  _nop_();

  _nop_();

  _nop_();

  _nop_();

  _nop_();

  TRIG=0;

   }

 

  void Conut(void)     //计算距离

{

  while(!ECHO);         //当RX为零时等待

  TR0=1;          //开启计数

  while(ECHO);      //当RX为1计数并等待

  TR0=0;       //关闭计数

  time=TH0*256+TL0;     //读取脉宽长度

  TH0=0;

  TL0=0;

  S=(time*1.7)/100;        //算出来是CM

  disbuff[0]=S%1000/100;   //更新显示

  disbuff[1]=S%1000%100/10;

  disbuff[2]=S%1000%10 %10;

}

 

//前速前进

     void  run(void)

{       

 Left_moto_go ;     //左电机往前走

 Right_moto_go ;    //右电机往前走

}

 

//前速后退

     void  backrun(void)

{

 Left_moto_back ;   //左电机往前走

 Right_moto_back ;  //右电机往前走

}

 

//左转

     void  leftrun(void)

{

 Left_moto_back ;   //左电机往前走

   Right_moto_go ;   //右电机往前走

}

 

//右转

     void  rightrun(void)

{

 Left_moto_go ;     //左电机往前走

 Right_moto_back ;  //右电机往前走

}

 

//STOP

     void  stoprun(void)

{

 Left_moto_Stop ;   //左电机停走

 Right_moto_Stop ;  //右电机停走

}

 

 void  COMM( void )        

  {

        

 

  push_val_left=5;   //舵机向左转90度

  timer=0;

  while(timer<=4000); //延时400MS让舵机转到其位置

  StartModule();   //启动超声波测距

          Conut();      //计算距离

  S2=S;  

  

  push_val_left=23;   //舵机向右转90度

  timer=0;

  while(timer<=4000); //延时400MS让舵机转到其位置

  StartModule();   //启动超声波测距

          Conut();     //计算距离

  S4=S;


  push_val_left=14;   //舵机归中

  timer=0;

  while(timer<=4000); //延时400MS让舵机转到其位置

 

  StartModule();   //启动超声波测距

          Conut();     //计算距离

  S1=S;

 

          if((S2<20)||(S4<20)) //只要左右各有距离小于,20CM小车后退

  {

  backrun();     //后退

  timer=0;

  while(timer<=4000);

  }

   

  if(S2>S4)   

     {

rightrun();   //车的左边比车的右边距离小 右转

        timer=0;

        while(timer<=4000);

     }          

       else

     {

       leftrun();  //车的左边比车的右边距离大 左转

       timer=0;

       while(timer<=4000);

     }

        

}

 

PWM调制电机转速                                   

 左电机调速                                        

调节push_val_left的值改变电机转速,占空比            

void pwm_Servomoto(void)

{  

 

    if(pwm_val_left<=push_val_left)

       Sevro_moto_pwm=1;

else

       Sevro_moto_pwm=0;

if(pwm_val_left>=200)

pwm_val_left=0;

 

}

 

///*TIMER1中断服务子函数产生PWM信号*/

  void time1()interrupt 3   using 2

{

     TH1=(65536-100)/256;   //100US定时

 TL1=(65536-100)%256;

 timer++;      //定时器100US为准。在这个基础上延时

 pwm_val_left++;

 pwm_Servomoto();

 

 timer1++;     //2MS扫一次数码管

 if(timer1>=20)

 {

 timer1=0;

 Display();

 }

 }

 

///*TIMER0中断服务子函数产生PWM信号*/

  void timer0()interrupt 1   using 0

{

   

 }

 

void main(void)

{

 

TMOD=0X11;

TH1=(65536-100)/256;   //100US定时

TL1=(65536-100)%256;

TH0=0;

TL0=0;  

TR1= 1;

ET1= 1;

ET0= 1;

EA = 1;

 

delay(100);

    push_val_left=14;   //舵机归中

 

while(1)         /*无限循环*/

{

 

 if(timer>=1000)   //100MS检测启动检测一次

   {

       timer=0;

   StartModule(); //启动检测

           Conut();    //计算距离

           if(S<20)    //距离小于20CM

   {

   stoprun();   //小车停止

   COMM();    //方向函数

   }

   else

   if(S>30)    //距离大于,30CM往前走

   run();

   }

 

}

}


电路原理图.png

  • 商品评价
  • 1***7
  • 交易完成超过0天未评价,默认好评
  • 2024-03-13 16:42:01
好评
  • 交易规则