Presentation is loading. Please wait.

Presentation is loading. Please wait.

Semester Project Introduction Computer control of a cutting machine 1. Given a data file description of desired 2-D parts 2. Create software tools to:

Similar presentations


Presentation on theme: "Semester Project Introduction Computer control of a cutting machine 1. Given a data file description of desired 2-D parts 2. Create software tools to:"— Presentation transcript:

1 Semester Project Introduction Computer control of a cutting machine 1. Given a data file description of desired 2-D parts 2. Create software tools to: a. Compute the characteristics of the parts (area, perimeter, centroid locations) b. Solve for the cutter route (simplest to most efficient) c. Graphically display results

2 Example Data format: –Polygonal parts –List of vertices –(0,0) as the separator Data file: 1.00 1.00 3.00 1.00 3.50 2.75 1.50 2.75 0 0 1.50 3.25 2.00 3.25 1.75 5.00 0 0 4.00 3.25 5.50 3.25 3.50 5.00 5.75 5.00 x Desired cut pattern y

3 Polygon areas can be determined by adding up trapezoid areas

4 Trapezoid centroid, y (A1 + A2)y = A1 y1 + A2 y2 where y is the y coordinate of the centroid of the trapezoid

5 Fill in this part before the meeting Leave this part blank Project Status Report Form

6 Text handle Handles are labels that allow items to be addressed. Here the text at the coordinates x,y is given the handle htext(x,y). htext is an array that includes handles of text at other locations. Properties of the text are easily changed using its handle. get(h) returns all properties of the graphics object identified by the handle h and their current values. get(h,'PropertyName') returns the value of the property 'PropertyName' of the graphics object identified by h.

7 Erase text Here the text handle is used to modify the text property ‘string’, which is the actual text message. The text is replaced with the string ns(1) which is a blank. The result is that the text is erased. Since the text is erased the board has to be updated with a zero in the appropriate location. The row is 10-y so that the first row is at the top of the board in the plot at the coordinate x=9.

8 % Handles x=linspace(0,10); % Set up x y=x.^2; % Calculate y h =plot(x,y); hold on % Next put a marker at the origin. blobhandle = plot(0,0,'o','markersize',10,'markerfacecolor','k'); for k2 = 1:length(x) % Move marker along line set(blobhandle,'Xdata',x(k2),'Ydata',y(k2)) pause(.05) end

9 Structured Programming Hierarchical Modules are divided into smaller and smaller submodules (functions work well as modules) functions contain functions Modular Simple independent modules with well defined inputs and outputs Locality Minimize inputs and outputs Generate values inside the module where possible


Download ppt "Semester Project Introduction Computer control of a cutting machine 1. Given a data file description of desired 2-D parts 2. Create software tools to:"

Similar presentations


Ads by Google