Page 2 of 5

Re: I have a strange question

Posted: Wed May 21, 2014 5:29 am
by jimc
hmmm not off hand. i havent really done much with custom gcode. here is a list of gcodes for marlin.

gcodes.txt.zip
(2.73 KiB) Downloaded 436 times

Re: I have a strange question

Posted: Wed May 21, 2014 5:45 am
by Toby
there is the G4 Pm command which might do what you want. according to the docs it causes the machine to do nothing for m milliseconds. Presumably if you issued that command before your kill command it would wait the given amount of time before executing the kill. Should be easy to test with another gcode command.

Re: I have a strange question

Posted: Wed May 21, 2014 6:39 am
by jsc
Any headers other than the MOSFET connections should give you 5V at full scale. You do not want to use anything other than 255 and 0. If I were you, I would pick out the pin I want and make sure I could control it through gcode first.

Here is a table of the pins you need: http://reprap.org/wiki/Rambo_development. You are only interested in the ones that have an Arduino pin name, that happen not to be otherwise used; so that doesn't include the EXT2 header I alluded to earlier, as those don't have Arduino pins assigned. Your best bet looks to be the PWM Extension header, as it is unpopulated. That is the male header just above the Atmel chip in the middle (or just to the left, as you view it from the front of the M2). So, for example, from that table you will note that pin 26, which is Arduino digital pin 13, says it connects to PWM-Ext 3 and an LED. Sending "M42 P13 S255" does indeed light up an LED just to the left of the USB jack, and you should see 5V on the third pin up from the bottom (viewed from the front of the M2) on that extension. Maybe use another one of the PWM-Ext pins that doesn't have an LED on it to rob you of power, if you're going to be driving a relay. Remember, you are going to be limited to however much power a digital pin will put out, I think 40 mA, so you should make sure your relay can be tripped with that amount of current.

Pin 1 and 2 on that header are VCC and GND, so you can power your circuit from there, too.

Re: I have a strange question

Posted: Wed May 21, 2014 6:41 am
by jsc
What did you order, out of curiosity?

Here is a brief discussion on using a relay to switch power to the M2: viewtopic.php?f=2&t=172&p=1277&hilit=relay#p1277

Make sure your relay can handle more than 300W.

Re: I have a strange question

Posted: Thu May 22, 2014 12:43 am
by robkiller
jsc wrote:Yes. M42 P[pin] S[value]. I use it to turn my lights on and off and dim them. The firmware won't allow you to control certain pins if they're listed as being used by some important function so you may have to modify it. First, figure out which pin you want to control...
So I tried using pronterface to send a M42 P4 S150 it said sending but the pin 4 in the ext2 headed did not change. Did I do it wrong?

Re: I have a strange question

Posted: Thu May 22, 2014 12:48 am
by robkiller
I just read the updated post I will try that. I am hopping to pull 12v. I dont need many ma just volts. As soon as I get it working I will list parts.

Re: I have a strange question

Posted: Thu May 22, 2014 1:12 am
by robkiller
jsc wrote:Any headers other than the MOSFET connections should give you 5V at full scale. You do not want to use anything other than 255 and 0. If I were you, I would pick out the pin I want and make sure I could control it through gcode first.

Here is a table of the pins you need: http://reprap.org/wiki/Rambo_development. You are only interested in the ones that have an Arduino pin name, that happen not to be otherwise used; so that doesn't include the EXT2 header I alluded to earlier, as those don't have Arduino pins assigned. Your best bet looks to be the PWM Extension header, as it is unpopulated. That is the male header just above the Atmel chip in the middle (or just to the left, as you view it from the front of the M2). So, for example, from that table you will note that pin 26, which is Arduino digital pin 13, says it connects to PWM-Ext 3 and an LED. Sending "M42 P13 S255" does indeed light up an LED just to the left of the USB jack, and you should see 5V on the third pin up from the bottom (viewed from the front of the M2) on that extension. Maybe use another one of the PWM-Ext pins that doesn't have an LED on it to rob you of power, if you're going to be driving a relay. Remember, you are going to be limited to however much power a digital pin will put out, I think 40 mA, so you should make sure your relay can be tripped with that amount of current.

Pin 1 and 2 on that header are VCC and GND, so you can power your circuit from there, too.
So I can use the extra extruder plug but I dont want to for future growth. I was looking at digital pin 4 but I dont want it to conflict with anything and I dont know if it runs anything we use. I tried digital pin 4 but it did not work. I wonder if I have the wrong pin location. Do you have any pin suggestions that are not used that can give 12v low ma? I got 24v out of the unused extruder but I dont want to use that.

Re: I have a strange question

Posted: Thu May 22, 2014 1:54 am
by robkiller
So if we cant find a 12v switched pin that is not used. I think i can get a 5v one to work. I just need to find an unused 5v pin that i can control.

Re: I have a strange question

Posted: Thu May 22, 2014 2:04 am
by jsc
Use S255. And pin 4 is not in the EXT2 header, as I said you can't access any of the EXT2 pins from gcode because they do not have Arduino pins assigned. Make sure you are probing the right header. Use the PWm-Ext header, which is the one just to the left of the main Atmel chip.

If you test with pin 13, you can see it turn on and off and be confident it is on when you are probing for it.

There are no 12V switched outputs that are not used, or wouldn't conceivably be used in a dual extrusion situation. You can make your own by pulling off the 12V rail and switching through a transistor.

Re: I have a strange question

Posted: Sat May 24, 2014 12:38 am
by robkiller
So pin 13 works but I assume since it is attached to the light it will come on and off a lot. Is there another pin on the pwm ext that is not being used by the m2 and can be switch on and off?

I see digital pin 5 (PWM)has function pwm-ext 5
I see digital pin 4(PWM) has function pwm-ext6

Are any of those really being used? I woukd think these are switchable no?