Welcome! Log In Create A New Profile

Advanced

OptoEndstop 2.1

Posted by windcatcher 
OptoEndstop 2.1
November 23, 2011 03:21AM
Hi Guys,

I bit the bullit and bought a ramps 1.4 pre-populated board from Mixshop.
This was done because I was having trouble getting working firmware for the "Adrian's Pololu Electronics" boards I originally built.

I thought I would be up and printing by now but I hit another snag when I noticed that my new board ony has 2 pins for each end stop.
I guess I should have specified what kind of end stops I would be using before placing the order but the Mixshop item caption said it works with both mechanical and optos. Since I already own six version 2.1 opto endstop kits that are all assembled and mounted on the machine, I would like to stick with them, especially for the Z axis.

Does anyone know how I can make the Version 2.1 opto endstops work without soldering extra pins onto the ramps board?

There is an extra row of pin holes there but I am not sure where they go and because the board came pre-tested I would like to avoid soldering on it

Any advise would be appreciated.

Thanks
VDX
Re: OptoEndstop 2.1
November 23, 2011 08:33AM
... "only 2 pins for each endstop" means you'll receive the signal voltage and mostly GND as reference.

For mechanical endstops this is enough, if the signal pin is equipped with a pull-up resistor to +5V, but for most Optos you need the +5V to be routed to the Opto-PCB as power source for the opto-coupler.

You should check the pins and data-sheets if this estimation is correct ... if yes, then you can draw a separate wire for the needed +5V to each opto (or to the 3rd pin of the 3-pin-connector).


Viktor
--------
Aufruf zum Projekt "Müll-freie Meere" - [reprap.org] -- Deutsche Facebook-Gruppe - [www.facebook.com]

Call for the project "garbage-free seas" - [reprap.org]
Re: OptoEndstop 2.1
November 23, 2011 03:41PM
Thanks Viktor.

I will try that and let everyone know if it works.
If anyone else has a ramps 1.4 board and can tell me what their setup is that would help me as well.
A picture is worth a thousand words.

Thanks
Re: OptoEndstop 2.1
November 24, 2011 06:41AM
I have multiple working RAMPS setups, but with another opto end stop. You will have to solder another row of pins. Please check the wiring first. I think the RAMPS has different pin setup than the original end stops, so connecting them might cause them to blow up.




reprapworld.com
PLA, ABS, PETG multiple colors (3 and 1.75 mm) €16,49 / kg
Megatronics 3.0 €79.99 / Minitronics €37,19
Re: OptoEndstop 2.1
November 25, 2011 02:41AM
Hi Brupji,

I was fortunate to get some excellent help from the fellow at Mixshop.
They are very helpful and I would reccomend them to others.

Like you, he said I could just solder a row of pins onto the board below the 2 rows that are already there.
I tested the holes to ground looking for 5 volts and found it on all pin holes.
So yes, you can do exactly that and it was also very easy to do.

Unfortunately you are right about the blow up thing.

I only had one pololu conected when I tried it but I must still have something wrong in my pin.h file as far as optos are concerned.
I downloaded the latest version of Sprinter (f8c17d3) and it had all of the pin outs labelled correctly.
I verified and compiled with Arduino and uploaded it to the board.

The green light on the opto board came on but when I placed something between the tabs it didn't go out.
I thought this might be ok as I didn't have the pololu chip plugged in yet so I unplugged everything and put the chip in.

I plugged in the y axis pololu and the y axis opto and started pronterface to see if the green light would go out on the opto board but it still didn't.
I figured it wouldn't hurt to try to move the motor so I tried that.
Nothing moved but a red light on the Ramps 1.4 board lit up so I turned off the power supply quickly.

Turns out I didn't un-remark #define RAMPS_V_1_3 in the pins.h file.

I am not sure what pins it actually connected to but I lost the pololu chip in the first attempt.
(Does anyone know how to test these outside the board?)

On the second attempt I defined the RAMPS_V_1_3 and disconnected all of the optos and the x, y,and z are now working fine.
I'll have some time to play with it now as I have to wait for more pololu chips to arrive before I can get the extruder going.

In the meantime, do you know what section in the Sprinter file I have to set and how it is supposed to read in order to set Version 2.1 optos correctly?

Please let me know if you get a chance.

Thanks
VDX
Re: OptoEndstop 2.1
November 25, 2011 04:03AM
... when looking to the pin specifications of the pololu you can see which pins are needed for proper operation - it should be +5V and GND for the electronic, +12V (or other voltage, if you have another setup) and GND for the motors (simply connect the GND's) and CLK, DIR and ENABLE for controlling the motors.

When you have the support voltages connected and wired a pull-up to enable (or pull-down, check the correct polarity needed to enable the motor output), then you can move the motor single step-wise by changing the polarity of the CLK-pin ... or drive it with a constant rate by applying an oscillating signal with a proper frequency of some hundred Hertz.

The polarity at the DIR pin defines the direction of the movement ...

But avoid plugging/unplugging the motor with power on, or the drivers will blow!


Viktor
--------
Aufruf zum Projekt "Müll-freie Meere" - [reprap.org] -- Deutsche Facebook-Gruppe - [www.facebook.com]

Call for the project "garbage-free seas" - [reprap.org]
Re: OptoEndstop 2.1
November 25, 2011 09:03AM
windcatcher Wrote:

>
> Turns out I didn't un-remark #define RAMPS_V_1_3
> in the pins.h file.
>
> I am not sure what pins it actually connected to
> but I lost the pololu chip in the first attempt.
> (Does anyone know how to test these outside the
> board?)
>


Why are you editing pins.h? You should leave that alone. All you have to do is edit configuration.h and change a line near the top to define RAMPS 1.3 as your electronics since1.4 has the same pin assignments as 1.3.

#define MOTHERBOARD 33
Re: OptoEndstop 2.1
November 25, 2011 09:33AM
Quote
windcatcher
In the meantime, do you know what section in the Sprinter file I have to set and how it is supposed to read in order to set Version 2.1 optos correctly?

Just set the electronics in configuration.h as I posted. In addition, you may need to reverse the polarity of the signal and turn off the internal pull-up resistor. (changed values in red)

//// Endstop Settings
//#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
// The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins.
//If your axes are only moving in one direction, make sure the endstops are connected properly.
//If your axes move in one direction ONLY when the endstops are triggered, set [XYZ]_ENDSTOP_INVERT to true here:
const bool X_ENDSTOP_INVERT = true;
const bool Y_ENDSTOP_INVERT = true;
const bool Z_ENDSTOP_INVERT = true;

You also need to either change your opto endstop connector or make an adapter to switch the center pin with one of the outer pins as described in the RAMPS 1.4 wiki under the section "Opto Endstops".

Edited 2 time(s). Last edit at 11/25/2011 09:38AM by brnrd.
Re: OptoEndstop 2.1
November 26, 2011 01:35PM
Hello brnrd

Thanks for pointing me to the right section.
I am going to try that right now.

To answer you other question though, I edited the pins.h file because it said to in the section under if motherboard 33.

//////////////////FIX THIS//////////////
#ifndef __AVR_ATmega1280__
#ifndef __AVR_ATmega2560__
#error Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu.
#endif
#endif

// uncomment one of the following lines for RAMPS v1.3 or v1.0, comment both for v1.2 or 1.1
// #define RAMPS_V_1_3
// #define RAMPS_V_1_0

It says to uncomment one of the following lines.

Whats up with that?
Re: OptoEndstop 2.1
November 26, 2011 09:33PM
You don't need to uncomment that line because at the beginning of the file, it defines it if the motherboard is set to 33.

#if MOTHERBOARD == 33
#define MOTHERBOARD 3
#define RAMPS_V_1_3
#endif

So, as long as you defined the motherboard correctly, you didn't need to edit pins.h.This shouldn't have broken your pololu.
Re: OptoEndstop 2.1
November 27, 2011 03:05AM
Great news!

I got all of my opto end stops working.

I set the "const bool X_ENDSTOP_INVERT = true;"
for all three axis in the configuration file and tried it again.

It didn't work at first but after swapping the brown and brown/white and green wires at the connector end it does.

Blue & blue/white = 5v ( My newly soldered in pins )
Brown & brown/white = ground
Green = Signal

Thanks for the help brnrd.

Now all I have to do is figure out why my Z & X axis will ony go + directions.

All of them were working fine until I started messing with the end stops.
Whats odd is that the Y axis will go both ways just fine still?

Anyway, I'm happy I got the fist one figured out.

Cheers
Re: OptoEndstop 2.1
November 27, 2011 06:44AM
If your axis only goes in one direction (+ direction), it means that your endstop is either connected wrong, you didn't edit the firmware code correctly, or it's broken. Just to clarify, you should also have the following statements in configuration.h:

const bool Y_ENDSTOP_INVERT = true;
const bool Z_ENDSTOP_INVERT = true;

Edited 1 time(s). Last edit at 11/27/2011 06:45AM by brnrd.
Re: OptoEndstop 2.1
November 29, 2011 02:54AM
You got it again brnrd.

My optos were plugged into the max pins.
They have to be plugged into the min pins which are located directly below the letters X,Y and Z on the ramps board.
Now I have all 3 motors going both ways and stopping.

Thanks again for the help.

Cheers
Re: OptoEndstop 2.1
December 05, 2011 12:11PM
Hi Guys,

my opto endstops won't work at all. I can move the axis, but when I put anything in the detection system, they dont stop the motors from moving. I'm using a Gen3 Mendel, with the last updated reprap firmware. The Hostsoftware is RedSnapper and ReplicatorG. With both Softwares I encounter the same problems. How can I check at the endstop, if theres 5V/ 0V if the endstop is triggered? I'm using Endstop v2.1 rev1 PCB, in the firmware they are set as
"#define X_ENDSTOP_INVERTING false"
I'd be glad about any tipps....

Cheers
Sorry, only registered users may post in this forum.

Click here to login