Author Topic: is it possible to call multiiple coils at the same time?  (Read 1530 times)

uncivil engineer

  • Wizard
  • *****
  • Posts: 118
  • Alan
    • View Profile
is it possible to call multiiple coils at the same time?
« on: March 23, 2015, 12:14:20 AM »
The sound card in my Williams Flash has presented me with with an interesting possibility.

Flash is a Williams system 4 game, and has a second generation Williams sound card in it.  For those of you who are not familiar with early Williams sound card, the are more or less a stand alone computer that is used to make the game sounds.  They have five input channels that are switched on and off using coil drivers.  With five inputs, there is a maximum of 31 sounds the card can make.

To trigger the card, I need to be able to call up to five coils at the same time.  I am going to try to fake this by using very short pulse times, and calling the coils one after another, but if that doesn't work, is there any way to call multiple coils simultaneously?

Thanks,
Uncivil Engineeer

MOcean

  • P3 Developers
  • *
  • Posts: 822
  • Michael Ocean
    • View Profile
Re: is it possible to call multiiple coils at the same time?
« Reply #1 on: March 23, 2015, 10:19:50 AM »
That's awesome!

You can use coils in lampshows, which would be a very natural way to do this. Build a lampshow that fires only the coils to play your music....just awesome!

Alternatively you could use "Now=False" as an argument to your schedule call, and that will sync up the next few schedules that go out to be at the same time (the PROC's internal clock).

If you want more details on either of these, let me know.

- Michael

uncivil engineer

  • Wizard
  • *****
  • Posts: 118
  • Alan
    • View Profile
Re: is it possible to call multiiple coils at the same time?
« Reply #2 on: March 23, 2015, 01:18:35 PM »
I had forgotten about scheduling.  That should work.

I was thinking about putting together a sound mode that would have calls for each sound.   This may also help me map which sounds are at what coil combination.
--Uncivil Engineer

Gerry Stellenberg

  • Administrator
  • *****
  • Posts: 2399
    • View Profile
    • PinballControllers.com
Re: is it possible to call multiiple coils at the same time?
« Reply #3 on: March 23, 2015, 01:21:50 PM »
Be aware that there could be variance of up to 1ms even with scheduled-aligned drivers.  The driver logic in the P-ROC is not intended to by high-resolution.  If you need finer-grain control, you'd need to look into using the aux logic.  The aux-logic would be a great solution if all 5 of these 'coils' are in the same bank, and that bank doesn't also drive other coils.  Otherwise, it gets more complicated.

- Gerry

uncivil engineer

  • Wizard
  • *****
  • Posts: 118
  • Alan
    • View Profile
Re: is it possible to call multiiple coils at the same time?
« Reply #4 on: March 24, 2015, 01:09:09 AM »
Gerry,
I think it will work with just the drivers board.  One think I have learned with dealing with these old electronics is that they don't require the precision signals that newer equipment does.  When I was dealing building my 6 digit display driver, I found that the original board operated at around 60hz, but I was able to drive it as fast at 100hz and still have it display numbers.

Just playing around last night I was able to produce different sound by just calling for back to back pulse(1) commands.

Using MOceans idea, I did come up with some code to test my sound card:

Code: [Select]
#############################
#### sound definitions ######
#############################

    def playsound(self, x):

        #### this function is valid for intergers between 0 and 31
        if x > 0 and x <= 31:

            #### first we convert the input request to a binary number in the form of a string
            #### this call should give a string of 0s and 1s five digits long.  Special thanks
            #### to google for this solution

            inputString = bin(x)[2:].zfill(5)

            ### Now check for 1s, and schedule coils if it is present, note we are working
            ### from right to left, starting at index 4, there has to be a seperate if call
            ### for each digit so none get skipped

            if inputString[4] == '1':
                self.game.coils.soundC09.schedule(schedule=0xf0000000, cycle_seconds=1, now=False)

            if inputString[3] == '1':
                self.game.coils.soundC10.schedule(schedule=0xf0000000, cycle_seconds=1, now=False)
           
            if inputString[2] == '1':
                self.game.coils.soundC11.schedule(schedule=0xf0000000, cycle_seconds=1, now=False)
           
            if inputString[1] == '1':
                self.game.coils.soundC12.schedule(schedule=0xf0000000, cycle_seconds=1, now=False)

            if inputString[0] == '1':
                self.game.coils.soundC13.schedule(schedule=0xf0000000, cycle_seconds=1, now=False)
        else:
            self.log.info('bad call to playsound ' +str(x)+ 'was sent')     

I've tested it, and it seems to work.