Jump to content



Photo
- - - - -

High pitched sound from flipper solenoid


  • Please log in to reply
28 replies to this topic

#1 TigerOfOld

TigerOfOld

    Neophyte

  • Members
  • Pip
  • 8 posts

  • Flag: Australia

  • Favorite Pinball: AC/DC Luci by VPW

Posted 07 February 2023 - 02:03 AM

Hi All,

I have a question regarding the pinscape flipper logic that I hope someone can answer. I have started to add toys to my cab. I have a stand alone pinscape with the green mosfet boards like this one:
http://mhgaming.com/[email protected]

So far Ive added a shaker motor, knocker and a couple of beacons and theyre working great. Ive started looking into flipper solenoids and am testing two different solenoids, one SW3 and one of the red ones. In the pinscape software I set the flipper logic to 50ms and the power percentage to 13%. Both solenoids make a high pitched sound when on. Is that normal? I have to adjust the power percentage up to reduce the sound, at 93% the sound is gone but that defeats the purpose.

Any thoughts greatly appreciated.

Thanks

TigerOfOld

#2 mjr

mjr

    Pinball Wizard

  • Members
  • PipPipPipPipPip
  • 3,071 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness

Posted 07 February 2023 - 05:14 AM

My guess is that the whine is coming from the flipper turning the PWM switching into an audio signal - physically vibrating the coil wiring at the PWM switching frequency and making it hum.

 

If you're willing to mess around with the firmware C++ code, an easy thing to try would be adjusting the PWM frequency higher to try to get it out of the audio range.  The default frequency is 2kHz (assuming you don't have an IR remote or TLC5940 chips in the system), which is probably what you're hearing.  If you bump that up to 20kHz, it should be so high-pitched that you can't hear it.  The PWM frequency isn't exposed as a configurable setting, but you could change it in the source code and recompile.  It's right at the top of the main() function in main.cpp.

 

One potential issue is that 20kHz might be too fast for the MOSFET drivers,.  The default is 2kHz because that's fast enough that you can't see it in LED flicker, but slow enough for most booster/amp circuits to deal with easily.  If you try it at 20kHz and the solenoids stop switching on, try reducing it to, say, 15kHz or 10kHz.

 

If you'd prefer to leave the software alone, you might be able to get rid of the audible noise with some kind of filtering on the solenoid circuit.  I'm not sure what the best approach would be, but a simple thing to try would be to add a resistor-capacitor filter across the coil.  Something like this:

 

solenoid power ----+----- 10k resistor ---- 0.1uF disk capacitor -----+----- MOSFET port

 

The coil connects at the "+" marks.  Also keep the coil diode in place, of course - the resistor + capacitor circuit is added in parallel with the diode and the coil.

 

Make sure the capacitor is rated for at least 2X the power supply voltage.

 

The idea is that the RC circuit will act like a low-pass filter to somewhat smooth out the square waves coming out of the MOSFET switch.  It's a crude filter that won't smooth it out completely, but maybe it'll smooth it out enough that the remaining ripple won't be loud enough to hear.



#3 TigerOfOld

TigerOfOld

    Neophyte

  • Members
  • Pip
  • 8 posts

  • Flag: Australia

  • Favorite Pinball: AC/DC Luci by VPW

Posted 07 February 2023 - 07:47 AM

My guess is that the whine is coming from the flipper turning the PWM switching into an audio signal - physically vibrating the coil wiring at the PWM switching frequency and making it hum.
 
If you're willing to mess around with the firmware C++ code, an easy thing to try would be adjusting the PWM frequency higher to try to get it out of the audio range.  The default frequency is 2kHz (assuming you don't have an IR remote or TLC5940 chips in the system), which is probably what you're hearing.  If you bump that up to 20kHz, it should be so high-pitched that you can't hear it.  The PWM frequency isn't exposed as a configurable setting, but you could change it in the source code and recompile.  It's right at the top of the main() function in main.cpp.
 
One potential issue is that 20kHz might be too fast for the MOSFET drivers,.  The default is 2kHz because that's fast enough that you can't see it in LED flicker, but slow enough for most booster/amp circuits to deal with easily.  If you try it at 20kHz and the solenoids stop switching on, try reducing it to, say, 15kHz or 10kHz.
 
If you'd prefer to leave the software alone, you might be able to get rid of the audible noise with some kind of filtering on the solenoid circuit.  I'm not sure what the best approach would be, but a simple thing to try would be to add a resistor-capacitor filter across the coil.  Something like this:
 
solenoid power ----+----- 10k resistor ---- 0.1uF disk capacitor -----+----- MOSFET port
 
The coil connects at the "+" marks.  Also keep the coil diode in place, of course - the resistor + capacitor circuit is added in parallel with the diode and the coil.
 
Make sure the capacitor is rated for at least 2X the power supply voltage.
 
The idea is that the RC circuit will act like a low-pass filter to somewhat smooth out the square waves coming out of the MOSFET switch.  It's a crude filter that won't smooth it out completely, but maybe it'll smooth it out enough that the remaining ripple won't be loud enough to hear.

Wow, a reply from the legendary MJR himself. Your guide and pinscape has been a big help to me and many others, THANK YOU.

Cant say Im thrilled with either option A or B given my knowledge level and no guarantee of success. Im thinking this must be an issue with the solenoids Im using, right? Using a different solenoid is an option too? Or maybe just go with a contactor instead.

Thanks again

TigerOfOld

#4 mjr

mjr

    Pinball Wizard

  • Members
  • PipPipPipPipPip
  • 3,071 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness

Posted 07 February 2023 - 08:45 PM

Cant say Im thrilled with either option A or B given my knowledge level and no guarantee of success. Im thinking this must be an issue with the solenoids Im using, right? Using a different solenoid is an option too? Or maybe just go with a contactor instead.

 

I think you're right that trying different solenoids would have a good chance of fixing it.  Contactors should also fix it since you shouldn't need to use the reduced-power mode for those.

 

It might also be worth trying a mechanical fix with the existing solenoids.  I'm thinking that maybe the noise is coming from the vibration being transmitted into the cabinet where they're mounted, in which case it might help to put some rubber or foam between the solenoid and the mounting surface.

 

I compiled a quick firmware test build with the 20kHz PWM setting, if you want to try that:

 

http://mjrnet.org/pi...7_20kHz_PWM.bin

 

If you try that out, let me know if it has any effect for the better or worse.  If it helps, I'll look into making the PWM frequency configurable in the config tool so that anyone else having similar issues can experiment with different rates more easily.



#5 TigerOfOld

TigerOfOld

    Neophyte

  • Members
  • Pip
  • 8 posts

  • Flag: Australia

  • Favorite Pinball: AC/DC Luci by VPW

Posted 09 February 2023 - 05:06 AM


Cant say Im thrilled with either option A or B given my knowledge level and no guarantee of success. Im thinking this must be an issue with the solenoids Im using, right? Using a different solenoid is an option too? Or maybe just go with a contactor instead.

 
I think you're right that trying different solenoids would have a good chance of fixing it.  Contactors should also fix it since you shouldn't need to use the reduced-power mode for those.
 
It might also be worth trying a mechanical fix with the existing solenoids.  I'm thinking that maybe the noise is coming from the vibration being transmitted into the cabinet where they're mounted, in which case it might help to put some rubber or foam between the solenoid and the mounting surface.
 
I compiled a quick firmware test build with the 20kHz PWM setting, if you want to try that:
 
http://mjrnet.org/pi...7_20kHz_PWM.bin
 
If you try that out, let me know if it has any effect for the better or worse.  If it helps, I'll look into making the PWM frequency configurable in the config tool so that anyone else having similar issues can experiment with different rates more easily.
Thanks MJR,

I saw some relatively cheap Siemens contactors on eBay USA and bought those as I have someone over there who can bring them back for me in a couple of weeks. I also have a different solenoid that I think Ill buy and try.

Im very nervous about changing any firmware/software as everything else is working great including a shaker motor on a different pwm port. And before starting to install the toys I installed a beefy SSF system that sounds and feels so good I was wondering if I even needed under playfield solenoids :)

If the contactors and solenoids dont work out I may have to try your test firmware.

Btw I tried insulating the solenoid but it doesnt appear to make any difference to the high pitched sound, just the thud of the solenoid against the wood.

Thanks again

TigerOfOld

#6 zebulon

zebulon

    Cantankerous old B****D

  • Platinum Supporter
  • 1,172 posts
  • Location:Whitby, Ontario, Canada

  • Flag: Canada

  • Favorite Pinball: xenon, Medieval Madness, Royal Flush, Silverball Mania

Posted 09 February 2023 - 02:24 PM

Before you go digging too deeply into it, make sure that your solenoids are set to full power in DOF.  If your settings were at full power to begin with you wouldn't be running a pwm signal anyway.

 

Attached File  configtool.png   141.48KB   3 downloads


 ZB%20%20Storefront1%20.png               [email protected]

Don't pm or expect an answer from me here ... the links above are my contacts.

I know so much about so little that I could teach you all there is to know about nothing......


#7 mjr

mjr

    Pinball Wizard

  • Members
  • PipPipPipPipPip
  • 3,071 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness

Posted 09 February 2023 - 06:50 PM

Before you go digging too deeply into it, make sure that your solenoids are set to full power in DOF.  If your settings were at full power to begin with you wouldn't be running a pwm signal anyway.

 

Unless I'm misunderstanding, in this case the PWM is intentional, but not through DOF - it's the Pinscape "flipper logic" feature, being used to reduce the hold power on certain coils for heat management.



#8 TigerOfOld

TigerOfOld

    Neophyte

  • Members
  • Pip
  • 8 posts

  • Flag: Australia

  • Favorite Pinball: AC/DC Luci by VPW

Posted 10 February 2023 - 06:03 AM

Before you go digging too deeply into it, make sure that your solenoids are set to full power in DOF.  If your settings were at full power to begin with you wouldn't be running a pwm signal anyway.

 
Unless I'm misunderstanding, in this case the PWM is intentional, but not through DOF - it's the Pinscape "flipper logic" feature, being used to reduce the hold power on certain coils for heat management.

Yes, this is correct. All testing was via the pinscape config tool. PWM was just for the flipper logic to prevent overheating.

Thanks

TigerOfOld

#9 jo3stevens

jo3stevens

    Neophyte

  • Members
  • Pip
  • 4 posts

  • Flag: Australia

  • Favorite Pinball: Indiana jones

Posted 18 May 2023 - 08:40 AM

 

Cant say Im thrilled with either option A or B given my knowledge level and no guarantee of success. Im thinking this must be an issue with the solenoids Im using, right? Using a different solenoid is an option too? Or maybe just go with a contactor instead.

 

I think you're right that trying different solenoids would have a good chance of fixing it.  Contactors should also fix it since you shouldn't need to use the reduced-power mode for those.

 

It might also be worth trying a mechanical fix with the existing solenoids.  I'm thinking that maybe the noise is coming from the vibration being transmitted into the cabinet where they're mounted, in which case it might help to put some rubber or foam between the solenoid and the mounting surface.

 

I compiled a quick firmware test build with the 20kHz PWM setting, if you want to try that:

 

http://mjrnet.org/pi...7_20kHz_PWM.bin

 

If you try that out, let me know if it has any effect for the better or worse.  If it helps, I'll look into making the PWM frequency configurable in the config tool so that anyone else having similar issues can experiment with different rates more easily.

 

 

I know this post is a few months old but I had the same issue and that firmware sorted it! I can now run the flipper solenoids at 20% hold power with no whining. Prior to have that anything but 100% would get the whine.



#10 Cadorna

Cadorna

    Enthusiast

  • Members
  • PipPipPip
  • 134 posts

  • Flag: Argentina

  • Favorite Pinball: Too many to choose ...

Posted 19 May 2023 - 12:30 AM

@TigerOfOld Yes you're right. Mike is the coolest guy on earth. He helped me many times with a lot of questions when I built my cabinet. He is always available and happy to help... we are so lucky to have him in the world of pinball... Everything could be so much more difficult without his selfless work and help.
 
By the way @mjr, I had the exact same problem regarding high tone and that firmware solved it, thanks for that too!

Edited by Cadorna, 19 May 2023 - 12:31 AM.


#11 krystm

krystm

    Neophyte

  • Members
  • Pip
  • 6 posts

  • Flag: United States of America

  • Favorite Pinball: Twilight Zone

Posted 11 July 2023 - 02:21 PM

 

Cant say Im thrilled with either option A or B given my knowledge level and no guarantee of success. Im thinking this must be an issue with the solenoids Im using, right? Using a different solenoid is an option too? Or maybe just go with a contactor instead.

 

I think you're right that trying different solenoids would have a good chance of fixing it.  Contactors should also fix it since you shouldn't need to use the reduced-power mode for those.

 

It might also be worth trying a mechanical fix with the existing solenoids.  I'm thinking that maybe the noise is coming from the vibration being transmitted into the cabinet where they're mounted, in which case it might help to put some rubber or foam between the solenoid and the mounting surface.

 

I compiled a quick firmware test build with the 20kHz PWM setting, if you want to try that:

 

http://mjrnet.org/pi...7_20kHz_PWM.bin

 

If you try that out, let me know if it has any effect for the better or worse.  If it helps, I'll look into making the PWM frequency configurable in the config tool so that anyone else having similar issues can experiment with different rates more easily.

 

MJR - Legend / The Man / The Myth,

 

First off Huge HUGE thanks for all the work, the guides, the info has been hugely helpful.. 

 

Bu I have now run into a problem I feel is a similar/same issue as whats going on here but not with solenoids (as I dont use the lower power hold... maybe can try that too). To start off as more of an FYI I have most every toy I can think of (outside chimes and gear motor) and both my Shaker and Fan both have crazy whine if I don't run them at 100%. Currently, I am running them maxed out 48/48 in DOF and using a dial to bring it down. However, I am running my setup though Arnonz's RigMaster which has PWM control on those outputs so I was thinking of tackling maybe removing the knobs (both fan and shaker have one) and then using PWM to control the load. The issue is of course the whine that is produced at the lower levels. Also it's not really mentioned anywhere but should I use one or the other or a combo of both? (EDIT - just playing with the slider it is fairly evedent a combo is the best route anything over 20 on the shaker vibrates the machine way beyond comfort) I did the knob/dial as that is what most people were using and didn't really occur to me that I had the PWM control the whole time as I didn't really understand it. Now I have what I think a decent understanding... at least I think lol.

 

So a few questions/scenario....

 

I didn't know if you had instituted the varying PWM per output or if that is even possible / how I can test etc? 

 

Also how does 0-255 match up to 1-48 in DOF tool. My thought process which is probably wrong was to use the slider in pinscape to find the lowest point that the motor triggers without whine and make that the minimum, and then find the max I could handle. But if lets say that's 100-210 (which another post I saw basically says thats just avoiding the issue altogether) what settings would I, ideally use in DOF?

 

All the reading I have done as I understand it is the frequency of PWM as stated above. I don't mind trying different firmware etc if that's how need to do it or can solder in caps etc. either way. Just going for the realism factor and I think having the varying control of both the fan and shaker the way its written for the table should be a big help. What kinda drew me into all this is that I recently played a Stern last week after playing mine almost exclusively for the last year, the shaker,  as others have stated while nice is more a buzz vs an actual shake. So was debating to just get a real stern/etc or maybe swap weights, but then ran across the PWM setup so maybe variance control would be best to try first.

 

The issue is under load if the output isnt 100% or at least high enough in the 140/150s+ there is high pitched whine from the motors both the fan and shaker. I don't play anything particularity loud so it comes though pretty predominantly. 

 

Currently Running the Following just in case it is relevant - 

10x Williams SA-3-23 24v coils with their own 24v PSU

 

12V PSU to power the following:

1x 775 Size 12/24v 4000/8000 RPM dual weight shaker/motor (12v - 4000 RPM / 24v 8000 RPM) Pretty sure this is the one most use/listed in the bible

1x Attwood 1749-4 Turbo 4000 Series II In-Line Blower 12V Fan

All misc Front Panel and Flipper Button LEDs (Coin/Start/Launch/Extra/Flippers/Fire)

 

5V PSU - All Addressable which are controlled separate though teensy board.

 

Feel free to reach out direct if that's easier, I am pretty self reliant on most things and have been messing with small electronics for a long time so not much drives me off and would love to be an asset to help others. I know the shaker in particular people like to go the more DIY route so having more info Im sure can't hurt.

 

Also if this has been tackled and I missed it feel free to just point me in that direction as well lol.

 

I really appreciate any help / direction in advance!


Edited by krystm, 11 July 2023 - 04:13 PM.


#12 mjr

mjr

    Pinball Wizard

  • Members
  • PipPipPipPipPip
  • 3,071 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness

Posted 11 July 2023 - 06:44 PM

> I didn't know if you had instituted the varying PWM per output or if that is

> even possible / how I can test etc? 

 

I haven't made it configurable yet, but you can try that test build with the 20 kHz fixed rate linked in the earlier post:

 

http://mjrnet.org/pi...7_20kHz_PWM.bin

 

Hopefully that'll fix the audible vibration for you.  At some point I'll try to either add a configuration option for the PWM frequency to the mainline release, or at least set the default to the higher frequency.  The main reason I went with a lower default frequency originally is that some booster/amplifier devices have an upper limit to how high a frequency they can handle, so I didn't want to risk creating compatibility issues.  But I think 20kHz might end up being a happy medium that's high enough to be inaudible in coils but low enough not to overwhelm most optocouplers.



#13 krystm

krystm

    Neophyte

  • Members
  • Pip
  • 6 posts

  • Flag: United States of America

  • Favorite Pinball: Twilight Zone

Posted 12 July 2023 - 03:04 PM

> I didn't know if you had instituted the varying PWM per output or if that is

> even possible / how I can test etc? 

 

I haven't made it configurable yet, but you can try that test build with the 20 kHz fixed rate linked in the earlier post:

 

http://mjrnet.org/pi...7_20kHz_PWM.bin

 

Hopefully that'll fix the audible vibration for you.  At some point I'll try to either add a configuration option for the PWM frequency to the mainline release, or at least set the default to the higher frequency.  The main reason I went with a lower default frequency originally is that some booster/amplifier devices have an upper limit to how high a frequency they can handle, so I didn't want to risk creating compatibility issues.  But I think 20kHz might end up being a happy medium that's high enough to be inaudible in coils but low enough not to overwhelm most optocouplers.

Thanks for the super fast response!

 

Ill give it a shot, Im assuming this is a firmware flash that uses the 2nd port on the KLZ? So backup settings, flash as if it were new and then restore settings from backup on pinscape?

 

Upgrade went without a hitch, Whine is GONE! working with the sliders it seems both Fan and Shaker activate around 13/14 of the 255 scale. What would you suggest for DOF config minimum?

 

Also is there a quick read or can point me to what is the collations between DOF 1-48 levels and 0-255 on pinscape are? Or just do the math 255/48=5.3125 per 1 tick of DOF comparison e.g. since each level of DOF is about 5.4 on the 0-255 scale if I find that anything under a specific level doesn't trigger say 25 on the 255 scale I make my DOF 5-48 and if all goes well (assuming) just set my dial to my max comfort? ... or am I overthinking this haha.

 

TIA!


Edited by krystm, 12 July 2023 - 04:24 PM.


#14 mjr

mjr

    Pinball Wizard

  • Members
  • PipPipPipPipPip
  • 3,071 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness

Posted 12 July 2023 - 05:08 PM

> Or just do the math 255/48=5.3125 per 1 tick of DOF

 

Right - the DOF mapping should be roughly linear.  

 

> I find that anything under a specific level doesn't trigger say 25 on the 255 scale I make

> my DOF 5-48 and if all goes well (assuming) just set my dial to my max comfort?

 

Exactly.



#15 krystm

krystm

    Neophyte

  • Members
  • Pip
  • 6 posts

  • Flag: United States of America

  • Favorite Pinball: Twilight Zone

Posted 13 July 2023 - 01:51 AM

Awesome! Thanks so much! If need a tester for anything feel free to reach out!!

#16 jo3stevens

jo3stevens

    Neophyte

  • Members
  • Pip
  • 4 posts

  • Flag: Australia

  • Favorite Pinball: Indiana jones

Posted 16 July 2023 - 10:35 PM

 

 

Cant say Im thrilled with either option A or B given my knowledge level and no guarantee of success. Im thinking this must be an issue with the solenoids Im using, right? Using a different solenoid is an option too? Or maybe just go with a contactor instead.

 

I think you're right that trying different solenoids would have a good chance of fixing it.  Contactors should also fix it since you shouldn't need to use the reduced-power mode for those.

 

It might also be worth trying a mechanical fix with the existing solenoids.  I'm thinking that maybe the noise is coming from the vibration being transmitted into the cabinet where they're mounted, in which case it might help to put some rubber or foam between the solenoid and the mounting surface.

 

I compiled a quick firmware test build with the 20kHz PWM setting, if you want to try that:

 

http://mjrnet.org/pi...7_20kHz_PWM.bin

 

If you try that out, let me know if it has any effect for the better or worse.  If it helps, I'll look into making the PWM frequency configurable in the config tool so that anyone else having similar issues can experiment with different rates more easily.

 

 

I know this post is a few months old but I had the same issue and that firmware sorted it! I can now run the flipper solenoids at 20% hold power with no whining. Prior to have that anything but 100% would get the whine.

 

 

I just made some changes in my cabinet, and moved my flipper solenoids to an expansion board (Arnoz Mollusk/Mos4), and the buzzing is back. Assuming the PWM frequency for the expansion boards is different. Wondering if that's something that can also be fixed by a change in the firmware?



#17 mjr

mjr

    Pinball Wizard

  • Members
  • PipPipPipPipPip
  • 3,071 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness

Posted 17 July 2023 - 06:33 PM

I just made some changes in my cabinet, and moved my flipper solenoids to an expansion board (Arnoz Mollusk/Mos4), and the buzzing is back. Assuming the PWM frequency for the expansion boards is different. Wondering if that's something that can also be fixed by a change in the firmware?

 

I think those boards use TLC5940 chips for the PWM, which does give them a different PWM frequency from the on-board GPIO PWM.  The host does have some control over the PWM frequency those chips use, but it's tricky to set, because there's interplay between the PWM frequency and the data transmission rate.  Higher PWM rates require higher data rates, and higher data rates make the connection less reliable, so I deliberately kept the PWM low (85Hz) to maximize signal integrity.  That's probably the vibration frequency you're hearing.  The highest possible rate with these chips is around 7800Hz, which is still well inside the audible range, but it might still be worth trying different frequencies in case the solenoids are just particularly sensitive to certain ranges.

 

This is another setting that's hard-wired into the code right now without any Config Tool access.  So if you want to try adjusting it, what I'd suggest is doing a custom build, so that you can quickly try different settings to test the effects.  Building the firmware can be done with the web-based compiler, so there's nothing you need to install - go to the project home page at

 

https://os.mbed.com/..._Controller_V2/

 

...then go over to the "Repository toolbox" section at top right and click "Import into Keil Studio"..  That should set you up with a private copy of the source code and the online compiler.  Go over to the left side of the page, make sure Active Project is set to Pinscape_Controller, and set Build Target to FRDM-KL25Z.  Click the little hammer icon below that to build it.

 

Now for where to make the changes to adjust the PWM rate.  Navigate in the source tree down to TLC5940 > TLC5940.h.  Scroll down a bit and find this line:

 

#define GSCLK_SPEED   350000

 

That's what determines the PWM clock.  To convert between that setting and Hz, multiply the desired Hz setting by 4096 - e.g., if you want to try 1000 Hz, set it to 4096*1000 = 4096000.   The limit is around 32000000 = 7812 Hz.

 

After changing that number, just click the hammer icon again to rebuild.  That should generate a .bin file that automatically downloads via your browser, and you can install that on the KL25Z via the Config Tool.

 

The tradeoff with raising the PWM rate is that it can reduce the signal integrity, which can cause random glitching on the PWM outputs (outputs randomly turning on and off).  This might or might not happen with your system - it all depends on the physical wiring, like how long the wires are and how much other electrical interference there is in the system.  I chose the 85Hz setting because it was the lowest rate where you don't tend to see a lot of LED flicker.  You can probably get away with raising it a bit without losing too much signal integrity, but I'm not sure how much "a bit" will turn out to be.  I think you'll just have to experiment.  If you do find a setting that gets rid of the noise, I'd try reducing the frequency from there as far as you can until the noise comes back - it's better to keep the frequency as low as you can get away.



#18 jo3stevens

jo3stevens

    Neophyte

  • Members
  • Pip
  • 4 posts

  • Flag: Australia

  • Favorite Pinball: Indiana jones

Posted 18 July 2023 - 08:57 AM

 

I just made some changes in my cabinet, and moved my flipper solenoids to an expansion board (Arnoz Mollusk/Mos4), and the buzzing is back. Assuming the PWM frequency for the expansion boards is different. Wondering if that's something that can also be fixed by a change in the firmware?

 

I think those boards use TLC5940 chips for the PWM, which does give them a different PWM frequency from the on-board GPIO PWM.  The host does have some control over the PWM frequency those chips use, but it's tricky to set, because there's interplay between the PWM frequency and the data transmission rate.  Higher PWM rates require higher data rates, and higher data rates make the connection less reliable, so I deliberately kept the PWM low (85Hz) to maximize signal integrity.  That's probably the vibration frequency you're hearing.  The highest possible rate with these chips is around 7800Hz, which is still well inside the audible range, but it might still be worth trying different frequencies in case the solenoids are just particularly sensitive to certain ranges.

 

This is another setting that's hard-wired into the code right now without any Config Tool access.  So if you want to try adjusting it, what I'd suggest is doing a custom build, so that you can quickly try different settings to test the effects.  Building the firmware can be done with the web-based compiler, so there's nothing you need to install - go to the project home page at

 

https://os.mbed.com/..._Controller_V2/

 

...then go over to the "Repository toolbox" section at top right and click "Import into Keil Studio"..  That should set you up with a private copy of the source code and the online compiler.  Go over to the left side of the page, make sure Active Project is set to Pinscape_Controller, and set Build Target to FRDM-KL25Z.  Click the little hammer icon below that to build it.

 

Now for where to make the changes to adjust the PWM rate.  Navigate in the source tree down to TLC5940 > TLC5940.h.  Scroll down a bit and find this line:

 

#define GSCLK_SPEED   350000

 

That's what determines the PWM clock.  To convert between that setting and Hz, multiply the desired Hz setting by 4096 - e.g., if you want to try 1000 Hz, set it to 4096*1000 = 4096000.   The limit is around 32000000 = 7812 Hz.

 

After changing that number, just click the hammer icon again to rebuild.  That should generate a .bin file that automatically downloads via your browser, and you can install that on the KL25Z via the Config Tool.

 

The tradeoff with raising the PWM rate is that it can reduce the signal integrity, which can cause random glitching on the PWM outputs (outputs randomly turning on and off).  This might or might not happen with your system - it all depends on the physical wiring, like how long the wires are and how much other electrical interference there is in the system.  I chose the 85Hz setting because it was the lowest rate where you don't tend to see a lot of LED flicker.  You can probably get away with raising it a bit without losing too much signal integrity, but I'm not sure how much "a bit" will turn out to be.  I think you'll just have to experiment.  If you do find a setting that gets rid of the noise, I'd try reducing the frequency from there as far as you can until the noise comes back - it's better to keep the frequency as low as you can get away.

 

 

Thanks for the detailed reply, much appreciated. I'll give it a try and see what happens. Worst case I can probably just re-wire the flippers back to the KL where they were before. I only moved it all so I could have a 10 solenoid setup with the arnoz boards etc all mounted directly under the playfield.



#19 mjr

mjr

    Pinball Wizard

  • Members
  • PipPipPipPipPip
  • 3,071 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness

Posted 18 July 2023 - 06:53 PM

I'll give it a try and see what happens. Worst case I can probably just re-wire the flippers back to the KL where they were before. I only moved it all so I could have a 10 solenoid setup with the arnoz boards etc all mounted directly under the playfield.

 

Let me know what you find - if the frequency adjustment does turn out to help, I'll put it on my list to add that as a Config Tool setting as well.  Moving them back to GPIOs sounds like a good fallback option.



#20 jo3stevens

jo3stevens

    Neophyte

  • Members
  • Pip
  • 4 posts

  • Flag: Australia

  • Favorite Pinball: Indiana jones

Posted 19 July 2023 - 12:45 PM

 

I'll give it a try and see what happens. Worst case I can probably just re-wire the flippers back to the KL where they were before. I only moved it all so I could have a 10 solenoid setup with the arnoz boards etc all mounted directly under the playfield.

 

Let me know what you find - if the frequency adjustment does turn out to help, I'll put it on my list to add that as a Config Tool setting as well.  Moving them back to GPIOs sounds like a good fallback option.

 

 

I tried a bunch of different frequencies. As I went higher the pitch got higher but nothing really helped. In the end the best I could actually get was the original 85Hz, but having the flipper logic percentage higher to a point it was a quiet low pitched buzz. These solenoids can stay on at 20% power, but I had to go 27% on one and 60+% on the other to reduce the noise, and it was still slightly audible.

 

While I had the cab open I just ran the flippers back to the Mosboard Full I have my shaker/gear running off at the front of the cab, and running your 20kHz build and that works perfect as before. 20% hold power and zero sound.

 

Thanks for suggestions though was worth a try!