基于单片机控制的数控X-Y工作台系统设计——插补部分摘要本设计研究的课题主要是基于单片机控制的数控X-Y工作台系统设计—插补部分设计。在系统程序设计上运用逐点比较法使步进电机实现单坐标定位、两坐标直线插补和圆弧插补的基本功能;在此功能基础上通过建立象限判别程序,使X-Y工作台达到四象限的工作要求;并编写了代码处理指令,使CPU能够根据读入的指令信息(G代码与X轴和Y轴坐标),分别向X轴和Y轴步进电机输出执行指令所需的控制信号,从而完成指定的工序。该设计选用KeilμVision2软件进行程序的编译和调试,在Proteus环境下实现进一步的调试并仿真得出程序的运行结果。此次设计的程序均能在Proteus中的控制系统仿真电路图中仿真通过,仿真时,只需从键盘输入G代码后,步进电机就能通过直线插补和圆弧插补,完成平面轮廓加工。关键字:插补数控X-Y工作台步进电机单片机DesignofX-YNCWorktableBasedonMicrocontroller——InterpolationpartABSTRACTThesubjectofthisdesignstudyismainlybasedonMCUcontrolsystemdesignforCNCXYtable-interpolationpartofthedesign.Proceduresusedinthesystemdesignbypointbypointcomparisonthensingle-coordinatepositioning,linearinterpolationofthetwocoordinates,circularInterpolationofthetwocoordinatesbyusethesteppermotor;onthebasisofthis,establishquadrantidentificationproceduressothatXYtablecanworkinfourquadrants;andwritethecodehandler,soCPUaccordingtotheinformationwhichhavebeenread(GcodeandtheX-axisandY-axiscoordinates),outputsignalstotwosteppermotorseparatelyforcontrolthetablehowtomoveonX-axisandY-axistofinishthespecifiedprocess.ThedesignofthesoftwareprogramsusedKeilμVision2compileanddebug,debuggingattheProteusandgettheresultsofsimulation.theresultsofthedesignoftheprograminthesimulationbyProteusiswonderful,whensimulationtheprogram,justneedinputGcodebythekeyboard,steppermotorcancontrolthetablethroughlinearinterpolationandcircularinterpolationtofinishplanecontourmachining.Keywords:InterpolationX-YNCWorktableSteppingMotorMicrocontroller目录摘要...........................................................................................................IABSTRACT..............................................................................................II前言............................................................................................................11X-Y数控工作台设计简介..................................................................21.1X-Y数控工作台总体方案分析................................................................21.2仿真开发环境Proteus简介......................................................................21.3程序开发环境KeilμVision2简介.............................................................22X-Y数控工作台机械部件功能分析..................................................42.1步进电动机的工作原理............................................................................42.2步进电动机的工作方式............................................................................43X-Y数控工作台硬件电路分析..........................................................63.1控制系统微控制器AT89C52...................................................................63.1.1AT89C52单片机的主要工作特性.........................................................63.1.2AT89C52单片机的内部结构.................................................................63.1.3AT89C52单片机的各引脚功能...........................................................153.2可编程并行接口芯片8255A............................................