M2 inputs?

The place to discuss your hardware and software/firmware modifications...
User avatar
JohnnyRobot
Posts: 128
Joined: Tue Apr 22, 2014 9:25 pm

M2 inputs?

Post by JohnnyRobot » Wed May 27, 2015 3:11 pm

Has anyone here added a functional input to their M2?

I'd like to configure a limit switch that will stop a print if it is triggered.
╒═════════════════════════════════════════════════════════╕
-- Hi! No signature here.
╘═════════════════════════════════════════════════════════╛

User avatar
PcS
Posts: 667
Joined: Mon Mar 09, 2015 12:19 pm
Location: Michigan

Re: M2 inputs?

Post by PcS » Wed May 27, 2015 5:03 pm

Nope. why do you.need it ? If it is an emergency. I just hit the reset switch.

User avatar
JohnnyRobot
Posts: 128
Joined: Tue Apr 22, 2014 9:25 pm

Re: M2 inputs?

Post by JohnnyRobot » Wed May 27, 2015 10:45 pm

Well,

I've had 3 incidents in my 2 years of owning a 3D printer when a filament bulge has spoiled my print. I do purchase from reputable sources, I'm just wondering if an occasional bulge is unavoidable.

I was hoping to make a "filament tension monitor switch". I would pass the filament through a spring loaded lever. If the filament tension were to increase and overpower the spring (i.e. filament bulge is caught in hole on the end of the lever) then a limit switch will turn on, causing the print to stop.

I know that 3 incidents in 2 years isn't that big of a deal. But I still worry about it before starting a long print.

No pins for inputs..? :(
Image
╒═════════════════════════════════════════════════════════╕
-- Hi! No signature here.
╘═════════════════════════════════════════════════════════╛

lem
Posts: 162
Joined: Thu Jan 15, 2015 6:44 pm

Re: M2 inputs?

Post by lem » Wed May 27, 2015 11:33 pm

You could possibly use one of the "endstops". There are six Xmin, Ymin, Zmin, Xmax, Ymax, Zmax. The set of minimums are usually used to home the printer so the software and hardware are synchronized.

You would have to determine two things: 1 does the M2 use the maximums? and 2 what does Marlin do when it senses a maximum?

Of course, if you want to change the firmware, you can do what you want to with them.

User avatar
Jules
Posts: 3144
Joined: Wed Jan 21, 2015 1:36 am

Re: M2 inputs?

Post by Jules » Wed May 27, 2015 11:54 pm

Okay, I'm probably going to sound like an idiot when i ask this, but what exactly is the firmware for this? (Got a pal who claims he knows the guy who developed it.)

(And i hate sounding like an idiot about my own machine!) :D

User avatar
Tim
Posts: 1205
Joined: Thu Apr 10, 2014 2:19 pm
Location: Poolesville, Maryland
Contact:

Re: M2 inputs?

Post by Tim » Thu May 28, 2015 12:49 am

This is why the Smoothieboard developers put in a generic switch that is toggled by gcode M42 and M43. But then they also put in the code for a limit kill switch, that does a complete motor shutdown when triggered.

But. . . Marlin has pretty much the same code. It defines "KILL_PIN", which is undefined (pin # set to -1) unless the ULTRA_LCD is also defined.
If you go into Marlin's "pins.h" file and in the section "Rambo Pin Assignments", set

#define X_MAX_PIN -1

(that's line 1673 in my Marlin version); and

#define KILL_PIN 24

(that's line 1730 in my Marlin version)

Then recompile and flash the firmware, then your "Xmax" endstop should act like a kill switch whenever you short the two pins together.

This is all theoretical, as I have not tried it. But it looks perfectly doable.

Oh---and the pin header labeled "Ext2" is general purpose I/O, so you could use that. However, the Marlin code is already configured to have pull-up resistors on the limit switch connectors, so that the input sits at "1" on each of those connector pins until it's grounded by shorting to the ground pin next to it. Presumably, that's exactly what you're looking for in a kill switch.

User avatar
JohnnyRobot
Posts: 128
Joined: Tue Apr 22, 2014 9:25 pm

Re: M2 inputs?

Post by JohnnyRobot » Thu May 28, 2015 1:56 am

Now that sounds promising. I was thinking about wiring it in series with the reset button. Seems too invasive though.

I'll do some tinkering and let you know how it goes.
╒═════════════════════════════════════════════════════════╕
-- Hi! No signature here.
╘═════════════════════════════════════════════════════════╛

lem
Posts: 162
Joined: Thu Jan 15, 2015 6:44 pm

Re: M2 inputs?

Post by lem » Thu May 28, 2015 5:14 pm

Okay, I'm probably going to sound like an idiot when i ask this, but what exactly is the firmware for this?
@jules

I hope I understand your question, if not maybe I'm in the idiot group. Uh, I guess I am in the idiot group anyway.

Firmware is generally considered to be programming that resides on a hardware device that makes that device function. It deals with the hardware features on a device and removes some of the burden of knowing how all the computer/electronics chips work. It's basically just software, but for the code that actually runs on the device (in this case the M2) it is frequently referred to as embedded code. It is called firmware just because of historical precedents. The embedded code used to reside in chips that could be programmed once and if you needed to change the code you had to "burn" a new chip a replace the one that had the old code in it. That was a pain so they developed chips that could be modified "in-circuit". You still had to reprogram the chip with a special device (EPROM programmer, etc.).

Now most embedded systems just use flash memory and a microprocessor. When you want to change the firmware, you just download a new version into the flash memory and then the next time you start your device it runs the new code.

Probably more than you wanted to know, but there's more if you are interested.

Larry

User avatar
Jules
Posts: 3144
Joined: Wed Jan 21, 2015 1:36 am

Re: M2 inputs?

Post by Jules » Thu May 28, 2015 8:38 pm

lem wrote: I hope I understand your question, if not maybe I'm in the idiot group. Uh, I guess I am in the idiot group anyway.

Firmware is generally considered to be programming that resides on a hardware device that makes that device function. It deals with the hardware features on a device and removes some of the burden of knowing how all the computer/electronics chips work. It's basically just software, but for the code that actually runs on the device (in this case the M2) it is frequently referred to as embedded code. It is called firmware just because of historical precedents. The embedded code used to reside in chips that could be programmed once and if you needed to change the code you had to "burn" a new chip a replace the one that had the old code in it. That was a pain so they developed chips that could be modified "in-circuit". You still had to reprogram the chip with a special device (EPROM programmer, etc.).

Now most embedded systems just use flash memory and a microprocessor. When you want to change the firmware, you just download a new version into the flash memory and then the next time you start your device it runs the new code.

Probably more than you wanted to know, but there's more if you are interested.

Larry
Nope, that was exactly what i needed to know, and a good job of explaining. I was a bit confused between that and Marlin I guess. (Thought they were the same thing.) :)

jsc
Posts: 1864
Joined: Thu Apr 10, 2014 4:00 am

Re: M2 inputs?

Post by jsc » Thu May 28, 2015 9:38 pm

They are the same thing. Marlin is the name of the firmware.

Post Reply