Thread: Help with CNC 3018 from Banggood
Threaded View
-
15-03-2020 #13
EDIT: I've reread my post and realise that I've thrown a number of names into the equation: The "MEGA" or "AT-MEGA" or "ATMEGA328" is the micro-controller chip that sits on the "Nano" or "Arduino" - which is the small board about the size of two postage stamps. That board is the daughter board that sits on the larger "Developower" controller card. [END OF EDIT]
Cheers for the photo - that's confirmed pretty much what I've found on Banggood. I've tried to find a schematic of the board - there's a few people working on this but from what I've seen - if to be believed - it's pretty much confirmed my suspicion. I've yet to find a manual for the board but from what I can tell the 6x2 header for the limit switches presents the X/Y/Z axis inputs on two pins (total 6 for 3 axis) - presumably for up to two switches - one on each end of travel, and the other parallel pin header provides the ground "return" signal. The X/Y/Z input pairs are each commoned (shorted-together) for three separate signals that are passed to the micro controller - a generic Arduino Nano board.
The best I can work out is that the limit switches are wired something like this...
Now from what I can see physically on the board image, and from other people's attempt at schematics, I see no pull-up resistors on the board. The Arduino (the ATMEGA 328 microcontroller chip) can be configured to provide a weak-pullup that is required to set a logic "1" on the input - and then the limit switches, if active, pull that to ground (a logic "0"). That's the principle of operation. And, in a low-noise environment that works.
As soon as you get any induced electrical noise on the limit input, if the input resistance is very high (as it is with the internal pull-up resistors on the ATMEGA) then the signal will be superimposed on the silly-low current signal on the input with the result that a voltage of only a few volts will swamp the behaviour of the internal pull-up and present a false reading to the ATMEGA. Signals above and below the supply voltage of the MEGA would be clamped through internal protection diodes to the supply lines - so these are unlikely to damage the device, but you are still able to get spurious readings.
You've said that there are recommendations to add a 0.47uF capacitor from ground to the input pin. This is a bit daft - the idea with this solution is to attenuate a fast-changing signal - lets say a voltage spike lasting no more than a few hundreds of microseconds. But a capacitor used in this way is acting on rate-of-change of input voltage, not a static input voltage, and the effect quickly dimities over time as the capacitor charges (or in this case, discharges). Then the silly-high-resistance of the internal pull-up resistance will make the RC time constant stupidly long and the behaviour of the input presents a poorly defined and slow acting switch.
Best to get rid of the capacitors.
So, my recommendation - and this is a bit of an experiment but it makes sense to me at least - is to reduce the pull-up resistance, which has the impact of, in the case of induced noise, providing a much lower resistance to the power-supply, which is a convenient low-resistance path to ground (at least for the AC-analysis). This means in practical terms you can dissipate a lot of the induced noise into the PSU and not into the input pin of the MEGA.
But, we cannot change the internal pull-up resistor - that's internal to the MEGA, but we can add a resistor in parallel - and the effect is the same. So, what I suggest is adding three resistors, one to each of the axis inputs, pulled up to the MEGA's 5V supply line. Something like this...
The only problem is sourcing a 5V supply from the controller board - this is not present on the axis-limit switch inputs to the board, but is available elsewhere. Looking at another image of a (different) board...
There's a clear silkscreen label of "5V" on a header pin next to the axis-limit switch inputs. Use that to export a 5V line to the choc-block that you have all your limit switches wired to.
From there, buy 3 resistors - I've said 1k but the actual value isn't particularly important. The lower the value (e.g. 470 Ohm, or 220 Ohm.... common values) would give better noise immunity, but at the expense of higher current draw. At 1k, the current through each resistor will be 5mA and power dissipated would be 25mW (this means you can order 1/8W, 1/4W, 1/2W etc, resistors without fear - to be honest, that 25mW is not going to overload any resistor that you'll be able to buy). A 220 Ohm would be drawing 25mA per resistor and I'd be worrying about the thermal impact this has on the local 5V regulators on the Arduino board). So, for now, I'd stick with 1k values.
Wire a resistor from the 5V line that you've just added, into the X axis input. Repeat for Y and Z. So, you'll have three resistors.
Test.
If you still have problems, try the software debounce as before. If you still have problems then try wiring two resistors in parallel for each of the 3 axis (so, a total of 6 resistors). This would have the result of lowering the 1k value to 500 Ohms, and improving the clamping on the induced noise, but hold a finger over the regulators (the big black rectangular things on the controller board) to make sure these don't get too hot.
If you still have problems, then I'm an idiot and I've wasted your time, and about $1 of resistors.
Let us know how you get on.
MikeLast edited by Doddy; 15-03-2020 at 09:46 AM.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
3018 Pro has no connectivity on A5 pins.
By deepcut66 in forum Chinese MachinesReplies: 0Last Post: 29-02-2020, 10:48 AM -
3018 3 Axis Mini DIY CNC Router ONLY Ł125 with free shipping !!!
By Lee Roberts in forum Marketplace DiscussionReplies: 6Last Post: 09-01-2020, 09:00 PM -
3018 problem
By bazbalz in forum Machine DiscussionReplies: 8Last Post: 17-12-2019, 12:58 PM
Bookmarks