Archim1 GPIO pins?

So I assumed that the Archim1 board would have GPIO pins similar to a pi, and that I could trigger some relays in order to activate my plasma torch, or my router/vacuum.

Doing some digging, and it seems like this might not be the case? I don’t see any lines in the firmware that allow me to define the pins. As well as I’m not sure if any of the pins can even be used for what I want. (J20 is the GPIO header - the pins seem mostly for different arduino communication protocols.)

So that makes me think that I will need to get creative. The relays require 5.5v, 3.3v, ground, and an activation pin for each relay.

So I’m thinking I can source 5.5 and ground from the SERIAL connection. 3.3v from J20 pin 24…the tricky part possibly being the trigger pins. I was thinking the ground pins from fan0 and fan1 or heater0 and heater1. But I’m not sure if those will work? I’m not well versed enough to see if these are in the firmware and able to be commanded.

Any ideas/help?

Yep. I have the Archim 2.0 and the pinout is the same.I use fan0 to do my relay, an IOT power block and fan1 to run my case fan. M106 P0 and M107 P0 to stop.

2 Likes

Fan1 and Fan0 are source voltage, 12-24V though. You can change what pin is used for the fans though, in the pins file. Then M106 will toggle that pin instead, which is probably 5V. You need to be careful that it isn’t drawing current though. Those J20 pins can probably only source 20mA max. It is fine for a digital signal, but not for powering a relay.

2 Likes

Ah, so just using the fan power to trigger a relay instead of going the digital route. I guess I was trying to over complicate it. Less than ideal for my current situation, as I have a stack of 5v relays and no 12v relays. :joy:

IIRC, the relay that Marion has is the IoT relay I posted a while ago from amazon. It takes almost anything as input, so a fan port or a digital output works fine with it.

If you have one of these common relay boards that run off of 5V, you just need to change the fan pin to one of the aux pins, and then use the fan commands with it.

Yea, its the standard 5v relay for raspberry pi’s/arduinos.

I emailed Jason at Ultimachine about it, and he replied:

You should be able to connect RY-VCC to 5V. VCC to 3.3V and the GPIO from Archim to IN1 and IN2

Marlin/Marlin/src/pins/sam/pins_ARCHIM2.h at 2.0.x · MarlinFirmware/Marlin · GitHub

M42 gcode
Set Pin State | Marlin Firmware

Digital pin reference.
Archim2 development - RepRap

Schematic for the J20 pin out
Archim/Project Outputs/Archim2_2.1a_Schematic.PDF at c68ed12ccc4da3c50be3b65031d0f8b64b89efce · ultimachine/Archim · GitHub

Now I just have to figure out how to implement that. I’ve barely dabbled in arduino stuff, so defining the pins and triggering them is not a skillset I have acquired yet.

2 Likes

If you use M42, you don’t have to change any firmware.

So just hook up any of the gpio pins to in1/in2, hook up the 5v, 3.3, and ground like I described earlier, and then just do M42 M3 Pxx in the gcode?

Yep.

Ok…so I hooked everything up and tried to make a simple oval and create the gcode with estlcam. I set the plasma activation along with a 2 second pause to be:

M42 M3 P70
G04 P2000

But no luck. I used the J20 connector pin22 (PA17 aka digital pin 70) Does this code look correct?

Interestingly enough, during my troubleshooting I found that if I tried to print my file, the contents of the file would be NULL after returning the SD card to my computer. I’m not sure if this is because of the file freezing and failing? (EDIT: I’m guessing that M30 code has something to do with the file being emptied?)

I did however take the same activation and dwell codes and paste them into the crown test file and the movements ran as expected. (But no activation of the relay.)

Thoughts?

Oval code:

;Project OVAL
;Created by Estlcam version 11 build 11.221
;Machining time about 00:08:36 hours

G90

G00 X0.0000 Y0.0000 Z0.0000 F2100
G00 Z2.0000 F480

;No. 1: Hole 1
G00 X180.0000 Y180.0000 F2100
G00 Z0.5000 F480
G01 Z-1.0000 F180
M42 M3 P70
G04 P2000
G01 X188.9512 Y183.8660 F480
G01 X161.4090 Y217.2194
G01 X161.1401 Y217.5243
G01 X160.8518 Y217.8109
G01 X160.5454 Y218.0780
G01 X160.2221 Y218.3246
G01 X159.8834 Y218.5494
G01 X159.5308 Y218.7516
G01 X159.1656 Y218.9304
G01 X158.7896 Y219.0848
G01 X158.4042 Y219.2143
G01 X158.0113 Y219.3184
G01 X157.6123 Y219.3965
G01 X157.2091 Y219.4483
G01 X156.8034 Y219.4737
G01 X156.3968 Y219.4724
G01 X155.9913 Y219.4446
G01 X155.5884 Y219.3903
G01 X155.1899 Y219.3098
G01 X154.7975 Y219.2033
G01 X154.4130 Y219.0715
G01 X154.0379 Y218.9147
G01 X153.6739 Y218.7338
G01 X153.3224 Y218.5294
G01 X152.9851 Y218.3025
G01 X152.6634 Y218.0540
G01 X149.6094 Y215.5321
G01 X149.3046 Y215.2632
G01 X149.0179 Y214.9749
G01 X148.7508 Y214.6685
G01 X148.5043 Y214.3452
G01 X148.2794 Y214.0065
G01 X148.0772 Y213.6539
G01 X147.8985 Y213.2887
G01 X147.7440 Y212.9127
G01 X147.6145 Y212.5273
G01 X147.5105 Y212.1344
G01 X147.4324 Y211.7354
G01 X147.3805 Y211.3322
G01 X147.3552 Y210.9265
G01 X147.3564 Y210.5199
G01 X147.3842 Y210.1144
G01 X147.4385 Y209.7115
G01 X147.5191 Y209.3130
G01 X147.6255 Y208.9207
G01 X147.7574 Y208.5361
G01 X147.9141 Y208.1610
G01 X148.0950 Y207.7970
G01 X148.2994 Y207.4455
G01 X148.5263 Y207.1082
G01 X148.7748 Y206.7865
G01 X203.8592 Y140.0797
G01 X204.1281 Y139.7748
G01 X204.4164 Y139.4882
G01 X204.7229 Y139.2210
G01 X205.0461 Y138.9745
G01 X205.3848 Y138.7496
G01 X205.7374 Y138.5474
G01 X206.1026 Y138.3687
G01 X206.4786 Y138.2143
G01 X206.8640 Y138.0847
G01 X207.2570 Y137.9807
G01 X207.6559 Y137.9026
G01 X208.0591 Y137.8508
G01 X208.4649 Y137.8254
G01 X208.8714 Y137.8266
G01 X209.2770 Y137.8545
G01 X209.6798 Y137.9088
G01 X210.0783 Y137.9893
G01 X210.4707 Y138.0957
G01 X210.8552 Y138.2276
G01 X211.2303 Y138.3843
G01 X211.5943 Y138.5653
G01 X211.9458 Y138.7697
G01 X212.2831 Y138.9966
G01 X212.6048 Y139.2451
G01 X215.6588 Y141.7670
G01 X215.9637 Y142.0359
G01 X216.2503 Y142.3242
G01 X216.5174 Y142.6306
G01 X216.7640 Y142.9539
G01 X216.9888 Y143.2925
G01 X217.1910 Y143.6452
G01 X217.3698 Y144.0103
G01 X217.5242 Y144.3864
G01 X217.6537 Y144.7717
G01 X217.7578 Y145.1647
G01 X217.8359 Y145.5637
G01 X217.8877 Y145.9669
G01 X217.9131 Y146.3726
G01 X217.9118 Y146.7791
G01 X217.8840 Y147.1847
G01 X217.8297 Y147.5876
G01 X217.7492 Y147.9861
G01 X217.6427 Y148.3784
G01 X217.5109 Y148.7630
G01 X217.3541 Y149.1381
G01 X217.1732 Y149.5021
G01 X216.9688 Y149.8535
G01 X216.7419 Y150.1908
G01 X216.4934 Y150.5126
G01 X188.9512 Y183.8660
G01 X180.0000 Y180.0000
M42 M2 P70
G00 Z2.0000

M30

Partial Crown Code:

;Project 0102
;Created by Estlcam version 10 build 10.039
;Machining time about 00:02:33 hours

G90
G92 X0 Y0 Z0
G00 X0.0000 Y0.0000 Z0.0000 F2100
G00 X0.0000 Y0.0000 Z5.0000 F500

;No. 1: Engraving 6
G00 X75.2682 Y15.5365 Z5.0000 F2100
G00 X75.2682 Y15.5365 Z0.5000 F500
G01 X75.2682 Y15.5365 Z-1.0000 F210 S20000
M42 M3 P70
G04 P2000
G01 X77.4366 Y15.4952 Z-1.0000 F720
G01 X79.6043 Y15.4295 Z-1.0000 F720
G01 X81.7712 Y15.3396 Z-1.0000 F720
G01 X83.9370 Y15.2253 Z-1.0000 F720
G01 X86.1013 Y15.0868 Z-1.0000 F720

If you can connect your computer to it, you can test this much faster by just sending the command from repetier host.

I am not sure how the archim boards map the pin number, but it should not be M3, it should be S1:

M42 P70 S1

Or, if that is a pwm pin:

M42 P70 S255

I was using M3 to set the pin to pull down, so I probably just need to add the S1 on the end?

I was planning on digging out a laptop today and taking it out to the machine. Got fed up with going back and forth last night. :joy:

Pulldown only applies to input.

Gotcha. It works!

G42 P70 S0 to turn it on

G42 P70 S255 to turn it off

Now I am trying to setup a pierce height and delay in estlcam. Slowly making progress.

This thread has me very hopeful, I’m by no means versed in any of this so everything is new to me but I’m hoping I can set up my Archim v1 to turn on a relay (to power my shop vac) and then turn send a signal to a speed control for my needle cutter. After reading through this thread its got me hopeful that I won’t have to do too much or any updates to the firmware? but was wondering if the above solution could be adapted to control the speed control at the very least? if I understand that last message @Crash85 “S0” would basically be full power and the larger the number (up to 255) reduces the output?