Category Archives: CNC & Robotics

Computer controlled machinery.

Turning the Spindle On/Off on a Comet CNC

Comet CNC SpindleIt’s common for people to use a low-end spindle on a Probotix Comet CNC. The LinuxCNC software can turn the spindle on and off, but not control the speed or direction.

The G-code for turning a spindle on is M3,  but that command alone will not work. It needs a non-zero speed parameter. For example:

[code]
M3 S1
[/code]

will turn the spindle on. To turn it off use M5.

[code]
M3 S1
…other commands…
M5
[/code]

As always, stay safe.

 

Setting the Probotix Comet Configuration to Find Your G-Code Library

Personal notes on how to get the LinuxCNC software that comes with the Probotix Fireball Comet CNC to find your personal library of G-code files.

The Probotix Comet controller software (AXIS) by default looks for extra G-code files in /home/probotix/emc2/nc_files.

If one does not wish to store files there, one can edit the /home/probotix/configs/Comet/Comet.ini to point it to the directory of choice.

Change the  PROGRAM_PREFIX parameter to point to the directory of choice. (As always, please back up files before hacking them.)

This will allow one to, for example, load a standard preamble with the G-code:

[code]

o<preamble> call

[/code]

or otherwise allow one to create a library of useful routines.

 

Probotix Comet CNC Startup and Shutdown

These are my notes on starting and stopping the Probotix Fireball Comet CNC mill.

Danger

I’m not kidding about danger. There is one cardinal rule.

The motor control box must never have power without the AXIS control software running.

The AXIS control software (the Comet icon on the desktop) must and I repeat must be running before power is applied to the stepper motor control box, and must remain running as long as power is applied to the stepper motor control box.

Why This Is Important

The motor control box translates signals from the computer’s parallel port into motion and spindle control. The AXIS software controls the signals to the parallel port. If the motor control box is powered on before the AXIS software is running, or the AXIS software is exited before the motor control box has been powered off, then the parallel port and thus the motor control box will be thrown into an unknown, unpredictable, and uncontrolled state and the mill can start operating by itself.

Think about how dangerous this is:

  1. The spindle can start without warning and the red emergency stop button will not be operable. (I had this happen to me.)
  2. The motors can start moving  without warning and the red emergency stop button will not be operable. These motors are powerful and can crush fingers.

A powerful uncontrolled robotic cutting tool is not something to leave to chance.

Steps

Now that I’ve beat that horse to death, here are the steps to safely start up and shut down a Comet:

Start Up

  1. Start the computer
  2. Double click on the Comet program icon and leave it running.
  3. Power on the controller box.
  4. Ensure the emergency stop button on the machine is out (off). Twist the knob to reset it.
  5. Turn on the (virtual) machine power on. Push F2 or click on the orange power button icon on the top tool bar of the AXIS software.
  6. Use Home All button to put the CNC into a known state.
  7. Use the machine to make all manner of wonderful creations.

Shut Down

  1. Turn off the controller box.
  2. Exit the AXIS (Comet) program. You can use the X in the upper right-hand corner.
  3. Turn off the computer. In the top right hand corner of the screen there is a power symbol. Click on this to bring up the menu and select Shut Down….

Restarting LinuxCNC

If you ever need to restart LinuxCNC power off the stepper motor controller box first. The motor control box must never have power without LinuxCNC running. (Did you think that I was done beating that horse?)

I have had problems having LinuxCNC crash when trying to restart it. If this happens, reboot the computer. There is a power symbol in the top right corner of the screen. Click on this to bring up the menus and select Restart….

 

Adafruit Motor Shield

For some proof of concepts we bought Adafruit‘s motor shield kit.

 Assembly

The kit was easy to assembly following the instructions on the ladyada.net site. I recommend heeding the advice to use the 16-pin IC sockets and not soldering the L293D motor drivers to the board unless you’re experienced driving motors.

Use

Some of the information is scattered. For driving motors, Adafruit has a library available on github. Instructions can be found here.

Servos

Instructions for servos is sketchy. There are two servo connectors SER1 and SERVO2. According to the schematic, SER1 is connected to Arduino pin D10, and SERVO2 is connected to Arduino pin D9.

Headers

As the kit is, there is no way to stack a shield on top of the motor shield, or make easy connections for proofing. For my purposes, I added female headers to the shield using the holes parallel to the male headers. An alternative would be to use stacking headers instead of the provided male headers.

Headers added to the motor shield.

 

 

Hardware Nearly Complete

I’ve been working on a small robot on occasion to exercise some professional skills and simple personal enjoyment. The robot’s purpose is simple — point the sensor board toward the strongest light source.

I’ll post more information when I haven’t more pressing things. These are just pictures for “show and tell”.

Hardware

The hardware is pretty much complete at this point. The mechanical portion consists of four light sensors and two servos.

Mechanics and Sensors

The control board consists of a power regulator, ATmega328P microcontroller, and voltage dividers for the sensors to turn resistance into voltage. There is an optional connector for serial diagnostics. There is a connector in the far right corner for in-system programming (ISP). I’ve been doing some tutoring, and have a number of microcontrollers with stickers that document the pins names that correspond to the Arduino Uno platform.

Component Side of the Control Board

The wiring is done by hand. I use a wirewrap tool to make the initial mechanical connection for soldering. Leads for ICs &c. are typically far to short to use plain wirewrap.

Underside Showing the Wiring

Software

I’ve done proof-of-concept and diagnostic software up to this point. I’ll do testing to ensure the basic functionality is working correctly still, and work on the firmware in earnest.