Inconsistent Interrupt behavior

@Kevin_Flint …hardly. But what I have is stable so I’m feeling good.

If you’re controller browns out because the motor sags the voltage lines then yeah you might have problems. This is totally out of my wheelhouse there may be other problems as well.

Maybe what you have is another thread that hangs after the Go_Until… does it end with a Thread.Sleep() or anything that would yield to another thread before going to your breakpoint that never hits?

1 Like

@jwizard93 Hm that might actually be what is happening…I noticed this board is drawing 30 mA off my 3.3V line ONLY when the motor starts spinning, but the motor is powered off the 24 V line (so it definitely isn’t the logic lines of the motor controller drawing it as that is present before motion but am not sure why it would draw this current all the sudden). I didn’t noticed any of this happening on the last boards I built but I also wasn’t sure if I made it this far because I kept burning stuff out. Waiting on parts to build a new one

As for what is after Go_Until - there is a while(motor==busy) loop that I have tried various thread.sleeps in as well as leaving it empty. I put a break inside of this loop - on the times it fails, it doesn’t even enter the while loop - which fits perfectly into this brown out scenario - G30 loses connection immediately after the motor starts moving and only in this one spot where the motor draws the most current

Next board I am going to put all the resistors and caps on myself then just let me tech do the IC’s (G30 is too small for me I solder the pins together :stuck_out_tongue:)

@jwizard93 would it brown out intermittently like this though? The part where it is having issues definitely is the most current intensive motor motion, I also sometimes here a ding like the G30 is disconnecting

Then there you go. You are probably losing the G30 due to voltage sag.

When you don’t totally lose it then you are in the netherworld of potential data corruption. No idea how well the G30 protects itself from that.

Can your power supply handle the full load and do it quickly? If so then you need to find a way to isolate the motor and the digital circuits. Sometimes a simple cap between power and ground close to the motor helps. Wouldn’t hurt to put more capacitance close to the G30 as well. I have tons of capacitance on mine because my motor can go from idle to 7.5 Amps in a ms. Made sure my battery could dump 10A in less time, but even just inductance in the power cables made me want to slap some extra caps on there. Research bypass capacitors (for the motor) and reservoir capacitors (for the G30).

If all else fails separate your power supplies and systems completely and command the motor with light.

1 Like

@jwizard93 yes the PSU’s can handle it (only drawing like 300 mA tops when moving the motor).

This has to be it!! It makes so much sense…since I am only using the front board right now, the 100 uF cap I have on the 24V line is on the other board. I have a 100 nF near the motor but nothing big on the 24V line (all my regulators and everything are on the other board I haven’t started testing yet.

What do you mean by “command the motor with light?”

Except why would this only be in issue running the debugger?? Or do you think it is also happening without it too I just don’t notice?

Would you notice it if the app was restarting? I can’t answer that. All I know is that the windows shouldn’t ding when you run the motor. And if that 30 ma is only through the G30 board and only when the motor draws high current then its probably shifting the ground plane and it needs to be bypassed.

Commanding the motor with light is more expensive but sometimes a viable path forward when the circuits just can’t get along. An Optocoupler takes an electrical signal on one side and puts out a copy of the same signal on a separate circuit. Internally the signal is transmitting from one side to the other via light so the two circuits are not tied together in any way electrically. You probably don’t need this.

sigh…

1 Like

@Mike I got on here to answer the question he asked me, was already off work so I was not going to start a forum search yet (spent hours searching it already previously) when I don’t even need to since it seems my problem is a hardware issue anyways. Can you please try to act professional? I am sick of your snarky comments, its completely unnecessary.

@jwizard93 That sounds so badass…

@jwizard93 well I added a 220 uF to the 24V line on that board and guess what, it works!!! My display that I thought was blown out also immediately startedd working

1 Like

Check the GetStatus command every once in a while to verify that the stepper didn’t encounter an error like over heating or undervoltage lockout. Also, check the hardware flag pin after each series of commands.

I assume this is a custom board? The above issues do point to some kind of power dip.

How are the power rails laid out? Are you using a 4 layer board with one plane as ground and one plane as power? This is the ideal way to ensure good power to your board. You can even use the inner power plane with splits planes to carry other power to parts of your board that need more current.

If this is a 2 layer board, what thickness is your tracks to the power rails?

What type of power supply are you using to generate the 3.3V for the processor?