Bamboo cnc/limit switch errors

105 views
Skip to first unread message

Mason Millner

unread,
Jul 21, 2020, 8:54:50 AM7/21/20
to Machinekit

Hi All,

We are developing a 4-axis CNC to mill bamboo poles and are currently running tests in just three axis (x, y, z). We can dry-run g-code files successfully, however we receive limit switch errors (primarily on joint 1) when we begin cutting material. We suspect that the error is occuring in the y-axis and that possibly our drivers are causing a problem (either they are too small or not tuned adequately).. It is difficult to tell what is going on and how the machine is configured from the information given.

 We have the z-axis running on the long x-axis, running on two shorter dual y-axes.

The axis shaft is a ½” (12.7mm) , also the motor shaft is ¼” (6.35mm).  we are using polyurethane insert couplers (these have regularly been coming loose though). 

The motors are NEMA 23s with  3A rating/phase controlled by Pololu TB67S249FTG drivers on a Cramps 2.2 cape on the Beaglebone Black. The drivers have a current limit of 1.6A and are further limited to %90 for safety. The Current limit for the board and drivers are defiantly a bottle neck, but the motors have enough power to operate. [Could this be the problem?]

Any help or recommendations would be greatly appreciated. If more information is needed please let me know. I'm fairly new to the machine development side of this project. Thanks.

justin White

unread,
Jul 21, 2020, 1:12:01 PM7/21/20
to Mason Millner, Machinekit
You didnt mention what type of limit switches you're using or how your spindle works. The Y axis itself shouldn't be under any special stress while cutting but the spindle generally takes a hard hit as soon as a tool enters the cut. Is the spindle motor powered by the same power supply your switches are on? Supply could be dropping low. Is the machine not ridgid and vibration tripping the switches?

--
website: http://www.machinekit.io blog: http://blog.machinekit.io github: https://github.com/machinekit
---
You received this message because you are subscribed to the Google Groups "Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to machinekit+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/machinekit/790379d8-160b-4fed-9fa2-d03cbe160926n%40googlegroups.com.

Mason Millner

unread,
Jul 21, 2020, 1:39:00 PM7/21/20
to Machinekit
We are using momentary hinge limit switches (https://www.amazon.com/URBESTAC-Momentary-Hinge-Roller-Switches/dp/B00MFRMFS6/ref=sr_1_3?ie=UTF8&qid=1535482225&sr=8-3&keywords=limit+switch) and our spindle (https://www.amazon.com/Koolertron-Spindle-Milling-Converter-Engraving/dp/B074XTKJTJ/ref=sr_1_9?ie=UTF8&qid=1535482152&sr=8-9&keywords=spindle+cnc) is operating from its own power supply. 
The machine is fairly rigid. No limit switches are triggered from until material is being cut. The bamboo does vibrate quite a bit as it spans 65" supported only on the ends, but we have been able to successfully cut this dimension previously (on a 3-axis Techno machine).
IMG_2503[1].JPG

Jeff Pollard

unread,
Jul 21, 2020, 7:53:47 PM7/21/20
to Machinekit
Hi,

  The limit switch wiring may be picking up electrical noise.
  You can try adding a bypass capacitor from the input to GND or additionally add a resistor in the path right before entry to the input.

   the 74HC14 in the schematic is not strictly necessary, but can but used to "square up" the input signal (while inverting it).
   The value of R2 and C1 in the image determine how much filtering will occur.
   Too much filtering will affect switch performance.
   Not enough and you can still get the nuisance interrupts from voltage spikes caused by motors in the system.
:
  Additionally, you can add a debounce filter to the HAL file

Jeff

Shreyas Bhat

unread,
Jul 22, 2020, 9:15:07 AM7/22/20
to Mason Millner, Machinekit
Hey, 

You can also try A ferrite core cable ring noise filters to eliminate the effects for the electrical noise.
 

Here's a link to what these are like. 

Cheers 

--

Frederic RIBLE

unread,
Jul 24, 2020, 1:40:34 PM7/24/20
to machi...@googlegroups.com

Could you describe the wiring of these switches on your machine?
I am wondering if you have two wires per switch going up to the logic board, or only one, with ground sharing.

Jeff Pollard

unread,
Jul 25, 2020, 12:41:04 PM7/25/20
to Machinekit
Hi,

  You should not make a loop of wire for the ground (gnd from switch to switch to switch is not good).
  You should have one wire for the switch input, and one wire for the signal ground in your switch cabling.
  All of the grounds from the various switches should meet at one point on the I/O terminal signal ground point.
  If possible, you should use shielded cabling.  Tie all of the shields (bare drain wires) at the same end near the inputs, but then connect them to an *earth* ground, not the signal ground of the input.  An example of an earth ground in a system would be the green wire (or green with yellow stripe) of a power supply, not the V- of the power supply.
  2-wire 22 gauge "sound and security" from Home Depot, etc. will typically be stranded wire with a drain wire and shielding.  This would be a good choice as it has all three of the conductors that you want.  Red for signal, black for signal ground and bare drain for shielding.

Jeff
To unsubscribe from this group and stop receiving emails from it, send an email to machi...@googlegroups.com.

Mason M

unread,
Aug 7, 2020, 8:41:17 PM8/7/20
to Machinekit
Hi All,

We are continuing to experience issues that we believe are relating to electrical noise on our BCNC. We realize that our machine is slightly unorthodox, so we have a folder link with wiring diagrams and assembly videos to help you help us. We are in the process of testing the machine. We had noise issues from the spindle power lines (which are not shielded), but we removed them from cable bundles and that seemed to remove that issue. We are able to run files successfully in the air, but we receive limit switch errors when we begin cutting through material. our system seems to be rigid enough to not be the problem and our motors are strong enough that human force doesn't stop the system from running. We rewired our spndle power supply to have a seperate power cable than our primary power supply as well. We have tried adding debouncing code to our Hal file, but this caused Machinekit to not sense our limit switches (we couldn't complete a homing sequence). 

folder link

BCNC tour

Chris Albertson

unread,
Aug 7, 2020, 9:46:34 PM8/7/20
to Mason M, Machinekit
Do the videos show "before" or "after" the noise fix was attempted?   They kind of look like "before" photos.  I don't see any twisted and shielded cables and I do see signal and power cables running in parallel with little separation.

If power cables are tightly twisted, maybe 4 times per inch then the radiated field is mostly canceled at about 11 cable diameters.   You have to think about magnetic fields.   Typically high current cables with magnetic the e-feild and the shield does about nothing for magnetics.

We also can not see how the grounds in the power supplies, drivers and logic board are connected, or not connected.   A diagram would help

Also it is very hard to know what is happening without schematics

It is slightly best if the switches are wired to the normal state is to have the signal at ground and with a strong pull-up.     If debounce is needed (it is) you can try in software but a capacitor and a couple of resistors work better.   basically the computer tracks the voltage across the cap  The cap is charges or discharge through a resister sothere is a controlled rate of change.



--

Chris Albertson
Redondo Beach, California

Mason M

unread,
Aug 7, 2020, 10:57:47 PM8/7/20
to Machinekit
All the videos are “after” attempted fixes and are most recent. The photos in the google drive folder are “before”. There is a wiring diagram in the in the google folder as that shows positive, negative, and ground placements as well.

justin White

unread,
Aug 8, 2020, 9:45:09 AM8/8/20
to Chris Albertson, Mason M, Machinekit
Your machine frame is mostly wood and it seems to not have any path to ground for the spindle motor case. You should try running a ground wire from your aluminum spindle clamp to the ground screw of the spindle PSU and make sure the power input cable to the supply is actually grounded with the plug.

Charles Steinkuehler

unread,
Aug 12, 2020, 4:52:52 PM8/12/20
to Mason M, Machinekit
Sorry, I've been really busy and it took me a while to get a chance to
pull up the docs on Google for review.

My suggestions:

* Twist the power lines going to the stepper motors. The stepper
drivers are basically small switching power supplies and they spew EMI
like nobody's business. I tightly twist the two wires that go to a
coil, then loosely twist the two pairs together to form a single cable.
You can do this after the fact if you remove the crimp contacts from one
end of the cable. I typically use an electric drill to tightly twist
the individual pairs, then do the loose twist by hand.

* Use twisted pair wiring for all the limit switches as well. You can
either make this yourself (as above) or I'll typically just pull pairs
from Ethernet patch cords, which gives you four different color-coded pairs.

* Beef up the pull-up resistors on your limit switches. The CRAMPS
board has built-in 10K pull-ups, but that's mostly just to keep the
lines from floating. If you're running long cables you'll want
something much smaller. The value to use is a complex trade-off, but a
good target current when the switch is "closed" would be similar to what
you'd use to drive an LED (eg: about 5 to 20 mA), which means a resistor
value between 470 ohm and 1K.

I'll try to take a photo of how I prep stepper motor wires and forward
it to the list, but here's a video of basically what I do. Make sure to
keep some tension on the wire while you're twisting it:

https://www.youtube.com/watch?v=aMUFZZZR7d0

On 8/7/2020 7:41 PM, Mason M wrote:
> Hi All,
>
>>>>> <https://groups.google.com/d/msgid/machinekit/790379d8-160b-4fed-9fa2-d03cbe160926n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>> --
>>> website: http://www.machinekit.io blog: http://blog.machinekit.io
>>> github: https://github.com/machinekit
>>> ---
>>> You received this message because you are subscribed to the Google Groups
>>> "Machinekit" group.
>>>
>>> To unsubscribe from this group and stop receiving emails from it, send an
>>> email to machi...@googlegroups.com.
>>>
>>>
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/machinekit/8c6cb16c-03d6-4c1c-8cc5-0d8ad5012849n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/machinekit/8c6cb16c-03d6-4c1c-8cc5-0d8ad5012849n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>>
>

--
Charles Steinkuehler
cha...@steinkuehler.net

Charles Steinkuehler

unread,
Aug 12, 2020, 8:23:16 PM8/12/20
to Mason M, Machinekit
Here's the wiring for one of the stepper motors on my 3D printer.

I believe it's been mentioned already, but another suggestion:

* Keep the limit switch wiring physically separate from the stepper
motor wiring. You want at least a few inches, and generally as much
space as possible between low-power signal wiring (your limit switches)
and the high power "noisy" stepper drive wires.
IMG_20200812_190832701.jpg
Reply all
Reply to author
Forward
0 new messages