another cnc mill questionaire

the wire that comes back from a switch is connected to arduino. on this wire there is also the 10k resistor connected which goes to gnd on the arduino.

that's good
add the capacitors there

good morning. got some 0.1 400V capacitors (getting electronic components in tyrol is like looking for kangaroos in austria). i will try them out. readying some more threads on makecnc.com i found out that noise on limit switches is quite a common problem and it seems that this issue is always solved with 0.1 capacitors. i never found anything about 10k resistors so maybe i don´t need them. we´ll see and i keep you informed!

:slight_smile:
noise is a common problem, glad to hear the "usual" solution is 0.1 microfarad capacitors (400v is overkill, but does no harm; and probably all you can get anyway!)

you will need the resistors to ensure the inputs aren't floating, so I would use both

i am just messing around with the capacitors. classic noob question: do capacitors have a "direction". on one pin of the capacitor it says "hi" at the moment this is where i have the wire coming back from the switch connected. and it does not work.

so my idea is to do the following:

the wire coming back from the switch goes to the according pin on the arduino. then i will add a resistor on the wire that comes back from the switch. then i will add a capacitor there and connect it to the pin which says "hi" the other pin will be connected to gnd on the arduino.

basially thats how i had it already just with a capacitor added in the line. or should i wire the capacitors and the resistors parallel?

how about that?

some capacitors (high value ones) are polarised, so it DOES matter which way round they go
they are usually marked with a + and -
low value (the sort you are using) are generally not, so it doesn't matter which way round you connec them
one end of the capacitor should go to ground, the other should go to the input pin

tried and failed. machine moved a little. now it says all switches are 1.

well we're definitely poking the right place
very odd

wild guess
instead of connecting one ond of the capacitor to ground, connect it to +5
(think that means it's in parallel with the resistor but that's ok)

to make sure: that is how i have it now:

Nooooooooooooooooooooooooooo
+5v to switch is good
one side of10k to other side of switch is good
other side of 10k should go to ground
capacitor should be in parallel with resistor

try that!

like that ?

ps.: did i tell you lately that i am a noob? :wink:

perfick :slight_smile:

its a miracle! with a tear in my eye i see the machine moving to all the places i want her to. i think it will take some time until i trust this baby but i guess we did it.

oh my god, i am tired!

:slight_smile: :slight_smile: :slight_smile:
excellent news!
well done you
have a beer (ok maybe a bit early)
:slight_smile: :slight_smile: :slight_smile:

beside of the fact that i have to redesign my machine to make it stronger erverything works now. i am extremly thankful for your kind help!

one last thing: would you tell me with which software you generate the gcode for the cncdriver as i struggle a little getting the right code out of cut2d and cut3d.

have a very nice day!

my interest is pcb milling
so I use Eagle to design then layout the pcb
there is a plug-in pcb-gcode that creats the gcode directly from the layout

I don't know cut2d or cut3d

great thread guys. have you tried your program in linux(Wine?)

nope
strictly windoze man, me

is wine windows-on-linux?

give it a try!!

Yes, its an emulator.

well, it opens... do you have a bit if g-code i could try to run. i don't have anything built, but i will try to see if it talks to the arduino.

when i try to compile the sketch GCode_Interpreter.pde i keep getting this error:
'Serial' was not declared in this scope
this is the line it highlights line 70:
Serial.begin(19200);

here is the whole error

GCode_Interpreter.cpp: In function 'void setup()':
GCode_Interpreter:69: error: 'Serial' was not declared in this scope
GCode_Interpreter.cpp: In function 'void loop()':
GCode_Interpreter:82: error: 'Serial' was not declared in this scope
GCode_Interpreter:125: error: 'Serial' was not declared in this scope
GCode_Interpreter:131: error: 'Serial' was not declared in this scope
GCode_Interpreter:132: error: 'Serial' was not declared in this scope
GCode_Interpreter:147: error: 'Serial' was not declared in this scope
GCode_Interpreter.cpp: In function 'boolean Checksum(char*, int)':
GCode_Interpreter:193: error: 'Serial' was not declared in this scope
GCode_Interpreter.cpp: In function 'boolean ProcessComment(char*, int)':
processComment:6: error: 'Serial' was not declared in this scope
GCode_Interpreter.cpp: In function 'boolean ProcessGcode(char*, int)':
processGcode:95: error: 'Serial' was not declared in this scope
processGcode:104: error: 'Serial' was not declared in this scope
processGcode:126: error: 'Serial' was not declared in this scope
processGcode:130: error: 'Serial' was not declared in this scope
processGcode:134: error: 'Serial' was not declared in this scope
processGcode:138: error: 'Serial' was not declared in this scope
processGcode:141: error: 'Serial' was not declared in this scope
processGcode:154: error: 'Serial' was not declared in this scope
processGcode:159: error: 'Serial' was not declared in this scope
processGcode:200: error: 'Serial' was not declared in this scope
processGcode:245: error: 'Serial' was not declared in this scope
processGcode:257: error: 'Serial' was not declared in this scope
processGcode:266: error: 'Serial' was not declared in this scope
processGcode:277: error: 'Serial' was not declared in this scope
processGcode:288: error: 'Serial' was not declared in this scope
processGcode:299: error: 'Serial' was not declared in this scope
processGcode:308: error: 'Serial' was not declared in this scope
processGcode:317: error: 'Serial' was not declared in this scope
processGcode:325: error: 'Serial' was not declared in this scope
GCode_Interpreter.cpp: In function 'void DebugUnits()':
processGcode:333: error: 'Serial' was not declared in this scope
GCode_Interpreter.cpp: In function 'boolean ProcessMcode(char*, int)':
processMcode:19: error: 'Serial' was not declared in this scope
processMcode:32: error: 'Serial' was not declared in this scope
processMcode:45: error: 'Serial' was not declared in this scope
processMcode:57: error: 'Serial' was not declared in this scope
processMcode:69: error: 'Serial' was not declared in this scope
processMcode:83: error: 'Serial' was not declared in this scope
processMcode:95: error: 'Serial' was not declared in this scope
processMcode:107: error: 'Serial' was not declared in this scope
GCode_Interpreter.cpp: In function 'void process_string(char*, int)':
process_string:19: error: 'Serial' was not declared in this scope
process_string:34: error: 'Serial' was not declared in this scope
GCode_Interpreter.cpp: In function 'void dda_move(long int)':
stepper_control:119: error: 'Serial' was not declared in this scope
GCode_Interpreter.cpp: In function 'void Heartbeat()':
stepper_control:224: error: 'Serial' was not declared in this scope
GCode_Interpreter.cpp: In function 'void calculate_deltas()':
stepper_control:315: error: 'Serial' was not declared in this scope
GCode_Interpreter.cpp: In function 'void disable_steppers()':
stepper_control:397: error: 'Serial' was not declared in this scope
GCode_Interpreter.cpp: In function 'void enable_steppers()':
stepper_control:412: error: 'Serial' was not declared in this scope
GCode_Interpreter.cpp: In function 'bool PanicStop()':
stepper_control:428: error: 'Serial' was not declared in this scope
stepper_control:443: error: 'Serial' was not declared in this scope