Hello Im building a final project for school and I was looking for some input on how to structure my program, first I'll cover what it does, how it works, then what I need out of a program. Im not asking for it to be done for me just some ideas. i use micrologix 1000 PLC.
http://img706.imageshack.us/i/rockband.png/
This is a diagram I drew in paint. Thats a TV with the Rockband Video game playing on it. The brown is the wood housing for the sensors, the red is the sensors, When A note goes by they turn a PLC input on. The sensing circuitry is extremely fast. (nano seconds). Each sensor is hooked to input from left to right, I:0/0 to I:0/4 respectivly, 5 sensors.
Here is a youtube video of someone playing the game if you are unfamiliar:
http://www.youtube.com/watch?v=mYrqnDe1ENs
The guitar will be controlled by outputs. There will be 6 used outputs. 5 Buttons and 1 strum bar. The outputs will control mechanical relays. O:0/0 to O:0/4 For different colours on guitar, O:0/5 being the strum bar.
What I need from the program:
This is where it gets a little confusion for me because Im not great with PLCs, but heres what I want to do:
Sensors are slighly above where you actually have to strum the notes, this is necessary otherwise the sensors double hit from the small explosion it makes when u hit a note. So there will need to be a delay in the program, with some adjustment.
I was thinking of controlling the program with a bitshift shifting on a very small timer.
Heres the situations it needs to cover:
Green sensor is ON:
Short Delay, Green Button (O:0/0 is pressed Slightly early (5-50ms gotta test)
Strumbar is pressed on the exact time (O:0/6)
Green button stays on. (latching bit?)
The reason for the buttons stay on is that if there is a bunch of the same colour notes in a row it doesnt release and push.
For every other colour it needs to do exactly what is listed above. However its going to unlatch the bit before it presses another button under certain conditions.
If it is a single button, always unlatch button before new button is pressed, unless it is the same button twice in a row.
Make sure that if theres 2 buttons that need to be pressed at once it works under same principle.
Example.
Green note comes, it plays it and holds green..... yellow note comes it unlatches green then plays the yellow.... yellow green pair come at same time, holds yellow still and presses green also and plays it.
Im not sure how fast I can do a timer on a micrologix I gotta check but heres what i had in mind, kinda just restating the above.
For green note:
10ms Intervals
1 0 0 0 0 0 0 1 1 1 0
^ ............. ^ ^ ^ -- Note held for 3 pulses 30ms, Strum on just middle 1
Note detected
Not sure how to do all the latching bits n stuff help will be appreciated, if you read all this thanks so much
Kevin
http://img706.imageshack.us/i/rockband.png/
This is a diagram I drew in paint. Thats a TV with the Rockband Video game playing on it. The brown is the wood housing for the sensors, the red is the sensors, When A note goes by they turn a PLC input on. The sensing circuitry is extremely fast. (nano seconds). Each sensor is hooked to input from left to right, I:0/0 to I:0/4 respectivly, 5 sensors.
Here is a youtube video of someone playing the game if you are unfamiliar:
http://www.youtube.com/watch?v=mYrqnDe1ENs
The guitar will be controlled by outputs. There will be 6 used outputs. 5 Buttons and 1 strum bar. The outputs will control mechanical relays. O:0/0 to O:0/4 For different colours on guitar, O:0/5 being the strum bar.
What I need from the program:
This is where it gets a little confusion for me because Im not great with PLCs, but heres what I want to do:
Sensors are slighly above where you actually have to strum the notes, this is necessary otherwise the sensors double hit from the small explosion it makes when u hit a note. So there will need to be a delay in the program, with some adjustment.
I was thinking of controlling the program with a bitshift shifting on a very small timer.
Heres the situations it needs to cover:
Green sensor is ON:
Short Delay, Green Button (O:0/0 is pressed Slightly early (5-50ms gotta test)
Strumbar is pressed on the exact time (O:0/6)
Green button stays on. (latching bit?)
The reason for the buttons stay on is that if there is a bunch of the same colour notes in a row it doesnt release and push.
For every other colour it needs to do exactly what is listed above. However its going to unlatch the bit before it presses another button under certain conditions.
If it is a single button, always unlatch button before new button is pressed, unless it is the same button twice in a row.
Make sure that if theres 2 buttons that need to be pressed at once it works under same principle.
Example.
Green note comes, it plays it and holds green..... yellow note comes it unlatches green then plays the yellow.... yellow green pair come at same time, holds yellow still and presses green also and plays it.
Im not sure how fast I can do a timer on a micrologix I gotta check but heres what i had in mind, kinda just restating the above.
For green note:
10ms Intervals
1 0 0 0 0 0 0 1 1 1 0
^ ............. ^ ^ ^ -- Note held for 3 pulses 30ms, Strum on just middle 1
Note detected
Not sure how to do all the latching bits n stuff help will be appreciated, if you read all this thanks so much
Kevin
Last edited: