Help with Simple Triggers for Switches
February 22, 2023 07:46PM
Edi's Locker Bot Auto Mode Issue

Hi all, I need HELP!, we have a few three axes robots with a gripper that is used to move small parts to and fro.
I'm using triggers to check for switch closure. If you have an easier way of dealing with Inputs, I would be grateful.
Trigger issue, with a robot repeating a task over and over.


Duet 2 WiFi
FIRMWARE_NAME: RepRapFirmware for Duet 2 WiFi/Ethernet
FIRMWARE_VERSION: 3.4.0
ELECTRONICS: Duet WiFi 1.02 or later FIRMWARE_DATE: 2022-03-15 18:58:33

See
Attached "config.g"
Attached "Edis Locker Module 1 Template 4-29-2022 Edis.g"
Trigger3.g ; set global.Auto = true
Trigger4.g ; set global.Auto = false
Trigger5.g ; Start Button RUN global.filename


While in auto mode, "global.TAuto = True", Trigger input pin Exp. Pin 9 Active Low

Auto Mode: At the end of a cycle through the G code (Edis Locker Module 1 Template 4-29-2022 Edis.g) the G code is executed again if

global.TAuto = True.
(see below)

Single Cycle: is one pass through the G Code. global.TAuto = False, Trigger input pin Exp. Pin 9 pulled high via 27K I believe.

Recently after having performed a few hundred thousand cycles across many resets, months and different parts, this robot has

decided (when in auto mode) at random times, it will stop executing G code at the end of the current cycle.

when stopped, Status is: Variable, global. TAuto = false (indicates that the Auto switch is open when it has been verified closed.)

This condition has been observed with pin nine of the expansion port connected directly to ground.

Also on a few occasions when the auto switch was turned to the single position from the auto position, the robot would continue

running from one to a few cycles of the code and then stopping without operator intervention.

This by all accounts is a random occurrence, it might stop after 10,000 pcs or 3.
Could it be that the trigger inputs are being ignored?

Am I missing something about triggers?
I observed both (Start & Auto) switch inputs with a DOscope out to 2ns/div @ 50mv/div, Not enough noise to mention.
And this condition has been observed with pin nine of the expansion port connected directly to ground.
When in Auto Mode, The Trigger input pin Exp. Pin 9 pulled down.

Nothing was changed on two robots that have this issue. smiling smiley)
This issue has manifested over time which leads me toward a bad connection.
I have performed many electrical tests including changing the connector for the expansion port.

I have placed at the beginning and at the end of "Edis Locker Module 1 Template 4-29-2022 Edis.g" echo global.TAuto as well as

inserted the echo in the trigger files.
global.TAuto always tracks the switch and is very responsive to changes in the switch position.
Someone is changing the value of global.TAuto.


I placed the following at the start of "Edis Locker Module 1 Template 4-29-2022 Edis.g" thinking the M582 would check the switch just

prior to making the decision to run again.

At the end of running "Edis Locker Module 1 Template 4-29-2022 Edis.g" .

; Wait for motion to complete
M400

; Check for Auto mode.
M582 T3

; If global.Auto is true (Pin = LOW) then Run the pgm. again.
if global.TAuto = true
M32 {global.PartFilename}

Perhaps I don't understand Triggers.
Attachments:
open | download - config.g (11.1 KB)
open | download - Edis Locker Module 1 Template 4-29-2022 Edis.g (5.5 KB)
open | download - Trigger3.g (35 bytes)
open | download - Trigger4.g (39 bytes)
open | download - Trigger5.g (43 bytes)
Re: Help with Simple Triggers for Switches
February 26, 2023 01:15PM
Hi Techman2930, please post on [forum.duet3d.com] where our support staff and the RepRapFirmware community will be pleased to help you. It may help if you post a M122 diagnostic report taken after the fault has occurred and before you power down or otherwise reset the Duet.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Sorry, only registered users may post in this forum.

Click here to login