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...
robkiller
Posts: 45
Joined: Mon May 19, 2014 10:32 pm

I have a strange question

Post by robkiller » Mon May 19, 2014 10:38 pm

Is there a command that I can place with in the print code to send voltage to an unused pin or port on the rambo? Example I know with my gcode I have my m2 after a print is done cooling the item down with a few passes and then bring the item all the way forward so its easy to remove. Am I able to use a command that I can place in the gcode to provide a voltage of some sort to a pin or unused plug? I have a plan if I can do this.

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

Re: I have a strange question

Post by jsc » Mon May 19, 2014 11:41 pm

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...

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

Re: I have a strange question

Post by robkiller » Tue May 20, 2014 1:29 am

Thanks thats good!

So can I pull voltage off of any pin or only a select few? What pin do you use to control your lights? And at what voltage can it go to? I assume 5 or 12 max.

If you have an M2 I would think I have the same pin avalible.

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

Re: I have a strange question

Post by jsc » Tue May 20, 2014 1:56 am

You can control any pin that's not being used by something else. I commandeered the MOSFET output for, I think, HEATER1, the heater for the second extruder. You will need a two position MOLEX screw terminal, and disable it as a heater pin in the firmware in order to bring it under gcode control. I recommend you check out cmenard's Marlin fork if you plan to do any custom firmware hacks, as it is more up to date than the stock firmware.

What voltage you get depends on where you plug into it. If there are any logic level headers connected to an unused pin, that would give you 5V at, maybe, 40 mA. I haven't really scoured the board to see if there are any of those lying around. If you pull from anything that would normally drive a heater, fan, or motor, you will get either 12 or 24V depending on the vintage of M2 you have. Certain pins are "analog" pins, which just means you can PWM their output. That is not true voltage control unless you stick a big capacitor on there.

What are you planning to do?

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 » Tue May 20, 2014 2:00 am

hey rob, nice to see you here. jin will have to comment on the pins. your machine i believe is the newer 24v one so i believe you should be able to pull 0-24. i know your machine was right around that time when the 24v setup came out. if you have the old 2 brick version then it would be 0-19v


oops looks like we were posting at the same time

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

Re: I have a strange question

Post by robkiller » Tue May 20, 2014 3:32 am

I do have 24v.

I am going to creat a circuit the will allow for a code in the gcode to turn off the printer and power supply when its done. This way its not just running for hours waiting for me to turn it off.

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

Re: I have a strange question

Post by jsc » Tue May 20, 2014 3:55 am

You will probably want to be using an external 5V relay, then. It looks like many of the logic pins are brought out to the EXT2 header, so you should be able to pick one of those and try toggling it through gcode.

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

Re: I have a strange question

Post by robkiller » Wed May 21, 2014 4:37 am

So if I wanted say pin1 on the ext2 header to give me 5v I just say M42 P1 S5. That will do it? Is there a time delay I can add until the command is done?

I ordered the electronics today so I can make the circuit.

Thanks for all the good help.

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 4:40 am

rob the "S" value goes from 0-255. the # doesn't reference a specific voltage. 255 is full voltage, 0 is no voltage. 5 volts could be anywhere in between.

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

Re: I have a strange question

Post by robkiller » Wed May 21, 2014 5:25 am

Ok so my thought is correct just not the number 5. So I can test that to see what the number would be. Any thoughts on the command to delay a command

Post Reply