Tag Archives: controller

Dividing Head Controller

This post ist about the CNC conversion of a manual dividing head aka indexing head. If you’re not familiar with that kind of equipment, there’s a wiki page here.  One makes use of interchangeable indexing plates and and the internal worm gear to accurately divide the circle. Parts like cogwheels and the like can be machined this way. A video of the finished project can be found here on my youtube cannel.

The downside is that a high level of concentration is required to not mess things up. Often a single distraction is all it takes to ruin a part. Besides the fact that constantly changing indexing plates can get tedious. So I decided to mount a stepper motor to that indexing head and to design a controller to take care of that motor.

There are many affordable and well-designed stepper motor drivers out there so I decided to use one of those rather than building my own. So an external driver takes care of translating the 5 volts logic step / direction signals into the (typically 12, 24 or 48V) power signals required to drive the stepper motor. What this circuit does is to provide a user interface and to generate that step / direction signal.

I decided to use this motor driver from Planet CNC that comes with a 2×5 pins 100-mil header for the logic signals. So I also put such a connector with a corresponding pin-out on my board. Then a single ribbon cable (provided with the motor driver) is all it takes to hook up the driver.

The user interface consists of a 4×20 character LCD display and two rotary encoders with push buttons. The display is a Midas MCCOG42005A6W that I have used in several of my other projects before. It is very compact and comes with an I2C interface which saves quite a few pins on the microcontroller. There is also a buzzer to provide some acoustic feedback on button presses and the like. If it enoys you, you can always turn it off in software.

As in all my designs, the rotary encoder signals are nicely debounced in hardware as described here.

The board runs on a 24V supply that is also used to drive the motor. The microcontroller, a Microchip PIC1826J50, runs on 3.3 volts. Furthermore, the motor controller requires a separate 5V supply to power its logic. So I first designed a switching converter that generates a 5V output from any input voltage in the range of 6 to 30 volts. A linear regulator then produces 3.3 volts out of that 5V rail to power the PIC and other on-board logic. Unfortunately, a bug as creeped into my PCB layout – hence that fix with a piece of wire just below the coil.

With the PIC running on 3.3 volts and the motor driver at 5 volts, I also had to provide some logic-level conversion.  A 74AHCT125 line driver / buffer and a few resistors take care of that.

The PIC also comes with a USB interface so that the board could be controlled remotely from a PC. All the hardware for that is present on the board but I haven’t written any software for that yet. Most of that can be copy-pasted from other projects such as the solar charger but I simply haven’t done any of that yet.

Finally, there is a temperature sensor and a fan output on the board. I’m not currently using it but if there is need for a fan for the motor driver and/or the power supply, you can connect a fan directly to this board and have it temperature controlled. For the fan output, the buzzer and the display backlight are driven by a TPL7407L that already includes the free-wheeling diodes necessary to drive inductive loads such as a fan.

I’ve mounted all the power supply, the motor driver as well as this board in a nice, compact case that I bought at a flea market earlier this year.

Nice, solid ground connections are provided to all relevant components. The USB connector is accessible from the back through an extension cable.

The other USB connector belongs to the motor driver and is used for configuration.

Finally, the two knobs for the rotary encoders were turned out of aluminum at the lathe.

The rest of it is mainly mechanics. This may seem somewhat off-topic on this blog but expect to see more of it in the future 😉

Here are the parts required for the mechanical part of the CNC conversion. With the exception of the two cog wheels for the timing belt, they are all machined out of aluminum on a manual mill.

First, a spacer is mounted using three existing, M5 threaded holes.

The main body is then screwed onto this spacer and the cogwheel is mounted.

The hub of the cogwheel was turned out of steel and then press fitted to the aluminum cogwheel. This provides for a firm, true-running.

Then the motor with the 22 tooth sprocket can then be mounted together with the 15mm HTD-5M timing belt. Together with the 44 teeth cogwheel on the other end, this provides a 2:1 geering. The dividing head’s internal worm drive adds another factor of 90:1.

Since the motor, a Sanyo Denki 103 H7823 1740, has a resolution of 200 steps per revolution, this translates to a very convenient 0.01 degrees per full step.

Now all that is left to do is to fix the cover plate. As usual, all the relevant files are on github: