Jump to content

LED-wiz alternative ?


pixelmagic

Recommended Posts

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.

I've noticed this myself. I thought I would be completely stutter free if I threw enough hardware at the problem, but even with a core i5 2500k overclocked to 4.6ghz and a GTX 560 TI I still get stutter occasionally on problem tables (ie: TOM captive ball). If I unplug the LEDWiz I don't notice any stutter with the table.

Here's hoping that someone will be able to find a solution to the problem. :)

Link to comment
Share on other sites

  • Replies 363
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

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

You 've to keep in mind that some blinkin features are provided by the script itself and vpinball do nothing about it (timers are one of this features and also whenever you use the B option iin the script)

So be aware that you've to provide some sort of timing for each output and this will be hardware controlled by arduino. If you look at the ledwiz script code you'll find the related code easily:

'out is temporized ?

If (IsTemporized()) Then

' if output is active in ROM and timer is not running

If ((OutsPD<>0) and not m_TimerOn) then

' activate the output

OutsPD=OutsPD Or m_l2Power(OutNum)

' init the timer m_TimerCount= 0

' set up the flag for indicating timer is running

m_TimerOn=True

' is this a shaker ?

If (m_ShakerInt>0) Then

' then set the intensity level

SetOutputIntensity outNum,m_ShakerInt

End If

' if timer is running

ElseIf m_TimerOn then

' increment it gTimerFreq ms

m_TimerCount=m_TimerCount+gTimerFreq

' its there freq interval?

if (m_Repeat<>0) then

if (m_repeatCount>=m_FreqTime) then

OutsPD=OutsPD Or m_l2Power(OutNum)

m_RepeatCount=0

else

OutsPD=0

m_RepeatCount=m_RepeatCount+1

end if

Else

' output is still active

OutsPD=OutsPD Or m_l2Power(OutNum)

end if

End if

' timer expired?

If (TimerExpired(m_TimerCount) and m_TimerOn) Then

' switch off the output

OutsPD=0

' reset time counter

m_TimerCount = 0

' switch off timer

m_TimerOn=false

m_RepeatCount=0

End if

End If

Keep in mind this code does not send signals to the ledwiz, it only mask the bits on the OutsPD variable ( a 32 bit value containing the states of all the outputs), this is done lately in the code

' did the outsputs changed?

If (OutsPD<>lastOutputStates) Then

' send the states to ledwiz

LedControl.Command ="SBA:" & (OutsPD and &hFF) & "," & (RShift(OutsPD,8) and &hff) & "," & (RShift(OutsPD,16) and &hff) & "," & (RShift(OutsPD,24) and &hff) & ",1"

' store latest send value

lastOutputStates=OutsPD

End If

This code maybe its a bit difficult to read but this is due the lack of vbscript for bit swifting operations, rshift functions shift the bits correctly the corresponding number of bytes, notice also that we only send values to ledwizard if there is something that has changed, i keep track of the last states in lastOutputStates.

Edited by Mr.Silver
Link to comment
Share on other sites

Thanks for the detailed discussion gents.

I had planned on an LEDWiz in my cabinet, but now think I will skip it. I'd prefer no stutter to a few LEDs in the cabinet.

Spektre

Stutter is not a major problem. Just a select few tables have very slight stutter for a few events. 99% of the tables play just fine.

IMO, having the devices greatly outweighs the few stutter issues I have encountered. I'm really glad I did it.

Link to comment
Share on other sites

You must be sacrificing virgins to the virtual pinball gods, because I could not get all of my tables completely stutter free, and my machine is fairly high end. I tried pretty much everything suggested in the vp performance thread, but TOM still gives me problems.

Link to comment
Share on other sites

I agree with Chriz, mine has only the tiniest stutter on a couple of tables, with very little tweaking. With a little effort on my part, I'm sure I could eliminate it completely. I think the key is to minimize the simultaneous events to keep it running smoothly.

I'm not using the Cree RGB lightshow so I have a relatively balanced load on the ledwiz. (11 light circuits, shaker on a dual h bridge, gear motor).

For spektre.....the stutter issue isn't like an endless loop, when it happens it's more like a quick glitch in the gameplay so I wouldn't let that deter you from putting one in.

Link to comment
Share on other sites

Stutter is not a major problem. Just a select few tables have very slight stutter for a few events. 99% of the tables play just fine.

IMO, having the devices greatly outweighs the few stutter issues I have encountered. I'm really glad I did it.

Totally agree with you DeeGor. The occasional stutter is pretty rare and without the contactors and lights flashing like mad, it just wouldn't be the same.

Link to comment
Share on other sites

Totally agree with you DeeGor. The occasional stutter is pretty rare and without the contactors and lights flashing like mad, it just wouldn't be the same.

I appreciate the input, but for me the gameplay is king. I'd rather do away with blinkers and wire the contactors up directly than suffer the hiccups.

Link to comment
Share on other sites

I appreciate the input, but for me the gameplay is king. I'd rather do away with blinkers and wire the contactors up directly than suffer the hiccups.

I agree with you game play is king. And without the flashers and feedback game play is very lacking.

I really don’t enjoy playing games without flashers/feedback.

Link to comment
Share on other sites

You 've to keep in mind that some blinkin features are provided by the script itself and vpinball do nothing about it (timers are one of this features and also whenever you use the B option iin the script)

So be aware that you've to provide some sort of timing for each output and this will be hardware controlled by arduino. If you look at the ledwiz script code you'll find the related code easily:

          'out is temporized ?
         If (IsTemporized()) Then 
           ' if output is active in ROM and timer is not running
           If ((OutsPD<>0) and not m_TimerOn) then     
                ' activate the output
                     OutsPD=OutsPD Or m_l2Power(OutNum)
                     ' init the timer                      m_TimerCount= 0
               ' set up the flag for indicating timer is running
               m_TimerOn=True            
               ' is this a shaker ?
               If (m_ShakerInt>0) Then 
                   ' then set the intensity level
                   SetOutputIntensity outNum,m_ShakerInt
               End If 
           ' if timer is running
           ElseIf m_TimerOn then
               ' increment it gTimerFreq ms
               m_TimerCount=m_TimerCount+gTimerFreq
               ' its there freq interval?
               if (m_Repeat<>0) then                 
                   if (m_repeatCount>=m_FreqTime) then 
                       OutsPD=OutsPD Or m_l2Power(OutNum)    
                       m_RepeatCount=0
                   else
                       OutsPD=0
                       m_RepeatCount=m_RepeatCount+1
                   end if 
               Else
                   ' output is still active
                   OutsPD=OutsPD Or m_l2Power(OutNum)
               end if 
           End if 
           ' timer expired? 
           If (TimerExpired(m_TimerCount) and m_TimerOn) Then     
           ' switch off the output
                  OutsPD=0
                 ' reset time counter
                 m_TimerCount = 0
               ' switch off timer
               m_TimerOn=false
               m_RepeatCount=0
             End if
         End If

Keep in mind this code does not send signals to the ledwiz, it only mask the bits on the OutsPD variable ( a 32 bit value containing the states of all the outputs), this is done lately in the code

' did the outsputs changed?
If (OutsPD<>lastOutputStates) Then 
   ' send the states to ledwiz
   LedControl.Command ="SBA:" & (OutsPD and &hFF) & "," & (RShift(OutsPD,8) and &hff) & "," & (RShift(OutsPD,16) and &hff) & "," & (RShift(OutsPD,24) and &hff) & ",1"
   ' store latest send value
   lastOutputStates=OutsPD
End If

This code maybe its a bit difficult to read but this is due the lack of vbscript for bit swifting operations, rshift functions shift the bits correctly the corresponding number of bytes, notice also that we only send values to ledwizard if there is something that has changed, i keep track of the last states in lastOutputStates.

Hello mr Silver,

Again thanks for the info. I have the idea that we are not talking on the same subject here.

The thing i see a problem with is in case of the ROM sending a signal that blinks (lets say the Start game button, going on-off-on-off-on-off).

It would be nice if we could somehow recognize that ROM signal and convert it to a logical signal (on/off/blink fast/blink slow) in the VBscript.

After that we would send that specific command to the Arduino and let it handle the true blinking (just like LEDwiz).

I got some parts in today to make a driver for the Arduino so we can control high powered toys like CREE RGB leds and shakers. I hope to get that working soon.

Link to comment
Share on other sites

So you mean that this would not slow down vp if it would be recognized and converted to logic?

But if every table have their own unique ROM signals, do you think the limit of 250 events will do? though if you got like 100 tables you only got 25 events per table.. :D

Love this progress though!

Cheers!

Link to comment
Share on other sites

Where can I read up on how this is done? I get the Arduino programming. What traps ROM events and how are they provided to other applications (ie this and LEDWiz)?

Thanks,

Spektre

Can you read my mind ? :proud:

But serious, the whole thing is under heavy construction. Basicly it goes like this:

I have a separate arduino.vbs. This opens a sreial port to the connected Arduino. The ROM events can be read in the vbs using controller.[switch/solenoid/lamp].

After you get an 'correct' hit data is send to the Arduino and depending on the input it makes a effect (or drives another toy).

Hope this clears some things up ?

Link to comment
Share on other sites

All right, made some progress in putting together a prototype of the driver for connecting toys to the Arduino. Made some videos.

First test:

yipL8jlORJM

Test with PWM and gear motor connected (off, 50% and 100&)

Qj88WEkuQs4

Slow starting:

IZMT-XpTvao

Just fooling around:

cID9APyEFdE

Link to comment
Share on other sites

Ok, time for some updates.

I have talked with Mr Silver a few times and we are both at the point where we think that it can be done in a way that it adds a lot of extra possibilities and we have got both the idea that it could be stutter free.

We have done some time calculations and all things seem to be better in speed. That we have more possibilities is just a fact, the video shows that.

We are a long way from having a standard solution and it is going to need extra hardware (not expensive at the point) and i am designing 2 different driver boards, one for max 500ma per output and another for max 16 amps (!!!). The arduino itself can only drive 20ma. Think about $2-3 per output in parts max.

Thats all for now

Link to comment
Share on other sites

I've been looking at an LED-Wiz alternative too.

Okay each pcb has 4 x eight darlington array IC's. Which gives you a total of 32 outputs. The only way to increase the amount of output's would be to add more IC's, giving possible 40, 48, 56, 64, 72, 80... outputs.

As for the talk about "stutter". Well I've read through this thread, rather briefly though, and I couldn't quite grasp what was meant by this. I can always assume but that's not certain.

I take it it's more or less a lag issue related to the LED-Wiz?

The 5th chip, the one in the middle of the pcb is the USB microcontroller IC, rated at 1.5mbps and having internal RAM of 256 bytes. As I'm not certain on the whole stutter thing I'm not 100% though I do believe this could relate to the stutter issue....

Link to comment
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

×
×
  • Create New...