Universal G-Code Sender Bogging/Unresponsive

Post Reply
MThomas
Posts: 15
Joined: Tue Feb 10, 2015 9:22 pm

Universal G-Code Sender Bogging/Unresponsive

Post by MThomas » Thu Jun 04, 2015 3:47 pm

I have been working on a modified shapeoko project for quite a while now, I have had the machine up and running, it does profiles and moves just how I expect it to. I send my code with UGCS and in the past it has worked great.

Recently I added a 5v -24v relay and two solenoids which act oppositely to one another in order to control a valve(see my most recent post if you would like an explanation of the valves use), it is a two module relay controlled by the Arduino Coolant enable/disable pin. The relay receives 3v and 5v from the Arduino, both the solenoids are 24v with an independent power supply.

This brings me to the issue that I cannot seem to find a solution to. When I power everything up and open UGCS, everything starts normally, I get an Active State: Alarm, as per usual. I unlock it, it behaves normally, homes, command line or keyboard jogs as usual. The problem begins when I begin using M8/M9 to cycle the solenoids. I noticed it first, after I originally hooked up the relay and solenoids. It would cycle the solenoids relatively quickly, as fast as I typed or macro toggled M8/M9. Then it began to bog down and it would cycle long after seconds to nearly a minute after the command was sent. I thought maybe I had just gone faster than it could handle, I reset everything, and it behaved normally until I cycled the solenoids again, this time I very slowly toggled the solenoids (once every 30 seconds or so, it should be capable of multiple times a seconds [when powered solely by 24v, no arduino, it goes as fast as I can move my hand]) it cycles one time and then begins taking an inordinate amount of time.

I am curious if anyone else has experienced such bogging or lag issues with UGCS or if this is perhaps unique to trying to control too many peripherals with the Arduino.

I did run a program that I had written that performs a profile with the M8 at the beginning and M9 at the end just to see how it affected things. It ran normally, except for bogging down at the end, and then caused UGCS to lose track of the machine and work positions, it started at 0,0,0 and 0,0,0 and ended with a both at something like 4,-56,7. Despite these values, the machine was back at the location defined at 0,0,0 in my setup. On top of this, after the program ran, I tried to re-zero and or home, I get an error that homing is not supported (despite having homed my machine less than 5 minutes earlier).

I admit, I am no electronics guru, and most of what I know I have learned while tackling this project, so I may have made some fundamental error when putting things together, but I have had two coworkers who are somewhat better versed in electronics than I, both scratched their heads.

I apologize for the wall of text, but I wanted to provide as much information as possible.

Thanks in advance for any insight,

-Miguel

Will Winder
Posts: 435
Joined: Fri Apr 20, 2012 2:40 pm
Location: Hudson, MA
Contact:

Re: Universal G-Code Sender Bogging/Unresponsive

Post by Will Winder » Thu Jun 04, 2015 7:59 pm

Could you post the program you're using?
Does the problem occur even when running against GRBL with the motors/solenoids detached or powered off?

It looks like GRBL synchronizes program execution (with a feed hold) prior to each M8/M9 which might be whats slowing things down depending on how many of these you're doing.
ShapeOko #367: Dual-Y drive, Belt on outside, 1000mm Y-Axis, DW660 Spindle, Nema-23 X/Y motors.

Primary developer on Universal Gcode Sender.

MThomas
Posts: 15
Joined: Tue Feb 10, 2015 9:22 pm

Re: Universal G-Code Sender Bogging/Unresponsive

Post by MThomas » Mon Jun 08, 2015 9:04 pm

Very interesting, I think you may have hit on something.

When I don't power the Gshield, just arduino, and thus solenoids, the program runs and completes, no errors, solenoid activates and deactivates as it should. As a further test, I also cycled the solenoids about 100 times, without problems. So it seems the problem is likely related to too much draw or interference from the motors? This is where my lack of electronics knowledge makes trouble shooting difficult. Do you have any suggestions of where to start?

Here is my program for reference, it is quite simple, just a profile essentially. As you can see, there is only one M8/M9 pair in the program, it simple turns the valve on at the beginning of the program and off at the end.

G21 G90 G64 G40
G0 Z3.0
G17
G0 X124.5 Y56.0
G0 Z1.1
G1 F300.0 Z-0.3
M8
G1 F5500. Y73.9985
G3 X114.9985 Y83.5 I-9.5015 J0.0
G1 X108.625
G1 Y104.15
G3 X99.125 Y113.65 I-9.5 J0.0
G1 X23.375
G3 X13.875 Y104.15 I0.0 J-9.5
G1 Y83.5
G1 X7.5031
G3 X-2.0 Y73.9969 I0.0 J-9.5031
G1 Y56.0
G1 Y9.5015
G3 X7.5015 Y0.0 I9.5015 J0.0
G1 X114.9985
G3 X124.5 Y9.5015 I0.0 J9.5015
G1 Y56.0
G1 X-2.0
M9
G0 Z3.0
G21 G90 G0 Z1.0
G90 G28 X0 Y0


Thanks for your help,

-Miguel

MThomas
Posts: 15
Joined: Tue Feb 10, 2015 9:22 pm

Re: Universal G-Code Sender Bogging/Unresponsive

Post by MThomas » Wed Jun 10, 2015 7:30 pm

I believe that I have discovered the problem. My previous explanation was only true incidentally. I reassembled things and re-did the wiring on a few things, when I ran my program, I again got the limit switch triggered issue. I then thought about how the limit switch could possibly be getting triggered, EMI didn't seem a good enough explanation, so I went for physical reasons. There are no locations in my wiring where the two could be getting crossed, I then had the realization that the arduino/grbl enclosure was a variable, each time I disassembled parts of the wiring, I removed it. When I tested and it worked (randomly) I had the case removed. I reassembled and tried again and it didn't. I then put 2 and 2 together, the threaded studs in the bottom of the enclosure (which are the only non painted and thus conductive part of the enclosure) happen to contact perfectly between the coolant and limit switch pins, but only after the assembly shifted due to the solenoid actuating a couple times. I don't think that I ever would have known had I not been running limit switches in tandem with coolant on/off.

So, hopefully this will be the end of the issue. I have had no issues since adding a small milled piece of acrylic to the base of my stack.

MThomas
Posts: 15
Joined: Tue Feb 10, 2015 9:22 pm

Re: Universal G-Code Sender Bogging/Unresponsive

Post by MThomas » Thu Jun 11, 2015 6:34 pm

I was sadly wrong, my solution was yet another fluke.

I cannot find any pattern to the error.

Cycling the solenoids and resetting after each error I get the following results:

1. 5 cycles Grbl 0.9g ['$' for help] ['$H'|'$X' to unlock]
2. 10 cycles ALARM: Hard/soft limit [Reset to continue]
3. 21 cycles ALARM: Hard/soft limit [Reset to continue]
4. 8 cycles ALARM: Hard/soft limit [Reset to continue]
5. 3 cycles Grbl 0.9g ['$' for help] ['$H'|'$X' to unlock]
6. 2 cycles cycles ALARM: Hard/soft limit [Reset to continue]

I kept going for a little while, but I see no pattern. There are no shorts on any of my limit switches. I cannot see any reason for the solenoids triggering two separate errors. I tried disabling hard limits (I already have soft limits disabled), it simply stopped sending that error, but the other appeared just the same and somewhat more frequently (or so it seemed, I feel as though it is entirely random).

When I run a program with M8/M9 it seems worse, which makes me think interference. I have run the program around 8 times and it has triggered on the first M8 each time. Does anyone have any idea at all how to go about troubleshooting something like this. I am wracking my brain, but nothing seems to make sense.

Sorry for continually closing and reopening this discussion, I really thought I had it figured.

Thanks,

-Miguel

jlauer
Posts: 115
Joined: Thu Jun 26, 2014 9:29 pm

Re: Universal G-Code Sender Bogging/Unresponsive

Post by jlauer » Thu Jun 11, 2015 7:06 pm

Could you, just for the sake of comparison, try out ChiliPeppr to isolate whether it is the Gcode sending process or whether it's your hardware/firmware?

MThomas
Posts: 15
Joined: Tue Feb 10, 2015 9:22 pm

Re: Universal G-Code Sender Bogging/Unresponsive

Post by MThomas » Thu Jun 11, 2015 11:03 pm

I actually tried Chillpeppr awhile back and couldn't get it to run, had a few problems, first was that it interpreted all of my arcs as diagonal lines, tried a little to get that worked out, but I also had trouble actually connecting to Serial Port JSON Server. I had already had success with UGCS prior to that experiment, so I guess I defaulted. If you can point me toward a walkthrough of getting Chillipeppr set up, Id be happy to try it out.

Some good news,

I don't have a really good background in electronics as I have mentioned, but I have a co-worker who does a little more of that side of things. I had narrowed it down to being some type of feedback from the solenoids causing the limit issue. I added a LED to each of the solenoids as a sort of faux-fly-back diode, it eliminated, as far as I can tell, the limit issue when simple cycling the solenoids through a macro. However, I still get the issue where after I run my program a few times, so far its two times in a row, I get UGCS losing its place and stopping exactly at the point at which the M9 code is called. I haven't had a chance to muddle through that one yet.

DRobs86
Posts: 148
Joined: Fri Jun 05, 2015 4:19 am

Re: Universal G-Code Sender Bogging/Unresponsive

Post by DRobs86 » Sat Jun 13, 2015 5:36 am

What about Grbl Controller?

Unfortunately I've had nothing but trouble out of UGS. I had a job fail several times midstream with UGS tonight but I just ran the entire (hour long or so) job with Grbl Controller. If you couldn't run the other software suggested please try that to eliminate G code sending as the cause.

MThomas
Posts: 15
Joined: Tue Feb 10, 2015 9:22 pm

Re: Universal G-Code Sender Bogging/Unresponsive

Post by MThomas » Mon Jun 15, 2015 5:51 pm

Unfortunately I just had my power supply fail, and somehow it seems to have fried my Gshield, not exactly sure what happened, but I wont be able to test anything until I get my new one. Before it failed I tried one run on Grbl and it had my axis inverted for some reason, but before I could attend to that, poof, no more testing for a few days at least.

Thanks for the reply,

-Miguel

tm america
Posts: 84
Joined: Tue Feb 04, 2014 5:58 pm

Re: Universal G-Code Sender Bogging/Unresponsive

Post by tm america » Wed Oct 26, 2016 5:58 pm

Are you running diodes on your solenoids?If not you are likely back feeding the controller when the solenoids turn off.. You need to install a flyback diode to dissipate the current from the solenoid.I had similar issues when wiring in the air control valves on my machines for the plate marker option .Although i am running megatronics v2.0 it is still arduino and was causing the same issue if i didn't install the diode..I will try to test this with the gshield or cnc shield when i get some time..I am guessing this is your problem

Post Reply