Jump to content



Photo
- - - - -

HyperPin / FPLaunch with LEDWiz Modification


  • Please log in to reply
70 replies to this topic

#1 Darkfall

Darkfall

    Enthusiast

  • Gold Supporter
  • 453 posts
  • Location:Langley, BC

  • Flag: Canada

  • Favorite Pinball: Attack From Mars, Scared Stiff

Posted 19 September 2011 - 06:55 AM

Hi guys,

After building a pinball cabinet with an LEDWiz built into it to control all kinds of real-world devices, such as multi-color flashers, buttons, contactors for force feedback, and a replay knocker (and eventually a shaker motor and maybe a wiper motor), I started playing with all of my new toys.

I ran into a couple of problems, however:

1. If I were to exit a table that was in the middle of turning things off and on, anything on at the time would stay on. A few high-power CREE flashers being on can pull a fair bit of power, which causes not only them to heat up, but the LEDWiz itself to heat up. Leaving some solenoids on for too long leads to them getting quite warm, too. Being concerned about burning out components, I wanted a way to shut all of the LEDWiz output off when exiting a table.

2. The LEDWiz stuff for HyperPin was a challenge to make work, and was quite simplistic in it's abilities once it was working. I wanted much more control over things while browsing tables - I wanted my flipper buttons to be whatever color I wanted, and I wanted them to be on solid, rather than flashing. I also wanted my Start button to flash, but my Launch Ball button to be on solid. Once a table loads, it will reset everything to the way it wants it, but during browsing, I wanted things the way I wanted it. I shared my work with a few people for testing. One of them (maxxsinner) took my code a step further and created a form of "attract mode" that runs while browsing tables (he had his backbox flashers light up and pulse on and off, which helps draw attention to the pinball machine).

My solution was to write a couple of Visual Basic scripts to set the LEDWiz outputs, then have HyperPin execute those scripts when it started and exited. That made sure everything was set the way I wanted it when HyperPin started, and that everything got turned off when HyperPin exited.

The only thing left was to get my buttons reset for browsing after a table exited. To do that, I needed to call my script from FPLaunch, which handles table loads and exits for HyperPin. For that, I needed to modify FPLaunch and recompile it.

Once everything was done, I was happy.

I've packaged up everything needed, along with instructions in simple text format, so others can do the same thing. Hopefully it'll help people get where they want to be with their LEDWiz during HyperPin browsing, and protect their components when leaving a table.

Please let me know if you run into any issues. It's pretty straight forward stuff, but even the simple stuff can lead to questions at times.

Note that my LEDWiz outputs are set up a particular way (the same as Chriz99's, since I originally based my cabinet design on his original build). Your outputs may be different, so you may need to edit the Visual Basic code to match. It's simple to do with a minute of looking at the scripts - you can see clearly what's happening from the comments in the code. If you decide you want to do something fancier, like maxxsinner did, there is a reference to the LEDWiz documentation for the commands needed in the instructions.

Also note that this solution is LEDWiz specific. It won't work with a Pac-Drive. Sorry, Pac-Drive owners.

Download: FPLaunch 1.295 WIP 7, LEDWiz Mod 1.1 (updated November 3, 2011).

  • Version 1.1: Clear LEDWiz outputs when launching a table - this is mostly for Future Pinball users, but it makes sense for tables that don't have LEDWiz configurations, too.
  • Version 1.0: Initial release.


Have fun!

Edited by Darkfall, 08 November 2011 - 07:06 AM.

...Paul


Check out Wildfire Pinball's build details here: Project Wildfire

#2 maxxsinner

maxxsinner

    Enthusiast

  • Platinum Supporter
  • 319 posts
  • Location:Australia

  • Flag: Australia

  • Favorite Pinball: F14 Tomcat

Posted 19 September 2011 - 10:26 AM

Thanks heaps for this Paul. It works brilliantly with very little tweaking required and very easy to follow instructions. drinks.gif

#3 DedRok_V

DedRok_V

    Crazed Pinball Wizard (Australia's Former #1)

  • Platinum Supporter
  • 2,238 posts
  • Location:Newcastle, Australia

  • Flag: Australia

  • Favorite Pinball: Avengers Blue LE : Judge Dredd : Cosmic Princess

Posted 19 September 2011 - 01:49 PM

Nice work Paul otvclap.gif
even though I'm not up to that stage yet, it will surely come in handy one day......




Blueprint game : up to date list http://www.vpforums....s...st&p=147107

#4 veldrin

veldrin

    Neophyte

  • Members
  • Pip
  • 3 posts
  • Location:Oklahoma

  • Flag: ---------

  • Favorite Pinball: Fun House

Posted 19 September 2011 - 02:23 PM

Excellent, thanks! smile.gif

#5 gStAv

gStAv

    Pinball Lover

  • Members
  • PipPipPipPip
  • 1,331 posts

  • Flag: Sweden

  • Favorite Pinball: TOM, IJ, AFM, WC94

Posted 19 September 2011 - 02:37 PM

Works great man! Thanks a lot! biggrin.gif

3rs054-6.png


#6 DeeGor

DeeGor

    Enthusiast

  • Members
  • PipPipPip
  • 122 posts
  • Location:Las Vegas

  • Flag: United States of America

  • Favorite Pinball: Indiana Jones: The Pinball Adventure

Posted 19 September 2011 - 03:08 PM

Great job!

Thanks for your contribution.
My Pinball Cabinet:

#7 chriz

chriz

    Enthusiast

  • Platinum Supporter
  • 451 posts

  • Flag: ---------

  • Favorite Pinball: Funhouse

Posted 19 September 2011 - 05:37 PM

thanks paul! :beer:

cheers
Chris
 

 


#8 numiah

numiah

    Pinball Fan

  • Members
  • PipPipPipPip
  • 983 posts
  • Location:Netherlands

  • Flag: Netherlands

  • Favorite Pinball: TOTAN

Posted 19 September 2011 - 06:46 PM

Thank you so much for this !!

If setting a value to 48 is maximum brightness, how come 130 equals blinking ?
Is there some kind of schematic available to see what value does what exactly ? For example fade-in and out ? (I've seen that option in the standard ledwiz software)

Num

Edited by numiah, 19 September 2011 - 06:48 PM.

**Each pinball machine is a tiny universe... that we control.**


#9 veldrin

veldrin

    Neophyte

  • Members
  • Pip
  • 3 posts
  • Location:Oklahoma

  • Flag: ---------

  • Favorite Pinball: Fun House

Posted 19 September 2011 - 07:30 PM

QUOTE (numiah @ Sep 19 2011, 06:46 PM) <{POST_SNAPBACK}>
Thank you so much for this !!

If setting a value to 48 is maximum brightness, how come 130 equals blinking ?
Is there some kind of schematic available to see what value does what exactly ? For example fade-in and out ? (I've seen that option in the standard ledwiz software)

Num

From the LEDWiz SDK:

QUOTE
A value of 1 to 48 sets the brightness of each LED using PWM. A value of 129-132 indicates an
automated pulse mode as follows:

129 = Ramp Up / Ramp Down
130 = On / Off
131 = On / Ramp Down
132 = Ramp Up / On

The speed is contolled by the Global Pulse Speed parameter.



#10 numiah

numiah

    Pinball Fan

  • Members
  • PipPipPipPip
  • 983 posts
  • Location:Netherlands

  • Flag: Netherlands

  • Favorite Pinball: TOTAN

Posted 19 September 2011 - 08:07 PM

Thanks for that. I'll experiment some more with it.

For he who uses a normal lightbulb in his 'launch ball' button : if you have it constant on at full power, the plastic tends to expand due to heat, and that can make the button stick in on position when you push it.
I've lowered the intensity to 25% to avoid this.

**Each pinball machine is a tiny universe... that we control.**


#11 rockyrocket

rockyrocket

    Enthusiast

  • Silver Supporter
  • 145 posts
  • Location:Bristol,UK

  • Flag: United Kingdom

  • Favorite Pinball: xenon

Posted 19 September 2011 - 08:32 PM

Thanks a lot for this, finally browsing works as expected!.
So how would I coordinate a pattern, ie a cylon like right - left?.
I also notice that whatever I have for browsing carries on through to future pinball, so any sequence I do use will stay on in game?.
Anyway thanks again for this, first time I have felt the need to comment here!.

#12 mameman23

mameman23

    Pinball Fan

  • Silver Supporter
  • 506 posts
  • Location:Farmington Hills, MI

  • Flag: United Kingdom

  • Favorite Pinball: Dr Who, robocop

Posted 19 September 2011 - 09:42 PM

great, thanks.

wasn't the solution that solves your issue 1, to use the HPlaunch app rather than hyperpin. that resolved the issue with clearing down the active ledwiz ports when exiting the game?
PM me for any CNC needs.
Find me on Facebook....Xtreme Pinball
Doctor Who Cabinet Build Thread Here
Tron Cabinet Build Thread Here
Big Bang Bar Build Thread Here
Mameman's cnc fun

#13 maxxsinner

maxxsinner

    Enthusiast

  • Platinum Supporter
  • 319 posts
  • Location:Australia

  • Flag: Australia

  • Favorite Pinball: F14 Tomcat

Posted 19 September 2011 - 09:43 PM

I hope I can help here with a breif guide to help those wanting to customise Pauls great program. A lot of this is explained in the LEDwiz document, and I have copied some of the document here but I have explained it a little further.

To customize the Ledset script for my cab, I found the SBx, GPS and the PBA commands the easiest to use, once you get your head around how they work.
You need to tell LEDwiz which outputs you are going to use by turning them on, then tell LEDwiz what you want those outputs to do (blink, ramp, brightness, etc)

So the SBx command works by addressing of the outputs on a specific driver chip. SB1 is for outputs 1-8, SB2 9-16 etc.
The next number is generated by 8 bit addressing of the outputs. Easiest described by the table below. The top row is the output number on the chip, the bottom row is the 8 bit address of that number.


So to generate the number you need, add the 8 bit address of the ouputs you want on together. Example - I want to use outputs 1,3 and 7 and the rest to remain off.
1 3 7
1 4 64 = 69

So my command to LEDwiz would be SB1:69. Do this for each of the 4 drivers and you ready to go to the next step.

GPS command. The GPS command is the speed setting for your blinking or ramping of your LEDs. This is a global command so it will affect all speeds. The value can be a number from 1 to 7, with 1 being the fastest pulse speed and 7 being the slowest.

The PBA command controls all the outputs of the LEDwiz in one line, but if they are not on in the SB command that you have done previous, the command for that output will fall on deaf ears. So in as described in the LEDwiz command reference

0 to 48 will set the brightness of the LED/Globe via PWM

129 = Ramp Up / Ramp Down
130 = On / Off
131 = On / Ramp Down
132 = Ramp Up / On
The speed is controlled by the Global Pulse Speed parameter.

PBA:48,48,48,129,48,48,48,48,48,48,48,48,48,20,48,48,48,48,48,48,48,48,48,48,48,
48,48,48,48,48,48,48

Output 4 set to a "sawtooth" pulse, output 14 is set to an intensity of 20 and the rest of the outputs
are set to full brightness settings.

Hope that helps a bit gents.

#14 Darkfall

Darkfall

    Enthusiast

  • Gold Supporter
  • 453 posts
  • Location:Langley, BC

  • Flag: Canada

  • Favorite Pinball: Attack From Mars, Scared Stiff

Posted 19 September 2011 - 11:45 PM

QUOTE (rockyrocket @ Sep 19 2011, 01:32 PM) <{POST_SNAPBACK}>
Thanks a lot for this, finally browsing works as expected!.
So how would I coordinate a pattern, ie a cylon like right - left?.
I also notice that whatever I have for browsing carries on through to future pinball, so any sequence I do use will stay on in game?.
Anyway thanks again for this, first time I have felt the need to comment here!.


I haven't set up Future Pinball on my cabinet, so I hadn't done anything with trying to turn off the LEDWiz outputs for that. It can be done, though - it'd need a slight modification to the FPLaunch code to do it, but it's definitely doable. I'll make that happen on the next release.

EDIT: This has been completed. You can get the updated version here.


QUOTE (mameman23 @ Sep 19 2011, 02:42 PM) <{POST_SNAPBACK}>
great, thanks.

wasn't the solution that solves your issue 1, to use the HPlaunch app rather than hyperpin. that resolved the issue with clearing down the active ledwiz ports when exiting the game?


It might have - I didn't get far enough with it to see that. I was too busy trying to get my buttons to do what I wanted during browsing and couldn't, so I started rolling my own solution. I had read that some people were reporting the stuff being left on when exiting tables, but I don't know if they were using the HPLaunch stuff and that was their problem, or what.

Edited by Darkfall, 19 September 2011 - 11:55 PM.

...Paul


Check out Wildfire Pinball's build details here: Project Wildfire

#15 rockyrocket

rockyrocket

    Enthusiast

  • Silver Supporter
  • 145 posts
  • Location:Bristol,UK

  • Flag: United Kingdom

  • Favorite Pinball: xenon

Posted 20 September 2011 - 02:09 PM

QUOTE (maxxsinner @ Sep 19 2011, 10:43 PM) <{POST_SNAPBACK}>
I hope I can help here with a breif guide to help those wanting to customise Pauls great program. A lot of this is explained in the LEDwiz document, and I have copied some of the document here but I have explained it a little further.

To customize the Ledset script for my cab, I found the SBx, GPS and the PBA commands the easiest to use, once you get your head around how they work.
You need to tell LEDwiz which outputs you are going to use by turning them on, then tell LEDwiz what you want those outputs to do (blink, ramp, brightness, etc)

So the SBx command works by addressing of the outputs on a specific driver chip. SB1 is for outputs 1-8, SB2 9-16 etc.
The next number is generated by 8 bit addressing of the outputs. Easiest described by the table below. The top row is the output number on the chip, the bottom row is the 8 bit address of that number.


So to generate the number you need, add the 8 bit address of the ouputs you want on together. Example - I want to use outputs 1,3 and 7 and the rest to remain off.
1 3 7
1 4 64 = 69

So my command to LEDwiz would be SB1:69. Do this for each of the 4 drivers and you ready to go to the next step.

GPS command. The GPS command is the speed setting for your blinking or ramping of your LEDs. This is a global command so it will affect all speeds. The value can be a number from 1 to 7, with 1 being the fastest pulse speed and 7 being the slowest.

The PBA command controls all the outputs of the LEDwiz in one line, but if they are not on in the SB command that you have done previous, the command for that output will fall on deaf ears. So in as described in the LEDwiz command reference

0 to 48 will set the brightness of the LED/Globe via PWM

129 = Ramp Up / Ramp Down
130 = On / Off
131 = On / Ramp Down
132 = Ramp Up / On
The speed is controlled by the Global Pulse Speed parameter.

PBA:48,48,48,129,48,48,48,48,48,48,48,48,48,20,48,48,48,48,48,48,48,48,48,48,48,
48,48,48,48,48,48,48

Output 4 set to a "sawtooth" pulse, output 14 is set to an intensity of 20 and the rest of the outputs
are set to full brightness settings.

Hope that helps a bit gents.

Ok thanks max I will play with this and see what happens.
Guess i need to use a PBA then a wait, PBA, wait ect.


#16 rockyrocket

rockyrocket

    Enthusiast

  • Silver Supporter
  • 145 posts
  • Location:Bristol,UK

  • Flag: United Kingdom

  • Favorite Pinball: xenon

Posted 20 September 2011 - 08:15 PM

Ok, i have the effect i was after (the cylon effect) so if this helps others i will give my example.
So I have my buttons as..
COIN = port 18
LOAD = port 19
SHOOT BALL = port 20
And my red backbox LEDS from left to right are 14 - 11 - 8 - 4 - 1
and my ledset is edited as fallows..

Delay = 100 ' Delay 10ms between commands

On Error Resume Next

Set LedControl = CreateObject("LEDWiz_Control.LED_Wiz")

If LedControl Is Nothing Then
MsgBox "Error: Unable to initialize LEDWiz or Pac-Drive. Verify that the OCX or DLL is registered and the board is connected.",16
End If

LedControl.Command = "SBA:0,0,0,0,3" ' Reset all LEDWiz banks to off, set pulse speed to 1
WScript.Sleep(Delay)

LedControl.Command = "SB1:137"
WScript.Sleep(Delay)

LedControl.Command = "SB2:36"
WScript.Sleep(Delay)

LedControl.Command = "SB3:14"
WScript.Sleep(Delay)

LedControl.Command = "SB4:0"
WScript.Sleep(Delay)

LedControl.Command = "PBA:48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,48,48,0,0,0,0,0,0,0,0,0,0,0,0,"
WScript.Sleep(Delay)

LedControl.Command = "PBA:0,0,0,48,0,0,0,0,0,0,0,0,0,0,0,0,0,48,48,48,0,0,0,0,0,0,0,0,0,0,0,0,"
WScript.Sleep(Delay)

LedControl.Command = "PBA:0,0,0,0,0,0,0,48,0,0,0,0,0,0,0,0,0,48,48,48,0,0,0,0,0,0,0,0,0,0,0,0,"
WScript.Sleep(Delay)

LedControl.Command = "PBA:0,0,0,0,0,0,0,0,0,0,48,0,0,0,0,0,0,48,48,48,0,0,0,0,0,0,0,0,0,0,0,0,"
WScript.Sleep(Delay)

LedControl.Command = "PBA:0,0,0,0,0,0,0,0,0,0,0,0,0,48,0,0,0,48,48,48,0,0,0,0,0,0,0,0,0,0,0,0,"
WScript.Sleep(Delay)

LedControl.Command = "PBA:0,0,0,0,0,0,0,0,0,0,48,0,0,0,0,0,0,48,48,48,0,0,0,0,0,0,0,0,0,0,0,0,"
WScript.Sleep(Delay)

LedControl.Command = "PBA:0,0,0,0,0,0,0,48,0,0,0,0,0,0,0,0,0,48,48,48,0,0,0,0,0,0,0,0,0,0,0,0,"
WScript.Sleep(Delay)

LedControl.Command = "PBA:0,0,0,48,0,0,0,0,0,0,0,0,0,0,0,0,0,48,48,48,0,0,0,0,0,0,0,0,0,0,0,0,"
WScript.Sleep(Delay)

LedControl.Command = "PBA:48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,48,48,0,0,0,0,0,0,0,0,0,0,0,0,"
WScript.Sleep(Delay)

I have not found a way of looping this so just repeat the obove commands.
Anyone have a more elegant solution for this?.

#17 Darkfall

Darkfall

    Enthusiast

  • Gold Supporter
  • 453 posts
  • Location:Langley, BC

  • Flag: Canada

  • Favorite Pinball: Attack From Mars, Scared Stiff

Posted 21 September 2011 - 05:54 AM

QUOTE (rockyrocket @ Sep 20 2011, 01:15 PM) <{POST_SNAPBACK}>
Ok, i have the effect i was after (the cylon effect) so if this helps others i will give my example.

I have not found a way of looping this so just repeat the obove commands.
Anyone have a more elegant solution for this?.


Looping will require the script to remain running, which will be a problem as things are currently designed, since there isn't anything in the FPLaunch code to kill the script before launching a table. If the script isn't killed first, the script will continue to loop while the table is trying to do it's stuff, so you'll have all kinds of stuff going on that looks weird.

Maxx's code sets the LEDWiz to blink/fade/whatever, then exits. The LEDWiz will continue to perform the functions it's been given until it receives new commands. Unfortunately, there isn't a way to feed it a set of commands to execute internally in a sequence, such as with the cylon eye effect, so you're stuck with simple things like blinking or fading on/off, etc. Also, the LEDWiz will apply effects like blinking simultaneously to all outputs set to blink, so you can't tell it to blink output 1, then 2, then 3 in a sequence - it'll blink 1, 2, and 3 together.

The Pac-Drive can accept a programmed script that it will execute continuously until told otherwise, but the LEDWiz can't, unfortunately.

The only other option, short of looping the script and killing it before table launch, is to use an output on the LEDWiz to trigger another board (such as an Arduino) that will do your sequenced animation until told to stop, but that starts getting complex and it's an extra expense - and it means the LEDs must be connected to both the LEDWiz and the Arduino board at the same time if they're to be used by both. Needless to say, this would be an advanced setup. You'd be better off with the looped script and modified FPLaunch, I suspect, or a simpler light show idea *grin*.

Edited by Darkfall, 21 September 2011 - 05:56 AM.

...Paul


Check out Wildfire Pinball's build details here: Project Wildfire

#18 rockyrocket

rockyrocket

    Enthusiast

  • Silver Supporter
  • 145 posts
  • Location:Bristol,UK

  • Flag: United Kingdom

  • Favorite Pinball: xenon

Posted 21 September 2011 - 03:34 PM

Ok thanks ,
I did not know if i was missing something.
The above way works as long as you copy the sequence many times over, mine runs to a stop after about a minute and quits as expected at table launch.
Think I will just do a bit more of the old copy n paste action to extend it, guessing there is no limit to the size of ledset?.
I have been thinking of buying an Arduino to play with outside of pinball, but am wondering what are the advantages of using a ledwiz as opposed to just using an Arduino for everything?.


#19 numiah

numiah

    Pinball Fan

  • Members
  • PipPipPipPip
  • 983 posts
  • Location:Netherlands

  • Flag: Netherlands

  • Favorite Pinball: TOTAN

Posted 21 September 2011 - 04:28 PM

I recall a limit of 255 instructions.

**Each pinball machine is a tiny universe... that we control.**


#20 rockyrocket

rockyrocket

    Enthusiast

  • Silver Supporter
  • 145 posts
  • Location:Bristol,UK

  • Flag: United Kingdom

  • Favorite Pinball: xenon

Posted 21 September 2011 - 07:21 PM

Just did a test with 4100 ish lines and all works ok
heres a crappy vid..

Edited by rockyrocket, 21 September 2011 - 07:28 PM.