sending commands directly to m2

General discussion topics
Post Reply
imsmooth
Posts: 67
Joined: Sun May 04, 2014 10:39 pm

sending commands directly to m2

Post by imsmooth » Sat Jun 14, 2014 6:06 pm

If I want to turn the fan on or off can I type and send a code? This would be similar to me jogging the m2 and testing the motors.

I'm guessing this is the SEND line. However, I don't know what the commands are for the fan or anything else. Is there a tutorial that explains the commands? I did find a list on Wiki.

Also, I noticed my 50mm fan is not on; just the 40mm fan. It only moves if I send a code of M106 S240 or higher.

User avatar
jimc
Posts: 2888
Joined: Wed Apr 09, 2014 11:30 pm
Location: mullica, nj
Contact:

Re: sending commands directly to m2

Post by jimc » Sat Jun 14, 2014 9:42 pm

here is a list

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

the 50mm fan is right. it needs full power to start then you can turn it down a bit

imsmooth
Posts: 67
Joined: Sun May 04, 2014 10:39 pm

Re: sending commands directly to m2

Post by imsmooth » Sat Jun 14, 2014 10:06 pm

What are some good general post-script commands to add to the end of a build? Things like cool extruder and stuff like that...

Thanks

Dale Reed
Posts: 376
Joined: Thu Apr 10, 2014 1:39 am
Location: Cleveland Heights, Ohio USA

Re: sending commands directly to m2

Post by Dale Reed » Sat Jun 21, 2014 11:14 pm

imsmooth wrote:Also, I noticed my 50mm fan is not on; just the 40mm fan. It only moves if I send a code of M106 S240 or higher.
smoothie,

There was a batch of fans (a particular brand) supplied with the M2 for a while that did not like the pulse-width modulated (PWMed) power from the RAMBo. The default PWM frequency, set in firmware, is 31.xx kHz, and it confuses the little bit of electronics in the fan that is used for commutation. (It's a brushless DC fan motor, so the commutation is done electronically.) There is a mod for the firmware to change the PWM frequency to 400 Hz, which works well with all the fans I've tried. Or just get a replacement 50mm fan, either from MG (which will include the Molex connector already terminated) or at any computer store (you'll have to splice). If you get the fan from other than MG, make sure it is 10 mm thick and a ball bearing type, not a sleeve bearing type.

The fans I've purchased run well even at 31.xx kHz PWM. ALL fans I've tried (about 7 brands) work great on 400 Hz PWM down to about 20 to 30% duty cycle on the power (a setting of about 50 to 75 on the 255 scale). I even set up an Arduino with the motor shield for testing fans. I was testing a bunch so I could post the results when my laser tachometer died. Just got a new one and finished some business travel, so I might soon have time to finish testing and publish the results.

Dale

User avatar
DIY3D
Posts: 36
Joined: Fri May 02, 2014 11:27 pm

Re: sending commands directly to m2

Post by DIY3D » Sun Jun 22, 2014 12:51 pm

imsmooth wrote:What are some good general post-script commands to add to the end of a build? Things like cool extruder and stuff like that...

Thanks
You're asking end codes but I'll post both my (just copy's from others), Start ansd End code. Perhaps you can use it.

Start code:

M201 X1500 Y1500
M204 S1500 T2500 ; Acceleration: S=acceleration, T=retract acceleration
M205 X2 ; X=maximum xY jerk (mm/s)
M84 S0 ; don't let go of motors
M108 S155 ; make sure extruder and electronics fans are running
M140 S60 ; bed temp
M104 S200 ; use M104 S{print_temperature} in cura
; now we've started heating, but let's move off the platform while we wait (and drool)
G28 X0 Y0; home X and Y
G1 F10800 ; set high speed
G1 Y23 ; move into the platform along Y
G1 X240 ; move off the platform end along X
G28 Z0 ; home Z now - blobs won't hit the platform
G1 F400
G1 Z10 ; lift Z a little
M190 S60 ; heat bed
M109 S200 ; heat nozzle
G28 Z0 ; home Z
G92 E0 ; reset extruder position to 0
G1 F300 ; set suitable speed
G1 E25 ; extrude 25mm
G92 E0 ; reset extruder position to 0 - needed for cura/SF
G1 F10800 ; set wipe speed
G1 X0 ; wipe nozzle and move to X0
M220 S50

End code

M201 X1500 Y1500
M204 S1500 T2500 ; Acceleration: S=acceleration, T=retract acceleration
M205 X2 ; X=maximum xY jerk (mm/s)
M84 S0 ; don't let go of motors
M108 S155 ; make sure extruder and electronics fans are running
M140 S60 ; bed temp
M104 S200 ; use M104 S{print_temperature} in cura
; now we've started heating, but let's move off the platform while we wait (and drool)
G28 X0 Y0; home X and Y
G1 F10800 ; set high speed
G1 Y23 ; move into the platform along Y
G1 X240 ; move off the platform end along X
G28 Z0 ; home Z now - blobs won't hit the platform
G1 F400
G1 Z10 ; lift Z a little
M190 S60 ; heat bed
M109 S200 ; heat nozzle
G28 Z0 ; home Z
G92 E0 ; reset extruder position to 0
G1 F300 ; set suitable speed
G1 E25 ; extrude 25mm
G92 E0 ; reset extruder position to 0 - needed for cura/SF
G1 F10800 ; set wipe speed
G1 X0 ; wipe nozzle and move to X0
M220 S50

I use this codes both in Repetier and Cura

Kind regards,
Marco

Dale Reed
Posts: 376
Joined: Thu Apr 10, 2014 1:39 am
Location: Cleveland Heights, Ohio USA

Re: sending commands directly to m2

Post by Dale Reed » Sun Jun 22, 2014 9:34 pm

Hey, Marco! I think you pasted your START code where you meant to paste your END code! Homing the Z axis like that with the part still on it might not be pretty!!!

Here's my end code, for comparison:

Code: Select all

G91 ; relative mode
G1 Z20 ; lift 2 cm
G90 ; absolute mode
G1 F6000 ; medium fast
G1 X200 ; off to right
G92 E70 ; extruder relative pos
G1 F300 ; set speed
G1 E0 ; retract remove filament
G92 E0 ; extruder relative pos
M104 S0 ; turn off extruder
M140 S0 ; turn off bed
M106 S200 ; cooling fan high
G1 F6000 ; medium speed
G1 Y80 ; reasonable Y
G1 F600 ; slow speed
G1 X180 ; move slow right
G1 X20 ; move slow left
G1 X180 ; move slow right
G1 X20 ; move slow left
G1 X180 ; move slow right
G1 X20 ; move slow left
G1 X180 ; move slow right
G1 X20 ; move slow left
G1 X180 ; move slow right
G1 X0 ; move slow left to home
M106 S0 ; fan off
G1 F6000 ; medium speed
G1 Y240 ; present part
M84 ; disable motors
This retracts the filament, turns off the heat, cranks the 50mm fan, moves the fan back and forth for a while to cool the part, then "presents" the part (moving the bed forward) and powers down the motors (bed falls) to save power. The retract is because most of my prints are done unattended...

Dale

User avatar
DIY3D
Posts: 36
Joined: Fri May 02, 2014 11:27 pm

Re: sending commands directly to m2

Post by DIY3D » Sun Jun 22, 2014 10:28 pm

Oops :shock:, sorry imsmooth, I hope I have not ruined your prints ,

Thanks Dale you're absolutely right.

I don't have to post my End code, cause I see it's almost the same one Dale is using.

Kind regards,
Marco

Post Reply