Skip to the content
2 layers69 × 29 mm3020-cnc upgrade, the printed circuit board in 3D

PCB / code to make the PWM spindle control of a 3020 CNC machine work correctly

Size
69 × 29 mm
Copper layers
2
Thickness
1.6 mm
Parts
15
Nets
37
Pads
100
Tracks, vias
73, 0
Pours
2
Routed
Yes
KiCad
KiCad 4
Created
18 Feb 2020
Updated
27 Mar 2018

Overview

3020-cnc upgrade is an open-source printed circuit board by micromouseonline, from the micromouseonline/3020-software-spindle-control repository on GitHub. It is a 2-layer board of 69 × 29 mm with 15 parts on 37 nets, routed with 73 tracks and 0 vias.

It is built around the MCP41010-E/P. Its parts include 5 connectors, 3 ICs, 2 resistors and 1 diode. It belongs with the robots and motor control boards and the AVR (ATmega, ATtiny) boards of this library.

Main components

1

README

README.md

3020 SOFTWARE SPINDLE CONTROL

Thanks to Johnny from hackaday.io for his fantastic work reverse-engineering the JP-1481 spindle board, seen below:

JP-1482 Schematic

Problem

You cannot control the spindle speed by any means other than the front panel knob.

This is particularly important in an emergency stop situation. While your controller will the stepper movement, the spindle will continue to spin.

The main interface (JP-382C) board routes pin 17 of the parallel port directly to the (unpopulated) "PWM OUT" connector on that board.

The JP-1482 (spindle control) board has a PWM input, but the firmware on the STC15W408AS (the MCU that ultimately controls spindle speed) does not respond to that input.

Solution

The solution is to use another MCU that reads from the existing front-panel knob, and the PWM from the interface board, that then simulates the front panel knob (using a programmable potentiometer).

The goal is to have a board you can simply plug in, and it just works.™

Implementation

For the sake of ease, and getting up-and-running quickly, I opted to use an Arduino Pro Micro (5V), which I happened to have on hand.

The input PWM is buffered through a 6N136 opto isolator (since the PWM power supply is floating), and fed directly into the Arudino.

For output, there is an MCP41010 digital potentiometer, controlled via SPI. Since the front panel pot is 5K, we're only going to use ½ of it's 10K range.

Power (5v) is provided by the PWM board.

The software is standard Arduino code, though I'm using PlatformIO CLI since I'm not a big fan the Arduino IDE. Why not bare metal AVR? This isn't a demanding application, and while the Arduino ecosystem isn't the most efficient, it does make it quick and easy to get things up-and-running.

Construction

Schematic

Schematic

BOM
RefP/N
P1B2B-XH-A(LF)(SN)
P2, P4B3B-XH-A(LF)(SN)
P3B8B-XH-A(LF)(SN)
R1Any 0802 330 ohm SMT resistor
R2Any 0802 2200 ohm SMT resistor
D11N4148 (optional)
U16N136, 8 DIP
U2Arduino Pro Micro (Ebay clone)
U3MCP41010, 8 DIP

The connectors on the board are compatible with the connectors on the JP-1482; they're the JST XH series. Be careful buying random "XH" connectors from Ebay or even Amazon, for two reasons:

  1. The connectors are often 2.54mm pitch, instead of 2.50mm (XH is 2.50mm). This will mostly work, but for the 8-pin connector, you're going to bend the pins of your board connector by doing this.
  2. Make sure the cables you use are the "straight through" type -- pin 1 on one end goes to pin 1 on the other end.

Buy genuine XH connectors and cables from a reputable supplier (e.g. Digi-key).

The board layout is rather tight. It's designed to have U1 and U3 soldered directly to the board, while U2 is in a socket, for ease of swapping, above the other ICs.

Compiling and installing firmware from source
Step 1:

Install Platformio

Step 2

You may need to add the --upload-port parameter, depending on how your system enumerates the Arduino port.

bash
cd 3020-software-spindle-control/fw
platformio run -t upload
Installing from pre-compiled .hex file

--- nothing here yet ---

Behavior

The code will measure the input PWM from your controller, and monitors the front panel spindle control knob. The front panel knob sets the maximum speed. If this knob is at zero, the spindle will not be enabled. Example: if the knob is at the 60% position, and you command a 30% spindle speed via PWM, then the output speed will be 18% (0.3 x 0.6) of spindle absolute maximum speed. Also, the spindle on/off switch overrides everything else when in the off position.

Parts

15
QtyValueFootprintReferences
2CONN_01X03Connectors_JST:JST_XH_B03B-XH-A_03x2.50mm_StraightP2, P4
11N4148Diodes_SMD:SOD-123D1
12K2Resistors_SMD:R_0805R2
1330Resistors_SMD:R_0805R1
16N136Housings_DIP:DIP-8_W7.62mmU1
1CONN_01X02Pin_Headers:Pin_Header_Straight_1x02_Pitch2.54mmJ1
1CONN_01X02Connectors_JST:JST_XH_B02B-XH-A_02x2.50mm_StraightP1
1CONN_01X08Connectors_JST:JST_XH_B08B-XH-A_08x2.50mm_StraightP3
1MCP41010Housings_DIP:DIP-8_W7.62mmU3
1arduino_pro_microHousings_DIP:DIP-24_W15.24mmU2

The 11 most common of 15 parts.

Similar boards

  • 2 layers124 × 112 mmOpenDropV3, the printed circuit board in 3D

    OpenDropV3

    GaudiLabs/OpenDrop

    Open Source Digital Microfluidics Bio Lab

    318 parts492GPL-3.0
  • 2 layers169.3 × 128 mmPSU PCB, the printed circuit board in 3D

    PSU PCB

    ThomasVDD/SmartSupply

    SmartSupply is a digital battery powered lab powersupply. It is Arduino compatible and can be controlled via PC over USB.

    134 parts96
  • 2 layers50 × 100 mmPSU PCB, the printed circuit board in 3D

    PSU PCB

    ThomasVDD/SmartSupplyMini

    118 parts16
  • 2 layers57.2 × 57.2 mmRocketBeaconModule, the printed circuit board in 3D

    RocketBeaconModule

    explosion33/ArmLabRadio_PCB

    KiCad files for CC1200 based 2m / 70cm radio

    96 parts4
  • 2 layers63.5 × 31.8 mmLucid, the printed circuit board in 3D

    Lucid

    breadboardbasics/Lucid

    Everything that deals with my Lucid Dreaming project

    41 parts2MIT
  • 4 layers77 × 83 mmGeoMCU, the printed circuit board in 3D

    GeoMCU

    NohPei/GeoMCU

    Integrated Geophone Boards with programmable gain and an onboard MCU. Can be used over WiFi or wired with an external ADC.

    80 parts2CERN-OHL-P-2.0
  • 2 layers100 × 117 mmBHV Badge, the printed circuit board in 3D

    BHV Badge

    biomurph/BioVill_Badge

    DEFCON Micro Fluidics Badge Design For Biohacking Village

    270 parts1MIT
  • 2 layers101.5 × 55.8 mmSilverZap, the printed circuit board in 3D

    SilverZap

    hanebuechenes/SilverZap

    Generator für kolloidales SIlber / Gold nach Dr. Beck

    40 parts1GPL-3.0

Questions

How big is the 3020-cnc upgrade PCB?

It measures 69 × 29 mm and has 2 copper layers, 1.6 mm thick.

What parts does the 3020-cnc upgrade use?

15 parts, built around the MCP41010-E/P. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the 3020-cnc upgrade KiCad files?

From the micromouseonline/3020-software-spindle-control repository on GitHub, at the commit this page was made from: the board is hw/3020-cnc-upgrade.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.

Can I use the 3020-cnc upgrade design in my own project?

Its repository states no licence, so its author keeps all rights: ask micromouseonline before reusing the design.