Fix Cloned Arduino NANO CNC Shield

15,877

35

56

Introduction: Fix Cloned Arduino NANO CNC Shield

Modifying Clone Keyes CNC Shield.

One the web are Chinese cloned Keyes CNC Shields for the Arduino NANO.

They are cheep and good value. BUT.

If you want to set Micro Stepping as they are, you can't.

Who ever cloned/made this shield made a mistake and put the pins that should go to Vcc, to GND.

As the pins that set the Micro Step Mode are already pulled down to GND internally as default, and to change there state, they need pulling up to Vcc.

Step 1: Ways to Identify a Cloned Arduino NANO CNC Shield

1. The original Keyes Nano CNC Shield has a dark solder mask. (it looks blackish)

2. there are some print errors. Pins D9 and D10 are incorrectly identified. Control is spelt Contr01.

3. Look at the circuit track and see if the pins are connected to GND.

Step 2: Isolating Pins Top Side

The first step to put things right, is to isolate the pins from the GND rail.

This needs doing in Eight places.

First Two are on the top side.

I found, warming the header pins, made it easier to slide off the plastic supports.

Step 3: Isolating Pins Bottom Side

The next Six are underneath.

Step 4: Check That the Pins Have Been Isolated

After isolating the pins, check that they Are Isolated, using a circuit tester.

Check that they are no longer connected to ground.

Step 5: Connect Broken Ground Track

Isolating the pins from the GND track has separated the GND track and need reconnecting in two places.

Solder two pieces of tined copper wire in the place shown.

Step 6: Connecting Pins to Vcc

Now the isolated pins need connecting to the Vcc circuit.

Luckily there are pins connected to this circuit close by to the isolated pins.

Using tined copper wire make solder bridges to these pins as shown.

Be sure to keep the tined wire away from the track that runs under the bridge.

Step 7: All Finished

That's it.

The Micro-Step jumper Header Pins should now work as they should.

Step 8: GRBL Code

I write my own code when using this board, BUT.

As pointed out by FrancescP2 (in comments), If you are going to use gbrl firmware some changes to the code need making.

When you download the gbrl-master and unzip the file, in the folder you will find a folder called grbl, inside that folder you find a folder called cpu_map, inside that folder you will find 2 files, cpu_map_atmega328p.h and cpu_map_atmega2560.h.

As this shield is for the Arduino NANO, the file that needs changing is: cpu_map_atmega328p.h.

Open the file and you should see as shown (or similar) in the screenshot.

There are 2 ways to do this:

1. Only use cloned shield. If you don't intend to use a shield that is configured correctly.

Using screenshot as reference:

Line 39, change 2 to 5.

Line 40, change 3 to 6.

Line 41, change 4 to 7.

Line 47, change 5 to 2.

Line 48, change 6 to 3.

Line 49, change 7 to 4.

2. If you want to be able to quickly change from one type of shield to the other. (as shown by FrancescP2)

I will do this higher line numbers first so original line numbers (screenshot) I reference stay same for a time.

Lines 47,48 & 49 need replacing with:

#ifdef KEYS_CLONE
#define X_DIRECTION_BIT   2  // CLONE NANO Digital Pin 2
#define Y_DIRECTION_BIT   3  // CLONE NANO Digital Pin 3
#define Z_DIRECTION_BIT   4  // CLONE NANO Digital Pin 4
#else
#define X_DIRECTION_BIT   5  // Uno Digital Pin 5
#define Y_DIRECTION_BIT   6  // Uno Digital Pin 6
#define Z_DIRECTION_BIT   7  // Uno Digital Pin 7
#endif // KEYS_CLONE

Lines 39, 40 & 41need replacing with:

#ifdef KEYS_CLONE
#define X_STEP_BIT      5  // CLONE NANO Digital Pin 5
#define Y_STEP_BIT      6  // CLONE NANO Digital Pin 6
#define Z_STEP_BIT      7  // CLONE NANO Digital Pin 7
#else
#define X_STEP_BIT      2  // Uno Digital Pin 2
#define Y_STEP_BIT      3  // Uno Digital Pin 3
#define Z_STEP_BIT      4  // Uno Digital Pin 4
#endif // KEYS_CLONE

After line 30 insert a variable that can be changed to decide which shied is used?

#define GRBL_PLATFORM "Atmega328p"
#define KEYS_CLONE true

Changing the value of KEYS_CLONE:

true = using clone

false = using correct shield.

(FrancescP2 has given a link to a file he has alterd)

1 Hour Challenge

Participated in the
1 Hour Challenge

6 People Made This Project!

Recommendations

  • Clocks Speed Challenge

    Clocks Speed Challenge
  • Toys & Games Contest

    Toys & Games Contest
  • Big vs Small Challenge

    Big vs Small Challenge

56 Comments

0
kenth321
kenth321

Tip 3 months ago on Step 6

I just purchased some of these "Clone Keyes CNC Shields" and realizing that they have to be modified. I have been looking at various solutions here and see some that work "in some cases". It seems to me that you would like the control of the micro stepping to work for all modes. Mode one: from the jumpers so the stepping ratio can be changed manually. Mode 2: from digital control at the MS1-MS3 input pins independent of jumper setting. I don't see a complete solution here but one is very close. Cutting the gnd traces from the jumper pins got close. If the wire bridge connecting the isolated jumper pins to Vcc is replaced by a 4-5K resistor, the jumpers will pull the MS pins high but will allow the MS pins to be driven back to a low from digital outputs and not be driving a short to Vcc. This works because the MS pins are pulled low by approx. 100K resistors to gnd on chip. Thanks for identifying all the traces to cut. All I have to do now is attack the gnd shorts.

0
Palingenesis
Palingenesis

Reply 3 months ago

I am sure you mean well, but:
The MS pins are not connected to any digital output pins.
There is no digital outputs free that can be used, they are all used for other purpose's
Also:
There would be no reason to connect the Mode pins to a digital output pin on the microprocessor.
The pins are set to whatever stepper motor you are using and the values the firmware requires.
This fix is to put the mode pins as they should be on the original shield.
The original shield was made for grbl firmware.
That's what the fix does.

But, If for some reason you would want to control the mode pins from a micro controller, all you have to do is leave the jumpers off, connect directly to the mode pins and pull the required pins HI with the microcontroller.
The same way the logic inputs for DIR and STEP are pulled HI.

So you can see it does work for all modes.

0
kenth321
kenth321

Reply 3 months ago

It works for all modes if you are willing to make solder changes between modes of use. The solution I proposed does not require any hardware changes if you need to change modes of MS control. Software guys prefer this model.

0
Palingenesis
Palingenesis

Reply 3 months ago

I think you have tunnel vision.
Do the modification as the instruction, and it will do what you want it to do.

0
rcbasra
rcbasra

3 months ago

Hi
so I am a totally new for Arduino, but I have engineering background
I have modified my Cloned Arduino NANO CNC Shield according to the instruction and I have no intention to use other shield with that Arduino Nano
can you please confirm what change to the code i should do (the first one or the second option ) ( Note. I have tried to replace the CPU map with the file from FrancescP2 but i receive error message when upload the GRBL )

0
Palingenesis
Palingenesis

Reply 3 months ago

If you are not going to use any other shield, you are only going to use the Cloned Shield.
Step 8 GRBL Code.
If you have downloaded the latest version of GRBL code, located and opened the file: cpu_map_atmega328p.h
Find the line with text: #define GRBL_PLATFORM "Atmega328p"
From that line it all should look like the image in Step 8.
line numbers in your file may be different, you will have to adjust for this if they are.
Now follow the 1st way to do it (1. Only use cloned shield).
I refer to line numbers in the image.
After editing, save.
Install as instructed on GRBL site.

0
rcbasra
rcbasra

Reply 3 months ago

thanks Palingenesis
did the cut (all 8 locations) and weld as you can see in the attached photo
did the code change according to step 8 option 1
waiting for testing
appreciate your help

Nano CNC shield.jpg
0
Palingenesis
Palingenesis

Reply 3 months ago

Cool, that looks good on the under side.
Hope all goes well for you with the testing.
It would be nice to see it in the "I made it" when is all done.

0
rcbasra
rcbasra

Reply 3 months ago

thanks for the positive encouragement, love how friendly you are,
guess what
Tested and everything is OK
still need to learn how to convert a photo or PDF drawings into GRBL file

0
rcbasra
rcbasra

Reply 3 months ago

I am Working on 2 projects at same time, the first one which i start with to learn about cnc settings is 1616 spindle desktop CNC with Arduino Nano , by the way do you know how to connect the relay for the spindle with that shield.
the second project is 5.5W laser CNC1000X1000 with arduino uno and CNC shield to use it for foam board cutting for RC plans

IMG20210122225627.jpg
0
MarianG36
MarianG36

4 months ago

Maybe simpler ... don't cut anything...

IMG_20201222_211945.jpg
0
Palingenesis
Palingenesis

Reply 4 months ago

But people would get confused, Jumpers On = Jumpers Off.
And what happens when you want to use more than 5 volts to drive the stepper motors?

0
MarianG36
MarianG36

Reply 4 months ago

The resistors are connected to + Motors, see route..works well at 12v

0
Palingenesis
Palingenesis

Reply 4 months ago

Yes that's why I asked.
You now have 12v going to the logic pins of the Stepper Driver which should only
have VCC or VSS going to them, that's 5v or GND from the Arduino.
I am surprised it is still working.
Data sheet say max is 7v, you have probably just blown the gates the these pins and it running as though all was to ground or floating.

0
MarianG36
MarianG36

Reply 4 months ago

Sorry to translate google ...
You are right....Jumpers On = Jumpers Off
I measured on the logic pins are 10.7v at 12 v power supply and ..... it works, I didn't change anything on the board .. I read the data sheet at A4988 ... but everything ..OK.
I run a quarter of a step. MS2 to gnd.

0
Palingenesis
Palingenesis

Reply 4 months ago

Oh well, if you are happy with it. All is well and good.
I'm afraid I would not recommend it though.
Just had a though, perhaps if you connect to the pin shown in step 6, instead of the motor power.
This is VCC, it may also work.
The MS1 and MS3 pins have a 100 kΩ pull-down resistance, and the MS2 pin has a 50 kΩ
So if your resistors are less than 50 kΩ it sould pull them the other way.

0
MarianG36
MarianG36

Reply 4 months ago

Translation with google ... sorry if it is not understood.
All the respect for what you did.
I posted exactly what I did and it works great.
I would like to make additions .... I have stepper nema 17-1.7A
I set volts on A4988 according to calculations (1.36V), I set it to 1.2V .... it creates all kinds of problems, when I set the A4988 to 0.6 V ... everything is ok.

Vref=8*Imax*Rcs = 8*1.7*0.1=1.36V