Research

From SeniorDesign

Jump to: navigation, search

Contents

[edit] General Info

  • This looks like a good site to search for parts Globalspec

[edit] 3D Object Files

This section was written by Paul Vincent.

I am a member of a local hackerspace, Hive13. One of the members, Jim, is a mechanical engineer who works for Cincinnati Milicron, he has experience working with CNC routers and has built his own CNC router. I interviewed him to learn about the process of moving a project from just an idea into a CNC router cut object.

  1. Jim uses a 2D drawing application to first draw out each part in his final assembly. The drawings that he will send to the router are layered 2D top down drawings. Each layer represents a different feature of the object.
  2. Save the drawings as .dxf files.
  3. Open them in a proprietary program called CamBam. CamBam will be used to define the router properties for each layer (cut depth, cutter speed, cut inside or outside the line, do a profile or pocket cut) and then will render the DXF file into G-Code.
  4. The rendered G-Code file is then opened in a freeware program called Mach 3 which sends step and direction commands to the stepper motor controller boards. This is different from our design which will utilize a microcontroller to send the step and direction commands. This design decision was made because without it you need to use proprietary "real-time" libraries on windows and on Linux you must compile the "real-time" libraries into the kernel.

So our software will need to consist of two parts, a DXF -> G-Code converter program that allows the user to define CNC Router parameters on a "Per Layer" basis and a CNC Router communication program that parses the G-Code file and sends commands to the router.

[edit] Communication Protocol

The computer and CNC Router will be talking to each other over a serial link. Paul and Jeremy met on 1/22/10 and hammered out how the serial communication will work.

The selected microcontroller for our project the Arduino Mega has built in support for Serial communication over USB.

Some important decisions that came from the meeting

  • All communications must have a timeout counter
  • All communications must be acknowledged by the recipient.
  • All communications should be error checked and error // not error should be returned in the acknowledgment of the command.
    • Error checking will be done through parity checks on each byte and on the message as a whole.

Converting a 16 bit number into 3 bytes:

  • 16 bit numbers are being represented by two bytes.
    • [Byte1] [Byte2]
  • We need to convert this into three bytes.
    • [NewByte1] [NewByte2] [NewByte3]
  • This will be done in the following method.
    1. NewByte1 = (Byte1 & 254)
    2. NewByte2 = (Byte2 & 254)
    3. NewByte3 = ((Byte1 & 1) << 2) | ((Byte2 & 1) << 1)
    4. Parity bits can now be calculated and filled in.
  • To reverse this conversion.
    1. Byte1 = NewByte1 & 254
    2. Byte1 |= (NewByte3 & 4) >> 2
    3. Byte2 = NewByte2 & 254
    4. Byte2 |= (NewByte3 & 2) >> 1

Current Communication Messages

  • P stands for a parity bit. [Parity] is an end of message parity byte.
  • Ping
    • Computer to Router
    • "Are you there?"
    • Structure: [Type 000P] [Parity]
      • Type: 0
  • CommandAcknowledge
    • Computer to Router
    • Router to Computer
    • This communication message is sent in response to the receipt of a command.
    • This message will report on the error status of the command it is in response too.
    • When responding to a "Ping" this command will contain the CNC Router's firmware version to ensure compatibility.
    • Structure: [Type 00 Err P] [Firmware P] [Parity]
      • Type: 1
      • Err: 0 or 1
      • Firmware: 0 to 127 (top 7 bits)
  • E-Stop
    • Computer to Router
    • Router to Computer
    • Something has triggered an emergency stop, this signal overrides all other commands and forces the router to stop moving and the computer to stop sending commands.
    • Structure: [Type 000P] [Parity]
      • Type: 2
  • RequestCommands
    • Router to Computer
    • # of commands for computer to send to router.
    • Structure: [Type 000P] [#Cmds P] [Parity]
      • Type: 3
      • #Cmds: 0 to 127 (top 7 bits)
  • StartQueue
    • Computer to Router
    • Tells the router to begin processing its queue of instructions.
    • Structure: [Type 00 EndQueueBit P] [Parity]
      • Type: 4
      • EndQueueBit: 0/1, if set to 1 the build queue is finished.
  • SetSpeed
    • Computer to Router
    • Set the speed that the router moves between X,Y,Z points
    • Structure: [Type XYZ P] [Upper7_Byte1 P] [Upper7_Byte2 P] [0000 0 BotBit_Byte1 BotBit_Byte2 P] [Parity]
      • Type: 5
      • XYZ: 110 means we are setting the speed for the X and Y axis but not the Z axis.
      • Speed: 16 bit unsigned integer. Split into 3 bytes with due to parity. See method for splitting 16 bit message into 3 bytes.
  • Move
    • Computer to Router
    • X, Y, Z point to move too.
    • Structure: [Type 000P] [UpperX P] [LowerX P] [~ X_botBits P] (repeat X for Y and Z) [Parity]
      • Type: 6
      • [UpperX P] [LowerX P] [~ X_botBits P]: A 16bit signed integer giving us a range of -32,767 to 32,768 - Split up using the method forr converting a 16 bit number into 3 bytes with parity described above.
      • [UpperY P] [LowerY P] [~ Y_botBits P]: A 16bit signed integer giving us a range of -32,767 to 32,768
      • [UpperZ P] [LowerZ P] [~ Z_botBits P]: A 16bit signed integer giving us a range of -32,767 to 32,768
  • ToolCommand
    • Computer to Router
    • Command for the CNC Router's tool, in our case, turn tool on or turn tool off.
    • Structure: [Type 00 OnOff P] [Parity]
      • Type: 7
      • OnOff: 1 for on, 0 for off.

[edit] Micro-Controllers

The microcontroller that we will use will be the Atmel ATmega328. This controller has been used on the Arduino MEGA prototyping boards which is what we will be using to control the CNC router and to act as the interface between the computer and the hardware.

[edit] Cutting Tools

A router is the tool of choice. Rotary tools such as Dremels are not designed for the stress that a CNC machine would put on them. Cheap replaceable hand-held routers along with bits can be purchased at Harbor Freight.

[edit] Stepper Motors

[edit] Rotary Encoders

An expensive accurate sensor is out of the budget. There are a few cheap alternatives. The first being a gray-code 2 bit sensor. It would provide enough information to determine if the drives were moving, but not so much on the exact distance. Another option, that would require more engineering, is utilizing 2 optical gates and a disc with accurately machined holes.

[edit] Limit Switch Options

[edit] Optical Safety Sensors

This was determined to be unnecessary and out of budget. The machine will not be able to do much harm to a person, such as decapitation or death. There will be an emergency-stop button encase of emergency.

[edit] 3D Scanners

  • As with the optical safety sensors this do is out of budget and could only be completed via donation from the sensor manufacture.
  • I looked through sicks website for scanners/distance sensors we could use. The original idea I had was to have a bar scanner like in a printer that would sweep over the object. I did not find anything that does this on sicks website. The solution that I think would work best would to use there point distance scanner that has a 100 degree sweep, have the sensor sweep from side to side as we run it from front to back.Sick LMS400-1000
Personal tools