Welcome! Log In Create A New Profile

Advanced

Need help with Mechanical Endstops

Posted by Idaholion 
Need help with Mechanical Endstops
March 01, 2011 02:07PM
We are almost finished with our Mendel, but we have run into a couple of difficulties.
Since I have access to very rugged mechanical switches, and we didn't have any opto switches, we are wiring our unit with mechanical switches instead of opto, per

[reprap.org]

This means we only have the switch and one 10K resistor.
We are using Techzone stepper drivers, and master board and we cannot get the system to respond correctly. We will send a home command, and the axis hits the switch, and the axis does not stop running. Do these boards not like a pull up 5v system? Can you think of any reason why the system does not like the mechanical system? I thought perhaps I had accidentally wired to NO instead of NC, so I checked that. No luck.
I checked, double checked and triple checked the harnessing. I also confirmed with my multimeter the pins on the board are the 5v, signal and ground lines. I went on the Techzone board info wiki
[reprap.org]
and saw where they had the opto switches wired. We are using the correct pins.
Does anyone have any hints on using mechanical switches in place of opto switches?


Thank you
Idaholion
Re: Need help with Mechanical Endstops
March 01, 2011 02:08PM
Re: Need help with Mechanical Endstops
March 02, 2011 11:57AM
What is your complete setup? What electronics are you using? What firmware? What do you mechanical switches look like?

If you are running Tonokip, i beleive the end stops have to be defined in the code.
Re: Need help with Mechanical Endstops
March 02, 2011 07:07PM
For a mechanical switch, you don't need a seperate pullup resistor. The atmel chip has one built in, which is activiated by writing a "1" to the pin as if it was an output. Might have to do that before you set it as an input, I can't remember.

In any case, you should have only two wires going out to your switch, signal and ground. If you wire it to the NC side of the switch, then you won't have a head crash when the wires come unplugged. (found that one out the hard way) Then of course you have to recompile the firmware with "1" as the "normal" reading from the endstops. I can't remember off the top of my head if that was "inverted" or not in the standard firmware, I've since switched to the teacup firmware.

Uhm, what was the questions again?


--
I'm building it with Baling Wire
Re: Need help with Mechanical Endstops
March 03, 2011 11:45AM
@jgilmore: is this the case with all RepRap motherboards? Also what about debouncing? Will this effect the behavior of the end stop?
Re: Need help with Mechanical Endstops
March 03, 2011 12:48PM
Quote

is this the case with all RepRap motherboards?

Yes.

Quote

Also what about debouncing?

None of the RepRap endstops does debouncing on the electronics side so far. Debouncing also isn't critical, as it only decides to report "endstop triggered" now or at the next step of the stepper motor. What you really _not_ want are bounces due to stray EMF radiation going into the endstop connector cables. Mechanical endstops aren't better or worse than electronic endstops here and a shielded cable helps. Also, Teacup firmware currently experiments with a debouncing counter, no clear result yet.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Need help with Mechanical Endstops
March 03, 2011 01:36PM
So, just to confirm, the mechanical endstop information at
[reprap.org]
is not applicable to the TechZone stepper controllers, since the Atmel chip already takes care of that?
I would need the 5v line going to an Optoswitch, since it needs a 5v source to run, but mechanical switches only need to open/shut a circuit between signal and ground.
OK, I will give that a try. It is embatrrasing, but I don't know what firmware we are running on the boards. I am handling the mechanical and electronic end of the printer, another guy is dealing with the software/firmware.
I am going to suggest to him we look into the teacup firmware. Do we need to rewrite the teacup firmware with a 1 as the value for endstops, or is that its default value?
My buddy is always looking for a better firmware/software package. It sounds like you are sold on teacup. If you don't mind me asking, what software package are you running?
Do you know what software the teacup is good with/bad with any particular software packages?
Thanks
Idaholion
Re: Need help with Mechanical Endstops
March 03, 2011 11:00PM
Just FYI: I tried mechanical end stops on my Mendel with RAMPS and Tonokip Firmware, and it works as described. I tied the Input to the COM pin of the switch and GND to the NO (Normally Open) pin of the switch. The following was added after the heater definition in the Setup() function, but before Serial configuration.

  pinMode(X_MIN_PIN, INPUT);           // set pin to input
  digitalWrite(X_MIN_PIN, HIGH);       // turn on pullup resistors
  pinMode(X_MAX_PIN, INPUT);           // set pin to input
  digitalWrite(X_MAX_PIN, HIGH);       // turn on pullup resistors

  pinMode(Y_MIN_PIN, INPUT);           // set pin to input
  digitalWrite(Y_MIN_PIN, HIGH);       // turn on pullup resistors
  pinMode(Y_MAX_PIN, INPUT);           // set pin to input
  digitalWrite(Y_MAX_PIN, HIGH);       // turn on pullup resistors

  pinMode(Z_MIN_PIN, INPUT);           // set pin to input
  digitalWrite(Z_MIN_PIN, HIGH);       // turn on pullup resistors
  pinMode(Z_MAX_PIN, INPUT);           // set pin to input
  digitalWrite(Z_MAX_PIN, HIGH);       // turn on pullup resistors

Also in configuration.h i set:
  const bool ENDSTOPS_INVERTING = true;

For some reason 'HOME ALL' command doesnt do anything, but i suspect the command is just not currently compatible with this firmware.
Re: Need help with Mechanical Endstops
March 07, 2011 11:44AM
Oh! I missed that. So scratch attaching the wires to NO. Attach to NC and set ENDSTOPS_INVERTING = false;
Re: Need help with Mechanical Endstops
March 07, 2011 03:49PM
Thank you all for the help. The three of us putting the instrument together haven't been able to get together for a week, so I am anxious to try out all your suggestions.
Anyone have any strong opinions on software to run the instrument? Especially if we shift to a different firmware (Teacup, or one of the others).
Oh, CidVilas, your comment implied you missed something. What did you miss?
Thanks again everyone
Re: Need help with Mechanical Endstops
March 07, 2011 07:06PM
What i meant to say by "I missed that" is that i didn't quite understand why he attached the wires to NC (Normally Closed) instead of NO (Normally Open). This way, even if the switch comes undone or wires clip off, the switch will simply toggle as if tripped and the axis will not come slamming into the broken side. Its a safety feature. Most commercial machines are done this way as well.
Sorry, only registered users may post in this forum.

Click here to login