This has been so frustrating! I've been trying to do my first multicolor print job, using the 4 square example I found somewhere here. It worked great for the first two colors, but failed to produce 3 pulses to choose T2, instead producing 4 pulses to choose T3. I finally created a GCode test file to test the half second delay:
; *******************************************
; This is to test the 3D Chameleon switch timing
; *******************************************
;; Reset feed rate and flow rate.
G90 ; Set all axes to absolute
M220 S100 ;Set Feedrate
;M221 S100 ;Set Flow Rate
G28 ; home all axis
G0 Y235 F2000 ; Switch Triggers @ Y238
M117 Testing
G4 P10000 ; wait 10 seconds
G91 ; move to relative mode
; press the button
G0 Y3 F2000
;Test Reset Command
G4 P3500 ; 3.5 seconds to trigger Reset
; release the button
G0 Y-3
M117 Reset Test Complete
This should produce 7 Pulses to reset the Chameleon. Instead, it produces 8 pulses!
I experimented with the delay and arived at (450ms * 7) to get the 7 pulses. I then wrote this code to try setting the delay:
; *******************************************
; This is to test the 3D Chameleon switch timing and set it to 1/2 second.
; *******************************************
;; Reset feed rate and flow rate.
G90 ; Set all axes to absolute
M220 S100 ;Set Feedrate
;M221 S100 ;Set Flow Rate
G28 ; home all axis
G0 Y235 F2000 ; Switch Triggers @ Y238
M117 Testing
G4 P5000 ; wait 10 seconds
G91 ; move to relative mode
; press the button
G0 Y3 F2000
;Test Reset Command ; 3500 give 8 pulses. Changed to 450 per half sec.
G4 P3150 ; 3.5 seconds to trigger Reset
; release the button
G0 Y-3
M117 Reset Test Complete
G4 S5
M117 Press for 15 pulses
G90
G0 Y150 F2000 ; Move out of the way to press manually
G4 S10 ; Wait 10 seconds for command to be entered
G0 Y235 F2000 ; Position for triggering again
G4 S2
G91
G0 Y3 F2000
G4 P500 ; Press for 1/2 second
G0 Y-3 F2000
G4 S5 ; Wait 5 seconds
G0 Y3 F2000
G4 P1000 ; Press for 1 second
G0 Y-3 F2000
M117 Test again
Unfortunately, this results in about 1/4 second pulses. I'm at a loss...
Be careful here, G4 delay needs to be added to the travel time of the printer to come up with the total amount. The machine pressing the button needs to calculate the distance over speed to add to the G4 dwell.
On T0, that value needs to be calculated, but T1-T3 need to simply add the additional pulse delay to T0.
Bill