• 大小: 27KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-11-29
  • 语言: 其他
  • 标签: 51单片机  

资源简介

51单片机PID控制直流电机 里面含增量式PID算法程序 12864液晶显示驱动程序

资源截图

代码片段和文件信息

/*********微机课程设计*********

课题:小型直流电机PID控制
******************************
自动化0906:张军
*******************************/

#include
#include

#define LCD P0
#define out_max 10000
#define out_min -10000

sbit EN=P2^0;
sbit RW=P2^1;
sbit RS=P2^2;
sbit CS1=P2^3;
sbit CS2=P2^4;
sbit BUSY=P0^0;

sbit PWM=P2^6;
sbit DIR=P2^7;
sbit LED0=P3^4;
sbit LED1=P3^5;
sbit LED2=P3^6;
sbit LED3=P3^7;


int KeyH=0;
int KeyL=0;
int Key=0;
int PWML=0;
int KP=100;
int KI=20;
int KD=15;
int count=0;
int Key_flag=0;
int flag=0;
int last_out=0;
int setspeed=50;
int speed=0;
int Now_speed[3]={0};


int numspeedj;   
unsigned char highhhighllowhlowl;
int high=10000;

void delay(unsigned int a);


unsigned char code table[16]= //定义16个按键S3-S18的键值
{
0xd70xeb0xdb0xbb //
0xed0xdd0xbd0xee //
0xde0xbe0x7e0x7d //
0x7b0xe70xb70x77 //
};

unsigned char code number[][6]=
{
{ 0x00 0x3E 0x51 0x49 0x45 0x3E }   // 0
{ 0x00 0x00 0x42 0x7F 0x40 0x00 }   // 1
    { 0x00 0x42 0x61 0x51 0x49 0x46 }   // 2
    { 0x00 0x21 0x41 0x45 0x4B 0x31 }   // 3
    { 0x00 0x18 0x14 0x12 0x7F 0x10 }   // 4
    { 0x00 0x27 0x45 0x45 0x45 0x39 }   // 5
    { 0x00 0x3C 0x4A 0x49 0x49 0x30 }   // 6
    { 0x00 0x01 0x71 0x09 0x05 0x03 }   // 7
    { 0x00 0x36 0x49 0x49 0x49 0x36 }   // 8
    { 0x00 0x06 0x49 0x49 0x29 0x1E }   // 9
{ 0x00 0x00 0x36 0x36 0x00 0x00 }   // :
};

//中
unsigned char code zhong[]={0x000x7C0x440x440x440xFF0x440x440x440x7C0x000x000x000x000x000x000x000x070x000x000x000x000x000x00};
//南
unsigned char code nan[]={0x020xFA0x0A0x5A0x6A0xCF0x6A0x5A0x0A0xFA0x020x000x000x070x000x010x010x070x010x050x040x070x000x00};
//大
unsigned char code da[]={0x080x080x080x080xC80x3F0xC80x080x080x0C0x080x000x040x040x020x010x000x000x000x010x020x040x040x00};
//学
unsigned char code xue[]={0x9C0x840x950x960x950xD60xB40x940x870x940x8C0x000x000x000x000x040x040x070x000x000x000x000x000x00};
//课
unsigned char code ke[]={0x110xF60x000x400x5F0x550xD50xFF0x550x5F0x400x000x000x030x050x040x020x010x000x070x010x020x040x00};
//程
unsigned char code cheng[]={0x8A0x6A0xFF0x490x200xAF0xA90xE90xA90xAF0x200x000x010x000x070x000x040x040x040x070x040x040x040x00};
//设
unsigned char code she[]={0x100x110xF20x200x100x6F0xA10x210xAF0x680x080x000x000x000x030x050x040x040x020x010x020x040x040x00};
//计
unsigned char code ji1[]={0x100xF10x020x000x100x100x100xFF0x100x100x100x000x000x070x020x010x000x000x000x070x000x000x000x00};
//题
unsigned char code ti[]={0x400xDF0x550xD50x5F0x410x7D0x070xF50x050x7D0x000x060x010x020x030x050x050x060x050x040x050x060x00};
//直
unsigned char code zhi1[]={0x020x020xFA0x4A0x4A0x4F0x4A0x4A0xFA0x020x020x0

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件      121605  2011-12-20 23:46  课程设计.DSN
     文件        1990  2011-12-20 20:30  课程设计.Uv2
     文件       18259  2011-12-23 19:19  2.c

评论

共有 条评论