Jump to content
pixelmagic

LED-wiz alternative ?

Recommended Posts

Hi all,

It all started with the never satisfied Chris wanting more and more on his cab. I had some ideas before on using a Arduino for the job.

Since then it has become more then a idea and i feel like sharing this with the community to see where it could end up.

The plan is like this:

We use a Arduino board instead OR beside a LEDwiz. The Arduino is a programmable board with lots of connections. You have to prgoram it to do something. This is a step to make, but i think a step worth taking.

The main thing is that a .vbs script (like the ledwiz.vbs) is catching the ROM events from VP/MAME and forward it to the Arduino thru RS232.

From that point the Arduino handles what happens. It controls a led/light going on or off, triggers a solonoid or starts a shaker. The bonus i think with this is that it could be possible to make series off effect with only 1 ROM event. Think of getting an extra ball and letting 10 leds on the siderail of your cab running up and down. Or a replay knocker getting fired 3 times instead of 1. Or even keeping things lit for a period of time.

From what i think at the moment is that it could be possible to have less lag in VP on much events. This because much less data is written over the USB port and in a different way.

The plan on this moment is to try and send ALL ROM events to the Arduino and on the Arduino design something that filters out the needed actions. The way i have it at this moment is that we have a maximum of about 250 events. Is this enough to catch ALL events from ALL pinballs at the moment ?

There are some pro's and con's on this approach. i will try to sum them up, feel free to add to them

Pro:

  • more outputs available
  • more options on creating effects with outputs
  • flexibility
  • possibility to piggy-bag Arduino's (multiple)
  • fun factor ;)

Con:

  • more and other hardware needed
  • Arduino cannot directly steer high amp stuff like CREE leds
  • Some programming skills needed to program Arduino (minor if good executed)
  • there is going to be some soldering needed
  • only 14 PWM outputs and 32 digital outputs
  • not sure on actual performance of Arduino

To show you the the concept could be working here is a little youtube video showing the Arduino with 2 leds, one for start game and one for launch ball, blinking at the same time the cab's lights are blinking.

rr9np3o75KI

Ok, lots of text and info, can't wait for your reactions on this, positive or negative ;)

At the end of it I would like to say that this idea would not be possible without the brilliant idea and design from manofwar and mr. silver.

links:

Arduino main site

The Arduino i use

Ebay

Edited by pixelmagic
added links

Share this post


Link to post
Share on other sites
...Hi all, It all started with the never satisfied Chris wanting more and more on his cab...

hahahaha, stagnation is regression (or: more toys - more fun :D )

I have ordered an arduino (costs only 25 bucks) for testing, can't wait to experiment :viking:

I am trying to contact manuel aka mr. silver, too - maybe he finds some time.

Share this post


Link to post
Share on other sites

Lol. Chris wants more in his cab? I swear, your cab Chris must be like the Tardis off Dr Who. More space inside than it's physical dimensions allow. :D

As for the PWM, if I am correct, any digital output can be used as PWM if coded correctly? SecrectsofArduinoPWM

And you missed one con. It would mean that I would have to rewire my entire cab......

Actually stick that one in the pro's. Stick certain divorce in the cons. :girlshit:

Share this post


Link to post
Share on other sites

i am currently working with an arduino uno for an ambilight project

btw not my video just an example would look great around a playfield if you could get it to work.

Share this post


Link to post
Share on other sites

while i dont have a pincab yet, reading all of the builds and how much more everyone seems to be adding I had been wondering if an Arduino setup would work out. I think this could really lead to some crazy options.

Share this post


Link to post
Share on other sites
Guest gstav

Thanks pal! You're not that bad in finding the lol side of pics either! :D

Share this post


Link to post
Share on other sites
Guest gstav

This is so awesome!

Really hope that this is the way for a stutter free pinball experience! :D

Share this post


Link to post
Share on other sites

Very Interesting!

I assume you mean you will program the box to handle lots of events, and then each ROM drives a specific event over USB via a script mapping the ROM event to a specific pre-programmed event on the arduino?

They are cheap too compared to led wiz!

i take it they can't handle the 500mA that the ledwiz can tho at 12V???

regards

Shifters

Share this post


Link to post
Share on other sites

To keep things simple: i think at this moment that the Arduino can be a nice extention to the LEDwiz. The LEDwiz will be easyer to connect and maintain, the Ardiono will require more technical knowledge about electronics and programming.

Regarding the output, the Arduino cannot supply as much electrical power as a LEDwiz (remember it was specialy designed for this stuff). So with the Arduino there will be need for some kind of other solution like relais, optocouplers or transistors when switching high power. But on the safe side, this is always better and much safer foor you and the other hardware.

At this time i am working on a second proof of concept that fits my cab. It will be beside the current LEDwiz extending the possibilities. I have some spare hours coming up and hope to get some work done.

@ Chris: watch it man, your gonna be a programming guru ! :)

Share this post


Link to post
Share on other sites

Hi people, now all the people is working with ledwiz with ID 00 but we can buy a ledwiz with ID 01 and we can add 32 more outputs. I will to buy a new ledwiz with ID 01 at groovygamegear and Mr.Silver can make a script update for work with 2 ledwiz at the same time. He says that's is easy to do this update and we can take our old ledwiz configs.

Regards!

Share this post


Link to post
Share on other sites
Hi people, now all the people is working with ledwiz with ID 00 but we can buy a ledwiz with ID 01 and we can add 32 more outputs. I will to buy a new ledwiz with ID 01 at groovygamegear and Mr.Silver can make a script update for work with 2 ledwiz at the same time. He says that's is easy to do this update and we can take our old ledwiz configs.

Regards!

Makes sense, had wondered the same myself

Share this post


Link to post
Share on other sites

it's always good to have alternatives. I am curious how the duo ledwiz id00+01 performs.

Share this post


Link to post
Share on other sites
Guest gstav
2 Ledwiz as well as Arduino control..... the plot thickens. :D

*lol*

Share this post


Link to post
Share on other sites
Hi people, now all the people is working with ledwiz with ID 00 but we can buy a ledwiz with ID 01 and we can add 32 more outputs. I will to buy a new ledwiz with ID 01 at groovygamegear and Mr.Silver can make a script update for work with 2 ledwiz at the same time. He says that's is easy to do this update and we can take our old ledwiz configs.

Regards!

Hi,

What i am wondering is, what will that do with the speed of things ? I i hear that Chris has stutter with hier absolute top of the bill system, what will others have. I notice stutter also on my cab with very low cpu speed and such. As far as i understand it, it has to do with the way LEDwiz handles the commands and the size of the commands. Will that become a problem seems the question.

I have no idea if the Arduino will do a better or worse job at it. The way i see it at the moment that it could be a nice addition to the LEDwiz, that's how i will gonna use it.

Please keep us posted on the progress with the second LEDwiz !

Erwin

Share this post


Link to post
Share on other sites

Hi All,

Did some coding today and have made some progress. Did some configuration specialy for MM, linking the flashers and the pop bumpers.

Here is a video:

hm2lD38U2SQ

Disabled my LEDwiz for this demo. Still a long way from a usable solution for everyone, but as you can see the concept is working just as well.

I think i will next try to finish up my backbox with the LED's and then driving that on special events with the Arduino.

Share this post


Link to post
Share on other sites
Guest gstav

Looks very interesting indeed! ;)

Did you notiec less stutter now? Maybe it's har to tell in such an early stage...?

Share this post


Link to post
Share on other sites

It's to early to say, but i would like to know where the stutter with LEDwiz comes from. I talked with Chris about it and we do not share the same thoughts ;)

I think it could be because of the way the LEDwiz works and possible the lack of buffer memory or that the LEDwiz somehow uses some kind of 'i am ready, next command' handshake or something like that. I experience stutter when there is a lot happening on the LEDwiz. When i removed the not used toys (in my case everything but the rgb leds) and i noticed less stutter.

The thing about the Arduino is that it uses the standard RS232 port for communications and has some buffering. Yesterday i tested with sending ALL ROM events to the Arduino and notices no stutter at all.

I am heating up the soldering iron at the moment for starting my animated backbox and plan to use the Arduino for that, with feeding of ROM events right beside the LEDwiz.

As stated before the main focus for me at the moment is creating things that are at the moment impossible or very hard to do with the LEDwiz.

Keep you posted.

Share this post


Link to post
Share on other sites

Hi everybody, first of all i don't want to discourage anybody from trying their own solution for vpinball, any contribution is always welcome and so this will give a chance to everybody to choose one wao or another for making their own virtual pinball.

Said that, i want to tell everybody a few things to make clear what could be achieved either with arduino or ledwiz systems.

The stuttering problem is not a problem about your computer, having a top notch system wouldn't save you from suffering stuttering when using external hardware. Fist of all is the way how vpinball works, vpinball uses a main loop for synchronizing with pinmame wich controls all the rom events. This means that vpinball does not stay sincronized with rom events altought you have this illusion because the timer fires many times per second. Ledwiz system also uses its own timer to check out rom events, latest versions of the script included a variable to adjust this time to suit your needs.

When the timer its fired the script does the job of checking the light states and so and send the instructions to ledwiz, the script sends just one command to the ledwiz for all the outputs (32) this is the fastest way to do it instead of setting each out individually.

Here is the problem, this command does the jod synchronously , this means that the script does not pass control to the next instruction until ledwiz has finished his job so the script have to wait for ledwiz to end.

Current ledwiz dll and ocx works synchronously, and that's the real problem for stuttering, if you want to avoid stuttering with arduino or other hardware you have to implement a asynchronous comunication something like this:

if arduino is busy wait for it

if arduino is not busy, send instructions asyncronously and let the

rest flow normally

Hopefully when the next timer event fires arduino will have finished doing its things and you don't have to wait for it but you have to make sure its not busy before sending instructions again or you'll hang it in a eternal loop causing the whole thing to freeze

That's the only solution i now that could make any real improvement to the virtual pinball lightning system. Because you don't stop the script too much waiting for the hardware to finish its things, you're letting the hardware work while you're are letting vpinball things to happen.

Other facts you'l have to take into consideration.

Arduino uses serial protocol (altought it connects trought and usb cable) , its serial standard comunication emulated, but the communication speed is the same, make sure you use the fastest baudrate but keep in mind that serial protocol is slow by nature.

From what I know arduino i/o is not the fastest thing in the world and their standard libraries slown down i/o output a lot, there are some direct hardware implementation for accesing the i/o of arduino on the web wich are a lot faster than the default ones make sure you use it too.

Good luck!

Share this post


Link to post
Share on other sites

Hi Mr Silver,

Thanks for your very detailed answer and for myself confirming the things that i suspected.

What you basicly say is that communications with the LEDwiz/Arduino should be as minimal as possible to avoid a device being 'busy' and then make VP stutter. Since the Arduino can be programmed i see some options in that way the LEDwiz does not have. Combined with maybe some other way of communication from the vbscript things could be possible.

The way the ROM sends signals is logical with a non-computer device attached to it (lamp, motor, solonoid). These hardware parts can handle a on/off state very well. When you send to a computer device you would rather have 3 different signals (on/off/blink) instead of a constant changing signal. Maybe there is a way in vbscript to detect a blinking signal in a reliable way so the signal to LEDwiz/Arduino is the correct (on/off/action).

I believe that the current way i send signals to the Arduino (only sending bytes) may help this a bit. On the Arduino side you could think of some sort of filtering data and in case of to much data in buffer just dropping some data, in order to keep data flowing from VP.

Anyway, thanks very much and any more insight on the working of things is very appreciated.

Erwin

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×