8 years, 5 months ago.

KL25Z randomly stops taking input from buttons

You helped a lot with my last questions on the LEDWiz issue I was having. Thanks for that!

Now that I have my cabinet completely integrated, I am seeing something else strange with the KL25Z itself. at random times it will stop taking button press inputs i.e. flippers don't work for a moment or two (no more than 2 seconds) and the LED goes out. (normally flashing blue to green). When it recovers the led immediately operates as expected and the buttons begin to work. My initial thoughts are that perhaps I am overtaxing USB power with my other USB output devices (Sainsmart 8ch relay board and LEDWiz32). My KL25Z is isolated completely from these other devices (except for the USB).

I've searched other forums looking for a potential cause for this without luck. So, I thought I'd ask you. any thoughts you have on what to look for will be appreciated.

By the way...your pinscape controller is amazing. I couldn't have completed this cabinet project without it.

Thanks!

Cary

Question relating to:

An input/output controller for virtual pinball machines, with plunger position tracking, accelerometer-based nudge sensing, button input encoding, and feedback device control.

2 Answers

8 years, 5 months ago.

You say it is isolated except for USB, but have you tried giving it a separate USB power supply? You can try what happens if you use the other USB port (the KL25 one instead of the SDA one) if you didn't already use that one: Then the debug interface is not powered (but you also cannot send serial data, I don't know if that lib uses it, I didn't check all code considering how extensive it is. Btw checking that code was quite funny, pretty much every major library I made is in it :D. Nice to see it getting used).

Plan B is of course simply using a separate supply for the KL25. How are you connecting it now? Are they all powered via a USB hub for example? Is that a powered USB hub? (If no, consider using a powered one).

I'm good with using a separate PS for the KL25. I didn't realize that was an option. Right now it is connected only via the "Joystick" port and it and the other devices are not on a powered hub.

Are you saying I can power the KL25 from the "Programming" port with a separate power supply?

I think I'll try the powered USB hub just to insure I don't have similar issues with my other controllers.

Thanks so much ...(again)

posted by Cary Owens 30 Oct 2015

It just occured to me that I didn't explain what I meant by completely isolated. Early in my integration activity I attempted a star type grounding scheme for my devices. I started having unexpected behavior so I isolated the devices to use their own grounds. Also I was using the USB5V from the KL25 to power a couple of low power devices that were controlled by the LEDWiz (again with strange behavior). So to elliminate the possiblility of the devices interfereing with one another. I ensured that there was no "interconnectivity" of any kind (grnd, 5V ect.) except for being plugged into the same USB "bus" on the PC.

posted by Cary Owens 30 Oct 2015

Ah of course you need that USB port (not familiar with the Pinscape lib myself).

Are they now on a hub, or for example to different USB ports of a laptop? In that case each USB port should have its own supply, if they are on an unpowered hub they share a single supply.

In principle you should be able to power it from the programming port at the same time, it should automatically pick the highest supply, and as long as they either have the same ground, or at least one of them is floating, it should work properly. As far as I am aware for example all phone chargers are floating, otherwise you would have a half-rectified 230V on your USB connector, which I would not like to touch.

Edit: With your new post, so they are plugged into different USB ports on your PC? You can try to plug it in a completely different one to be sure (for example the KL25 in front USB, others in back USB), but then supply shouldn't really be an issue.

posted by Erik - 30 Oct 2015
8 years, 5 months ago.

Cary,

I think you're on the right track that it has something to do with the feedback devices.

You didn't mention what kind of devices you have hooked up to the SainSmart and LedWiz outputs, but is it safe to assume that you have some inductive loads like contactors, solenoids, or motors? Those sorts of devices can cause big fluctuations in the power supply voltages, especially when they turn *off*.

One really important step to help with this is to use flyback diodes on everything with a magnetic coil. If you're not familiar with that term, it means that you put a diode across each coil's power terminals - preferably as close as possible to the physical device - with the diode polarity *reversed*. So you connect the diode's striped end to the "+" voltage terminal of the coil. If you don't have these diodes on all of your coil-type devices, installing them would be the first thing I'd suggest. I use 1N4007 diodes, but any similar diode should work.

If you already have those, I'd suggest trying to see if you can identify a device or devices that cause the glitch. First try disconnecting all of the feedback devices, and play a while and see if the problem goes away. If so, it would support the working theory that it's one of the devices. Then start re-attaching them one at a time and test until the problem comes back. As part of this, I'd remove the SainSmart board entirely, because those relays are themselves inductive loads that could conceivably be causing the glitch. When you start re-attaching things, plug the SainSmart board back in with all of its output devices detached first, to help determine if it's the SainSmart board itself or something attached to it.

One thing you didn't say about your power supply setup is whether you have one power supply or two. If you're powering everything from one power supply, you actually can't isolate anything electrically, because everything shares a common ground connection at the PSU. I know you said you're not wiring everything directly to the common ground, but they'll end up connecting back to the same point anyway. The USB cable that's powering the KL25Z connects back to the same point as well, so the KL25Z has the same ground as the PC and the SainSmart board and the LedWiz, at the very least. When you reworked your wiring to remove the star point in the grounding, you might have seen an improvement simply by virtue of making the wires back to the common ground point in the PSU longer - longer wires can help with glitchy power surge behavior by adding incremental resistance, capacitance, and inductance to the mix. But that will only go so far; it'll help even things out for smaller power fluctuations but won't filter out larger surges.

I hope this helps. This sort of problem can be really difficult to get rid of, but if you can identify the specific device(s) causing the problem, it should be possible to find a solution.