欢迎来到装配图网! | 帮助中心 装配图网zhuangpeitu.com!
装配图网
ImageVerifierCode 换一换
首页 装配图网 > 资源分类 > DOCX文档下载
 

机床数控技术课程设计说明书

  • 资源ID:103851387       资源大小:613.81KB        全文页数:32页
  • 资源格式: DOCX        下载积分:16积分
快捷下载 游客一键下载
会员登录下载
微信登录下载
三方登录下载: 微信开放平台登录 支付宝登录   QQ登录   微博登录  
二维码
微信扫一扫登录
下载资源需要16积分
邮箱/手机:
温馨提示:
用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)
支付方式: 支付宝    微信支付   
验证码:   换一换

 
账号:
密码:
验证码:   换一换
  忘记密码?
    
友情提示
2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

机床数控技术课程设计说明书

机床数控技术课程设计说明书指导老师: 姓名: 班级:学号:2014/01/10目录一 课设任务1二 课设要求1三 编程语言1四 变量说明及程序界面1(一)DDA第四象限直线插补变量说明1(二)逐点比较法第12象限逆圆弧插补变量说明2(三)DDA第四象限直线插补程序界面3(1)普通DDA.3(2)全加载3(3)半加载.4(四)逐点比较法第12象限逆圆弧插补程序界面4五 详细程序设计流程图.5(一)DDA第四象限直线插补流程图.5(二)逐点比较法第12象限逆圆弧插补流程图.6六 源程序6七 参考资料32一 课设任务(1)DDA法插补第四象限直线;(2)逐点比较法插补第12象限顺圆弧。二 课设要求(1)具有数据输入界面,如起点、终点、圆心、半径及插补步长等;(2)具有插补过程的动态显示功能,如单步插补、连续插补;(3)插补的步长可调;三 编程语言:MATLAB四 变量说明及程序界面(一)DDA第四象限直线插补变量名称说明变量名称说明X1直线起点横坐标JvxX被积函数寄存器Y1直线起点纵坐标Jrx1X普通DDA积分累加器X2直线终点横坐标Jrx2X全加载积分累加器Y2直线终点纵坐标Jrx3X半加载积分累加器x绘图动点横坐标JvyY被积函数寄存器y绘图动点纵坐标Jry1Y普通DDA积分累加器L插补步长Jry2Y全加载积分累加器N寄存器位数Jry3Y半加载积分累加器MxX终点判别计数器X插补动点横坐标MyY终点判别计数器Y插补动点纵坐标(二)逐点比较法第21象限顺圆弧插补变量名称说明变量名称说明X1圆弧起点横坐标E终点判别计数器Y1圆弧起点纵坐标F偏差判别x绘图动点横坐标X插补动点横坐标y绘图动点纵坐标Y插补动点纵坐标r圆弧半径MxX插补步数X2圆弧终点横坐标MyY插补步数Y2圆弧终点纵坐标L插补步长A圆心到弦中点的距离a1圆弧起点角坐标x0圆心横坐标a2圆弧终点角坐标y0圆心纵坐标a绘图动点角坐标 程序界面:(三)DDA第四象限直线插补(1)普通DDA(2)全加载(3) 半加载(四)逐点比较第12象限逆圆弧插补五 详细程序设计流程图(一) DDA第四象限直线插补(二) 逐点比较法第12象限逆圆弧插补六 源程序function varargout = f2(varargin)% F2, by itself, creates a new F2 or raises the existing% singleton*.% H = F2 returns the handle to a new F2 or the handle to% the existing singleton*.% F2('CALLBACK',hObject,eventData,handles,.) calls the local% function named CALLBACK in F2.M with the given input arguments.% F2('Property','Value',.) creates a new F2 or raises the% existing singleton*. Starting from the left, property value pairs are% applied to the GUI before f2_OpeningFcn gets called. An% unrecognized property name or invalid value makes property application% stop. All inputs are passed to f2_OpeningFcn via varargin.% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one% instance to run (singleton)".% See also: GUIDE, GUIDATA, GUIHANDLES% Edit the above text to modify the response to help f2% Last Modified by GUIDE v2.5 09-Jan-2014 10:52:17% Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct('gui_Name', mfilename, . 'gui_Singleton', gui_Singleton, . 'gui_OpeningFcn', f2_OpeningFcn, . 'gui_OutputFcn', f2_OutputFcn, . 'gui_LayoutFcn', , . 'gui_Callback', );if nargin && ischar(varargin1) gui_State.gui_Callback = str2func(varargin1);endif nargout varargout1:nargout = gui_mainfcn(gui_State, varargin:);else gui_mainfcn(gui_State, varargin:);end% End initialization code - DO NOT EDIT% - Executes just before f2 is made visible.function f2_OpeningFcn(hObject, eventdata, handles, varargin)% This function has no output args, see OutputFcn.% hObject handle to figure% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% varargin command line arguments to f2 (see VARARGIN)% Choose default command line output for f2handles.output = hObject;% Update handles structureguidata(hObject, handles);% UIWAIT makes f2 wait for user response (see UIRESUME)% uiwait(handles.figure1);% - Outputs from this function are returned to the command line.function varargout = f2_OutputFcn(hObject, eventdata, handles)% varargout cell array for returning output args (see VARARGOUT);% hObject handle to figure% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Get default command line output from handles structurevarargout1 = handles.output;% - Executes on button press in pushbutton1.function pushbutton1_Callback(hObject, eventdata, handles) %绘制直线global x1 y1 x2 y2 L N x y Mx My Jvx Jrx1 Jrx2 Jrx3 Jvy Jry1 Jry2 Jry3 X Y;x1=str2double(get(handles.edit1,'string');y1=str2double(get(handles.edit2,'string');x2=str2double(get(handles.edit3,'string');y2=str2double(get(handles.edit4,'string');L=str2double(get(handles.edit7,'string');N=str2double(get(handles.edit6,'string');if x1<=0|y1>=0|x2<=0|y2>=0 set(handles.text11,'string','直线不在第四象限!');%判断直线是否在第四象限else if x1=x2 y=y1:(y2-y1)/100:y2; x=y.*0+x1; plot(x,y,'k'); hold on; else x=x1:(x2-x1)/100:x2; plot(x,y,'k'); hold on; end xmin=min(x); xmax=max(x); ymin=min(y); ymax=max(y); axis equal; axis(xmin-L xmax+L ymin-L ymax+L); %定义坐标轴的边界 set(handles.text11,'string','绘图完成'); Mx=ceil(abs(x2-x1)/L); %计算插补步数 My=ceil(abs(y2-y1)/L); Jvx=abs(x2-x1); %给寄存器赋值 Jrx2=2N-1; Jrx3=2(N-1); Jvy=abs(y2-y1); Jry1=0; Jry2=2N-1; Jry3=2(N-1); X=x1; Y=y1;end% hObject handle to pushbutton1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)function edit1_Callback(hObject, eventdata, handles)% hObject handle to edit1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: get(hObject,'String') returns contents of edit1 as text% str2double(get(hObject,'String') returns contents of edit1 as a double% - Executes during object creation, after setting all properties.function edit1_CreateFcn(hObject, eventdata, handles)% hObject handle to edit1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor') set(hObject,'BackgroundColor','white');endfunction edit2_Callback(hObject, eventdata, handles)% hObject handle to edit2 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: get(hObject,'String') returns contents of edit2 as text% str2double(get(hObject,'String') returns contents of edit2 as a double% - Executes during object creation, after setting all properties.function edit2_CreateFcn(hObject, eventdata, handles)% hObject handle to edit2 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor') set(hObject,'BackgroundColor','white');endfunction edit3_Callback(hObject, eventdata, handles)% hObject handle to edit3 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: get(hObject,'String') returns contents of edit3 as text% str2double(get(hObject,'String') returns contents of edit3 as a double% - Executes during object creation, after setting all properties.function edit3_CreateFcn(hObject, eventdata, handles)% hObject handle to edit3 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor') set(hObject,'BackgroundColor','white');endfunction edit4_Callback(hObject, eventdata, handles)% hObject handle to edit4 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: get(hObject,'String') returns contents of edit4 as text% str2double(get(hObject,'String') returns contents of edit4 as a double% - Executes during object creation, after setting all properties.function edit4_CreateFcn(hObject, eventdata, handles)% hObject handle to edit4 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor') set(hObject,'BackgroundColor','white');endfunction edit5_Callback(hObject, eventdata, handles)% hObject handle to edit5 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: get(hObject,'String') returns contents of edit5 as text% str2double(get(hObject,'String') returns contents of edit5 as a double% - Executes during object creation, after setting all properties.function edit5_CreateFcn(hObject, eventdata, handles)% hObject handle to edit5 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor') set(hObject,'BackgroundColor','white');endfunction edit6_Callback(hObject, eventdata, handles)% hObject handle to edit6 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: get(hObject,'String') returns contents of edit6 as text% str2double(get(hObject,'String') returns contents of edit6 as a double% - Executes during object creation, after setting all properties.function edit6_CreateFcn(hObject, eventdata, handles)% hObject handle to edit6 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor') set(hObject,'BackgroundColor','white');endfunction edit7_Callback(hObject, eventdata, handles)% hObject handle to edit7 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: get(hObject,'String') returns contents of edit7 as text% str2double(get(hObject,'String') returns contents of edit7 as a double% - Executes during object creation, after setting all properties.function edit7_CreateFcn(hObject, eventdata, handles)% hObject handle to edit7 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor') set(hObject,'BackgroundColor','white');end% - Executes on button press in pushbutton2.function pushbutton2_Callback(hObject, eventdata, handles) %直线单步插补% hObject handle to pushbutton2 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)global x1 y1 x2 y2 L N x y Mx My Jvx Jrx1 Jrx2 Jrx3 Jvy Jry1 Jry2 Jry3 X Y;if (get(handles.radiobutton1,'Value')=0). &(get(handles.radiobutton2,'Value')=0). &(get(handles.radiobutton3,'Value')=0) set(handles.text11,'string','请选择插补方式');else if (Mx<=0)&(My<=0) set(handles.text11,'string','插补结束'); else Jrx1=Jvx+Jrx1; Jry1=Jvy+Jry1; Jrx2=Jvx+Jrx2; Jry2=Jvy+Jry2; Jrx3=Jvx+Jrx3; Jry3=Jvy+Jry3; if get(handles.radiobutton1,'Value')=1 %普通DDA if (x1<=x2)&(y1<=y2) %转化后直线在第一象限 if (Jrx1>=2N) Jrx1=Jrx1-2N; X=X+L; x=linspace(X-L,X,100); Mx=Mx-1; else x=zeros(1,100)+X; end if (Jry1>=2N) Jry1=Jry1-2N; y=linspace(Y-L,Y,100); My=My-1; else y=zeros(1,100)+Y; end plot(x,y,'r'); hold on; elseif (x1>x2)&(y1<=y2) %转化后直线在第二象限 if (Jrx1>=2N) Jrx1=Jrx1-2N; X=X-L; x=linspace(X+L,X,100); Mx=Mx-1; else x=zeros(1,100)+X; end if (Jry1>=2N) Jry1=Jry1-2N; Y=Y+L; y=linspace(Y-L,Y,100); My=My-1; else y=zeros(1,100)+Y; end plot(x,y,'r'); hold on; elseif (x1>x2)&(y1>y2) %转化后直线在第三象限 if (Jrx1>=2N) Jrx1=Jrx1-2N; X=X-L; x=linspace(X+L,X,100); Mx=Mx-1; else x=zeros(1,100)+X; end if (Jry1>=2N) Jry1=Jry1-2N; Y=Y-L; y=linspace(Y+L,Y,100); My=My-1; y=zeros(1,100)+Y; end plot(x,y,'r'); hold on; else %转化后直线在第四象限 if (Jrx1>=2N) Jrx1=Jrx1-2N; X=X+L; x=linspace(X-L,X,100); Mx=Mx-1; else x=zeros(1,100)+X; end if (Jry1>=2N) Jry1=Jry1-2N; Y=Y-L; y=linspace(Y+L,Y,100); My=My-1; else y=zeros(1,100)+Y; end plot(x,y,'r'); hold on; end elseif get(handles.radiobutton2,'Value')=1 %全加载 if (x1<=x2)&(y1<=y2) if (Jrx2>=2N) Jrx2=Jrx2-2N; X=X+L; x=linspace(X-L,X,100); Mx=Mx-1; else x=zeros(1,100)+X; end if (Jry2>=2N) Jry2=Jry2-2N; Y=Y+L; y=linspace(Y-L,Y,100); My=My-1; else y=zeros(1,100)+Y; end plot(x,y,'r'); hold on; elseif (x1>x2)&(y1<=y2) if (Jrx2>=2N) Jrx2=Jrx2-2N; X=X-L; x=linspace(X+L,X,100); Mx=Mx-1; else x=zeros(1,100)+X; end if (Jry2>=2N) Jry2=Jry2-2N; Y=Y+L; y=linspace(Y-L,Y,100); My=My-1; else y=zeros(1,100)+Y; end plot(x,y,'r'); hold on; elseif (x1>x2)&(y1>y2) if (Jrx2>=2N) Jrx2=Jrx2-2N; X=X-L; x=linspace(X+L,X,100); Mx=Mx-1; else x=zeros(1,100)+X; end if (Jry2>=2N) Jry2=Jry2-2N; Y=Y-L; y=linspace(Y+L,Y,100); My=My-1; else y=zeros(1,100)+Y; end plot(x,y,'r'); hold on; else if (Jrx2>=2N) Jrx2=Jrx2-2N; X=X+L; x=linspace(X-L,X,100); Mx=Mx-1; else x=zeros(1,100)+X; end if (Jry2>=2N) Jry2=Jry2-2N; Y=Y-L; y=linspace(Y+L,Y,100); My=My-1; else y=zeros(1,100)+Y; end plot(x,y,'r'); hold on; end else %半加载 if (x1<=x2)&(y1<=y2) if (Jrx3>=2N) Jrx3=Jrx3-2N; X=X+L; x=linspace(X-L,X,100); Mx=Mx-1; else x=zeros(1,100)+X; end if (Jry3>=2N) Jry3=Jry3-2N; Y=Y+L; y=linspace(Y-L,Y,100); My=My-1; else y=zeros(1,100)+Y; end plot(x,y,'r'); hold on; elseif (x1>x2)&(y1<=y2) if (Jrx3>=2N) Jrx3=Jrx3-2N; X=X-L; x=linspace(X+L,X,100); Mx=Mx-1; else x=zeros(1,100)+X; end if (Jry3>=2N) Jry3=Jry3-2N; Y=Y+L; y=linspace(Y-L,Y,100); My=My-1; else y=zeros(1,100)+Y; end plot(x,y,'r'); hold on; elseif (x1>x2)&(y1>y2) if (Jrx3>=2N) Jrx3=Jrx3-2N; X=X-L; x=linspace(X+L,X,100); Mx=Mx-1; else x=zeros(1,100)+X; end if (Jry3>=2N) Jry3=Jry3-2N; Y=Y-L; y=linspace(Y+L,Y,100); My=My-1; else y=zeros(1,100)+Y; end plot(x,y,'r'); hold on; else if (Jrx3>=2N) Jrx3=Jrx3-2N; X=X+L; x=linspace(X-L,X,100);

注意事项

本文(机床数控技术课程设计说明书)为本站会员(ra****d)主动上传,装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知装配图网(点击联系客服),我们立即给予删除!

温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!