Shop OBEX P1 Docs P2 Docs Learn Events
Vixen and the Propeller Christmas lights controller - Page 2 — Parallax Forums

Vixen and the Propeller Christmas lights controller

2»

Comments

  • DynamoBenDynamoBen Posts: 366
    edited 2011-11-08 20:26
    turbosupra wrote: »
    I guess resolution is never an issue because the human eye can't see much past 60hz anyway?

    Exactly. Since the human eye is inefficient it just looks like the light is dim, but in reality we are switching it on and off really quickly. It's really just PWM.
    I'm looking at your code and I've never done anything with a DAT portion, so it make take me a while to figure out exactly how it works, thanks for linking to that!

    Remember this code is intended to control 4 shift registers, which makes it a bit more complex. If you removed the shift register code it's as simple as sensing zero cross, waiting the requisite amount of time, and then turning on the SCR.
  • JonnyMacJonnyMac Posts: 9,198
    edited 2011-11-08 20:47
    Since you have to switch the triac/scr each half cycle you're actually working at 120Hz. The code treats the "angle" in a linear fashion but, of course, this doesn't always result in a linear brightness output. Many advanced lighting consoles/programs allow for the definition of a compensation curve to "bend" the values for an output to achieve the desire results. I think Ben's code includes a compensation table for the output, something pretty easy to do in Spin.
  • DynamoBenDynamoBen Posts: 366
    edited 2011-11-08 20:56
    JonnyMac wrote: »
    The code treats the "angle" in a linear fashion but, of course, this doesn't always result in a linear brightness output. Many advanced lighting consoles/programs allow for the definition of a compensation curve to "bend" the values for an output to achieve the desire results. I think Ben's code includes a compensation table for the output, something pretty easy to do in Spin.
    .

    The development version of my channel driver (in the dev branch) does include a compensation table which isn't yet implemented in code. The released version (in the trunk branch) doesn't have this table in it.

    It is easy to implement in spin (I have one project doing that already), I'm hoping to implement it in assembly at some point.
  • turbosupraturbosupra Posts: 1,088
    edited 2011-11-09 05:53
    You all are going to laugh ... I'm trying to follow the DAT portion of the code but I don't even see where you define the output pins for the shift registers, it appears the phase monitoring pin is pin0.

    Are you using an optocoupler to interface monitoring the sine wave?
  • turbosupraturbosupra Posts: 1,088
    edited 2011-11-09 07:26
    I did find these (12v LED C7 bulbs) which will maybe un-complicate things for me.

    http://www.imaginarycolours.com/Merchant2/merchant.mvc?Screen=CTGY&Category_Code=12vBulbs
  • DynamoBenDynamoBen Posts: 366
    edited 2011-11-09 07:33
    turbosupra wrote: »
    You all are going to laugh ... I'm trying to follow the DAT portion of the code but I don't even see where you define the output pins for the shift registers, it appears the phase monitoring pin is pin0.

    When you say DAT portion do you mean the assembly code? If so the pin assignment comes from spin via a memory location.
    Are you using an optocoupler to interface monitoring the sine wave?

    Look at the schematic for the propcontroller, specifically the power schematic.
  • turbosupraturbosupra Posts: 1,088
    edited 2011-11-09 18:27
    Yes the assembly code. I haven't done anything in assembly and it looks like spin used to before I started learning the syntax of it.

    That schematic is a little busy, I'll have the pull up the data sheet on the m74hc4094 tomorrow.
  • DynamoBenDynamoBen Posts: 366
    edited 2011-11-09 19:17
    turbosupra wrote: »
    That schematic is a little busy, I'll have the pull up the data sheet on the m74hc4094 tomorrow.

    Sorry, its just duplication to accommodate all four chips. You don't need to understand the 4094 specifically any shift register tutorial should give you an idea how they work. Long story short is you shift out the data (32 bits in this case) and the latch the ICs (latching just applies what you sent to the ICs pins).
  • turbosupraturbosupra Posts: 1,088
    edited 2011-11-10 04:51
    No need to apologize, I have just forgotten (in detail) how shift registers work, so it's taking my brain a while to remember. How many prop pins are you using? One for the clock and one for the bit stream? I'll try and walk through this while typing ...

    I see the gates, I guess those are because the prop cannot provide enough current to be directly connected to the registers? Looks like output enable is tied high. All strobes are tied together and controlled by a single gate. Serial in is tied to the other chips output and all clocks are tied together and controlled by a single gate. So the first set of 8 bits end up at U1.1, the second set of 8 bits end up at U4.1, the 3rd set of 8 bits end up at U3.1 and the last set of 8 bits end up at U2.1 . It appears you are using 4 pins on the propeller which J1 connects to.

    How do the connections J3-J10 interface with the A/C?


    DynamoBen wrote: »
    Sorry, its just duplication to accommodate all four chips. You don't need to understand the 4094 specifically any shift register tutorial should give you an idea how they work. Long story short is you shift out the data (32 bits in this case) and the latch the ICs (latching just applies what you sent to the ICs pins).

    DynamoBen wrote: »
    Sorry, its just duplication to accommodate all four chips. You don't need to understand the 4094 specifically any shift register tutorial should give you an idea how they work. Long story short is you shift out the data (32 bits in this case) and the latch the ICs (latching just applies what you sent to the ICs pins).
  • DynamoBenDynamoBen Posts: 366
    edited 2011-11-10 07:39
    turbosupra wrote: »
    I see the gates, I guess those are because the prop cannot provide enough current to be directly connected to the registers?

    It's more a matter of voltage than current. I'm running 5V to the SCRs but the prop is 3.3.
    Looks like output enable is tied high. All strobes are tied together and controlled by a single gate. Serial in is tied to the other chips output and all clocks are tied together and controlled by a single gate.

    Correct, that is 3 pins total that drive the shift registers.
    So the first set of 8 bits end up at U1.1, the second set of 8 bits end up at U4.1, the 3rd set of 8 bits end up at U3.1 and the last set of 8 bits end up at U2.1 . It appears you are using 4 pins on the propeller which J1 connects to.

    Actually I believe its opposite of this because of the direction in which the code shifts the data out.
    How do the connections J3-J10 interface with the A/C?

    Good question, I connect to these, which actually performs the dimming.
  • DynamoBenDynamoBen Posts: 366
    edited 2011-11-10 08:09
    Here is a decent shift register tutorial: http://bildr.org/2011/02/74hc595/
Sign In or Register to comment.