May 18, 2024, 04:41:18 AM

News:

Be sure to checkout our Vixen interfaces in the Library forum -- if you want PC automation at near zero cost, EFX-TEK and Vixen is a great combination of tools.


Product development questions for HC-8+

Started by michilson, September 09, 2014, 08:43:30 AM

Previous topic - Next topic

michilson

Okay guys this isnt a Haunt prop question it's more of a DMX (Lighting / Control) Question for the EFX-TEK team or someone with background on the HC-8

I'm looking for a Device to take DMX commands (8 Channels might be less read below for listing) and issue commands.

Here is the List of control I need.

Channel 1 120V Relay On / Off
Channel 2 120V Relay On / Off
Channel 3 12V Polarity Normal
Channel 4 12V Polarity Reversed
Channel 5 (Voltage Unknown) RED LED (With DIMMING) (VALUE 0 = OFF 255 = Full ON)
Channel 6 (Voltage Unknown) GREEN LED (With DIMMING) (VALUE 0 = OFF 255 = Full ON)
Channel 7 (Voltage Unknown) BLUE LED (With DIMMING) (VALUE 0 = OFF 255 = Full ON)

I believe the LED Voltage is either to be 3.3V, 5V, or 12 Volts.

This will be going into a new product and I might look at sending this for a UL listing.

I also have to sort out how all the power will be run how it will be connected and all other data development.

But can some one help me with if the HC-8+ can handle this task? Maybe help me with what the code for something like this will look like and so on!

Thanks for the help guys as the HC-8 is new to me and i don't know much about it's capabilities.



JonnyMac

September 09, 2014, 09:48:51 AM #1 Last Edit: September 09, 2014, 09:51:34 AM by JonnyMac
QuoteOkay guys this isnt a Haunt prop question it's more of a DMX (Lighting / Control) Question for the EFX-TEK team or someone with background on the HC-8

That's okay, we're not a "haunt" or Halloween company, we're an electronics company that focuses on entertainment. Disneyland, Legoland, and Hollywood prop shops use the HC-8+ for its Propeller and DMX capabilities.

Have a look at the display in this thread. That uses an HC-8+ to control several DMX "bricks" to simulate fire (bear) and smoldering wood (trees).

-- http://www.efx-tek.com/php/smf/index.php?topic=2132.0


The main code loop for what you describe would be VERY EASY -- something like this:

pub main | t, addr, ch, level

  setup_io                                                      ' configure HC-8+ io pins
  setup_objects                                                 ' configure software objects

  repeat
    addr := dmx_address(true)                                   ' read address switch
   
    repeat ch from 0 to 3                                       ' digital outputs
      level := dmx.read(addr++)                                 ' read channel and advance address
      if (level => 128)                                         ' at or above 50%?
        outs.high(ch)
      else
        outs.low(ch)

    repeat ch from 4 to 6
      outs.set(ch, dmx.read(addr++))                            ' set rgb outputs 



It's easy because I have written standard libraries for DMX input, as well as PWM for the outputs. In your case the first four channels are being treated in a digital manner, hence they are compared to a threshold (I used 50%). As you can see, the levels for the RGB outputs are read directly from the DMX buffer into the PWM driver.

There is a 9-bit DMX address switch on the HC-8+ that is read at the top of the loop; this lets you change the DMX device address on-the-fly.


QuoteThanks for the help guys as the HC-8 is new to me and i don't know much about it's capabilities.

As you can see, with our libraries and expertise, this is an easy task for the HC-8+. I've attached the full (untested, but I'm very confident it will work the first time) software archive.
Jon McPhalen
EFX-TEK Hollywood Office

michilson

September 10, 2014, 09:38:05 AM #2 Last Edit: September 10, 2014, 09:45:02 AM by michilson
Thanks for the Help this is Great. This is a 2 part question.

Can we set a few more points for channel 3&4 like maybe so we have steps (25%, 50%, 75%, 100%) IE. DMX = 0 Bottom Out, DMX CHANNEL = 25% Linear Action goes to Position 1, DMX = 50% Position 2, DMX = 75% Position 3, DMX = 100% Full Movement.

And can a Electric Linear Actuator stop at these steps? or is it a All or nothing type of device? Not familiar with that type of product. I know Pneumatic Actuators are a all or nothing type device.

Does the code account for a polarity swap on channel 3? The goal is to Drive a Linear actuator up and down based on the points listed above. It will work as a all or nothing but I'm hoping to make it stop in several spots to adjust the amount movement.

The other question is can the HC-8 step down the Voltage for the LEDS if Needed or will i need another circuit for that? If they are not driven with 12V Dc.

Once this is covered I think I can go onto Product Prototyping and Seeing if this will actually work!

Thanks for the Help guys. I'll keep everyone in the Loop as this product develops.


JonnyMac

The root word of "specification" is "specific." Please keep that in mind when asking for more code.

QuoteCan we set a few more points for channel 3&4 like maybe so we have steps (25%, 50%, 75%, 100%) IE. DMX = 0 Bottom Out, DMX CHANNEL = 25% Linear Action goes to Position 1, DMX = 50% Position 2, DMX = 75% Position 3, DMX = 100% Full Movement.

The code can act on any of the 256 channel values (0..255), and or ranges. That's not a problem.

QuoteDoes the code account for a polarity swap on channel 3? The goal is to Drive a Linear actuator up and down based on the points listed above. It will work as a all or nothing but I'm hoping to make it stop in several spots to adjust the amount movement.

I'm not sure I understand you. The first version of the code simply turns the output on or off based on a threshold. If you're attempting to reverse electrical polarity to some device, you will need to use an external relay to assist. We've done that before. Like this:



Note: Connections are show for a Prop-1/Prop-2 Controller. With the HC-8+ the 12V and GND connections to the relay would be reversed.

QuoteThe other question is can the HC-8 step down the Voltage for the LEDS if Needed or will i need another circuit for that? If they are not driven with 12V Dc

The outputs are 12v; you would use 12v-compatible LEDs or appropriate current limiters with them -- that's easy; simple application of Ohm's Law.
Jon McPhalen
EFX-TEK Hollywood Office

michilson

Quotepub main | t, addr, ch, level

  setup_io                                                      ' configure HC-8+ io pins
  setup_objects                                                 ' configure software objects

  repeat
    addr := dmx_address(true)                                   ' read address switch
   
    repeat ch from 0 to 3                                       ' digital outputs
      level := dmx.read(addr++)                                 ' read channel and advance address
      if (level => 128)                                         ' at or above 50%?
        outs.high(ch)
      else
        outs.low(ch)

    repeat ch from 4 to 6
      outs.set(ch, dmx.read(addr++))                            ' set rgb outputs
 


So can you help me with the Code here's a better brake down of Channels.

Ch 1 &2 On or Off at DMX 128 ' 0-128 = Off 128-255 = ON

Ch 3 & 4 (DMX VALUE 60 , 120, 200, 255) ' 0 - 60 = Position 1, 60 - 120 = Position 2, 120 - 200 = Position 3, 200 - 255 = Position 4

On for (x mil Sec) then off (Positions 1 - 4)  ' Running a Linear Actuator to position then stopping.

Ch 5 - 7

CH 5 Red LED 0 = off, 255 = Full ON (Diming between)
CH 6 Green LED 0 = off, 255 = Full ON (Diming between)
CH 7 Blue LED 0 = off, 255 = Full ON (Diming between)

Ch 8 (Strobe) 0 = Off , 10 - 240 = Slow to Fast, 255 = ON

I understand the Code for CH 0&1 ON/OF

    repeat ch from 0 to 1                                       ' digital outputs
      level := dmx.read(addr++)                                 ' read channel and advance address
      if (level => 128)                                         ' at or above 50%?
        outs.high(ch)
      else
        outs.low(ch)

Basic on / off simple

And I Understand the RGB

    repeat ch from 5 to 7
      outs.set(ch, dmx.read(addr++))                            ' set rgb outputs

Basic Ch Value matchs DMX Value Simple.

I think CH 8 STROBE would be a add to the RBB code for blink rate correct?

And CH 3&4 would have various conditions for the DMX value. The conditions would have to be to keep track of current location and then add time for new location.

Accounting for position changes. to go from 0 - 255 = Position 1 + 2 + 3 + 4

Not sure how to write these couple things in Code can you help?

JonnyMac

Remember when I started my last message like this:

QuoteThe root word of "specification" is "specific." Please keep that in mind when asking for more code.

I'm going to keep saying that until you provide more specifics. I can only answer the questions that I understand.

This bit of code:

     if (level => 128) 

...will look for a value that is equal (=) or greater (>) than 128; that is to say that values 0..127 are off, 128 to 255 are on.

I don't know anything about position value on channels 3 and 4. At the moment, it simply writes the DMX value to the output. If the PWM signal from the output can modulate something to cause it to move to a position, great. That siad, I don't know of such a device and you haven't provided any information that I can help you with.

Again, specifics count. What kind of device are you wanting to connect to those outputs? Please provide a link to a device so we can look at the specifications for it.

BTW... it can be hard to write code when no context is given. What does this device do?

QuoteNot sure how to write these couple things in Code can you help?

Only to the degree to which you will provide specifics. Right now, you know a lot of information that you're not sharing. We're engineers, not mind-readers! :)

Specifics. Specifics. Specifics.

Once we know what you want, we can and will show you the way!

Jon McPhalen
EFX-TEK Hollywood Office

michilson

Well for now I can't share to much detail about this because I am looking to patent this for sale to a major manufacture.

The specifics of the CH 3 & 4 are to drive 2 SPDT Relays that run a linear actuator. The Goal is at the DMX Steps the motor in the actuator runs for a set amount of time.

Lets say for example that the actuator takes 12 sec to travel from the bottom out position to the fully extended position. If we divide that by 3 positions we get a 4 Sec Travel per position.

So now we Index this based on a Variable.

SO here we go :

CH 3

DMX Value 0 - 63 = Variable 1               (At Bottom)
DMX Value 64 - 126 = Variable 2           (At 4sec of Travel)
DMX Value 127 - 189 = Variable 3         (At 8 sec of Travel)
DMX Value 190 - 255 = Variable 4         (At 12sec of Travel Fully Extended)

This gives us 4 points in time to travel to. Along a Linear Actuator.

I also need a Condition the CH 4 using the Same Variables is at variable 1 (0 - 63) or (Off)

Next is the Variable for Travel of the Actuator

CH 3 = ON for 4 sec then Off

Now we need a condition where we are to where we want to go.

that if we are on variable 2 and the DMX value goes to between 190 - 255 that ch 3 is on for 8 SEC.

Or if we are at 0 and goes to 255 then Channel 3 is on for 12 sec.

I believe this would be a Loop Count type function using some math

New value - current value = loop Count.

Now we have the Actuator Extended. Now Ch4 will retract the actuator in the same steps working the code backwards.

Again we need a condition that CH3 is between 0-63 (Off)

And again we need our variable positions (1 , 2, 3, 4)

And our Time loop

This time our math reads Current position - new position = Loop Count.

4-2=2 Loops threw travel code.

I hope this helps explain what my goal is on this?

I'm hoping to do a bit of conditional math based on the DMX value to turn CH 3 & 4 on and off a calculated number of times for a specific length of time. 

Hopefully this clarifies what I'm looking for.









JonnyMac

September 12, 2014, 01:05:33 PM #7 Last Edit: September 12, 2014, 02:03:39 PM by JonnyMac
QuoteWell for now I can't share to much detail about this because I am looking to patent this for sale to a major manufacture.

Okay, but please keep in mind that you hamper those that might help you. I'll do my best with the information you can provide.

Is Channel 4 a separate linear actuator that can also go forward and back?
-- each actuator requires 2 outputs (move and direction using relay circuit above)

If you have two actuators you come up one channel short

OUT0 (DMX 1) Relay
OUT1 (DMX 2) Relay
OUT2 (DMX 3) Actuator 1 Direction
OUT3 (DMX 4) Actuator 1 Move
OUT4 (DMX 5) Actuator 2 Direction
OUT5 (DMX 6) Actuator 2 Move
OUT6 (DMX 7) LED Red
OUT7 (DMX 8) LED Green

... whoop, no more outputs for blue channel

No problem! You can use a single output to control one (or more WS2812) LEDs with my driver. WS2812s are smart, RGB LEDs on a mini network. Here's an couple examples:

-- http://www.adafruit.com/products/1612
-- http://www.adafruit.com/products/1643
-- http://www.adafruit.com/products/1138

By my reconing, you would have these cogs in use by the HC-8+'s Propeller processor:

-- Cog 0 = Main program
-- Cog 1 = DMX receiver
-- Cog 2 = WS2812 driver
-- Cog 3 = Inputs monitor (used by Cogs 4 and 5)
-- Cog 4 = Actuator 1 movement
-- Cog 5 = Actuator 2 movement
-- Cog 6 = not used
-- Cog 7 = not used

Note that there is no PWM driver because the first two channels are digital outputs, and without enough channels for separate RGB channels, the WS2812 driver is used for the LED.
Jon McPhalen
EFX-TEK Hollywood Office

michilson

September 12, 2014, 03:21:29 PM #8 Last Edit: September 12, 2014, 03:27:27 PM by michilson
We are getting very close!

Out2 will open and close the extend Relay.
Out3 will Open and Close the Retract Relay.

The Relays will be wired like shown above. This will work perfectly Stalling the Actuator with +12V on both side. however I might reverse this so that it stalls with Ground on both side Opening to 12v. I'll just have to modify in the notation of the control which Out opens and closes the Actuator.

There is only a single actuator, But you could run 2 (As a paired set).

That should free up OUT6 & 7

Out 6 for the Blue LED's

And Out 7 for Future or Possible strobe (Blink Rate adjustment) on the Common side of the Red green and Blue LED's

Thanks so much for all the help.





JonnyMac

Let's get this straight:

OUT0 - Relay (digital control)
OUT1 - Relay (digital control)
OUT2 - Actuator Direction
OUT3 - Actuator Movement
OUT4 - Red LED
OUT5 - Green LED
OUT6 - Blue LED
OUT7 - Available for use

In this case, I would allocate cogs like this:

Cog 0 - Main program
Cog 1 - DMX receiver
Cog 2 - PWM driver (can be used for digital outputs)
Cog 4 - Actuator control (home sense and output control)

Are we on the same page?
Jon McPhalen
EFX-TEK Hollywood Office

michilson

I think we are on the same page.

I'm not sure what exactly you mean by actuator direction and movement.

The image you posted shows to relays controlling the flow of the 12v & ground. with the actuator connected if Out 0 is active the actuator will move in the Out Direction. If Out 0 is Off and Out 1 is Active the actuator will move in the IN Direction.

So there really isnt a Direction & Movement Channel.

There is Extend and Retract. Both outputs off equals a stop.  Hopefully this can be coded this way to make understanding it easy.

I'm researching the requirement for the LEDs. How do I connect them to drive them via the PWM driver? And what would be the voltage of that? SO I can make sure I dont burn out the LED Boards.

Thanks.

michilson

This is my understanding of the wiring for the actuator please advise if I am missing something. If out 2 Extends the Actuator when active. and Out 3 retracts the actuator when active.

Thanks for all the help with this.

JackMan

You have the wiring correct. You just need to verify which polarity direction retracts and which one extends.

JonnyMac

That is not correct for the HC-8+ which uses a high-side driver on its outputs. You need to swap the +12v and GND terminals on your relay.
Jon McPhalen
EFX-TEK Hollywood Office

JackMan

Yep, Jon is correct, I forgot this was for the HC8+ outputs.