I have a strange question

Have questions or comments about Simplify3D, Slic3r, Cura, Reptier, etc? Or wondering about which CAD software to use...discuss it here...
User avatar
jimc
Posts: 2888
Joined: Wed Apr 09, 2014 11:30 pm
Location: mullica, nj
Contact:

Re: I have a strange question

Post by jimc » Wed May 21, 2014 5:29 am

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 156 times

Toby
Posts: 330
Joined: Wed Apr 09, 2014 9:44 pm

Re: I have a strange question

Post by Toby » Wed May 21, 2014 5:45 am

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.

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

Re: I have a strange question

Post by jsc » Wed May 21, 2014 6:39 am

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.
Last edited by jsc on Wed May 21, 2014 6:45 am, edited 1 time in total.

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

Re: I have a strange question

Post by jsc » Wed May 21, 2014 6:41 am

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.

robkiller
Posts: 45
Joined: Mon May 19, 2014 10:32 pm

Re: I have a strange question

Post by robkiller » Thu May 22, 2014 12:43 am

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?

robkiller
Posts: 45
Joined: Mon May 19, 2014 10:32 pm

Re: I have a strange question

Post by robkiller » Thu May 22, 2014 12:48 am

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.

robkiller
Posts: 45
Joined: Mon May 19, 2014 10:32 pm

Re: I have a strange question

Post by robkiller » Thu May 22, 2014 1:12 am

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.

robkiller
Posts: 45
Joined: Mon May 19, 2014 10:32 pm

Re: I have a strange question

Post by robkiller » Thu May 22, 2014 1:54 am

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.

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

Re: I have a strange question

Post by jsc » Thu May 22, 2014 2:04 am

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.

robkiller
Posts: 45
Joined: Mon May 19, 2014 10:32 pm

Re: I have a strange question

Post by robkiller » Sat May 24, 2014 12:38 am

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?

Post Reply