May 18, 2024, 03:38:43 AM

News:

Got VSA?  Want to use your Prop-SX?  Now you can!  See the VSA section of the Library forum for Prop-SX code that works with VSA.


Product development questions for HC-8+

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

Previous topic - Next topic

JonnyMac

Here's a crack at your code based on on- and off-line discussions. It only uses one channel for actuator position (using two as suggested creates a conflict). The way the code is setup you can change the actuator position any time; it will simply reverse itself to the newly commanded position.
Jon McPhalen
EFX-TEK Hollywood Office

michilson

Thanks guys! The point is that I want the Relays to rest at GND not 12V. I cant wait to start working on building this thing after halloween get here I'm going to start the Proto-type Building the Molds and Ordering parts.

Thanks for all your help!

JonnyMac

QuoteThe point is that I want the Relays to rest at GND not 12V.

I don't know what that means. Your relays are connected to OUT0/GND and OUT1/GND. They are either on (OUTx is at 12v) or of (OUTx is off).
Jon McPhalen
EFX-TEK Hollywood Office

michilson

When the Relay 1 &2 isn't powered via OUT0 or OUT1 the Power on the Normally Closed connection of the Relay is at ground. This sends ground from the COM connection to both sides of the actuator. This should be better for the motor in the actuator than both sides being at 12V.

To address the position of the Actuator on startup we include a travel command that is longer than the total travel time of the actuator. the limit switch inside the actuator will stop it once it reaches the end of travel. Now we have a starting point or a (Home) location.

If there are any other questions please let me know. I think we have all the other issues sorted out.

JonnyMac

How you wire relays down steam is of no concern to the HC-8+; the relays will either be on or they will be off.

If there is no feedback of the actuator home position, then the program will be forced to put the actuator into retract mode for the maximum travel time at boot-up. This is the only way to guarantee the actuate is in the correct place for the program.
Jon McPhalen
EFX-TEK Hollywood Office

JonnyMac

Here's the update program.

Added: If IN0 is active, OUT0 and OUT1 (relays) will be off, otherwise they follow command from DMX channels 1 and 2

Added: After power-up, the actuator is commanded to retract for 15 seconds -- this is to allow it to move home. After this delay the program sets the intenal position variable to 0; this is used to move the actuator based on the target value from the DMX stream. DO NO REMOVE THE 15S START-UP DELAY.

Removed: Previous version used IN0 as the actuator home position sensor; all actuator code referring to IN0 has been removed.
Jon McPhalen
EFX-TEK Hollywood Office

JackMan

Quote from: michilson on September 23, 2014, 12:16:21 PM
When the Relay 1 &2 isn't powered via OUT0 or OUT1 the Power on the Normally Closed connection of the Relay is at ground. This sends ground from the COM connection to both sides of the actuator. This should be better for the motor in the actuator than both sides being at 12V.

It really doesn't matter if the actuator rests with both sides at +12V or at GND, no current can flow in either condition, hence no effect on the motor. That being said, here's another version of the wiring that will have the actuator resting with both sides at GND.

michilson

Thanks Jon & Jackman!

Jon can you point me to the location to adjust the Travel time for the actuator? For example if the stroke length changes?

i believe it's in this section of code correct? Adjusting the (4,8,12)

Quote    case check
      0..63:
        acttgt := 0_0                                           ' home

      64..127:
        acttgt := 4_0                                           ' move to 4s position

      128..191:
        acttgt := 8_0                                           ' move to 8s position

      192..255:
        acttgt := 12_0                                          ' move to 12s position

Also verifing the the DMX address
Quote   +0    - Relay 1  (0..127 = OFF, 128..255 = ON)
   +1    - Relay 2
   +2    - Actuator position
   +3    - RGB Red
   +4    - RGB Green
   +5    - RGB Blue

0 = the BASE DMX VALUE and the +1, +2 and so on is indexed from the base value Correct?

Final question for better understanding is:

Quoterepeat                                                        ' main movement loop
    waitcnt(t += constant(100 * MS_001))                        ' position in 0.1s units
   
    if (actpos < acttgt)                                        ' extend
      high(OUT2)
      low(OUT3)
      actpos += 1                                               ' increment position   

    elseif (actpos > acttgt)                                    ' retract
      low(OUT2)                                                 ' retract                                             '
      high(OUT3) 
      actpos -= 1                                               ' decrement position

Does this pulse the OUT1 & 2 or is it just programing code to cycle the program? Im not sure the actuator will handle being pulsed into position. (This may require some testing).

Other than that I think we are really good thanks so much for all the help.

JonnyMac

You are correct on the first two sections.

-- Note that your DMX address must be 1 or higher (I neglected to account for 0 which is not valid).
-- Actuator movements are expressed in 0.1 second intervals to give you the ability to fine-tune the position


QuoteDoes this pulse the OUT1 & 2 or is it just programing code to cycle the program? Im not sure the actuator will handle being pulsed into position.

No, this simply sets the control outputs to extend (when position is less than the target), retract (when the position is greater than the target), or to stop (when the position matches the target). Please review the code carefully -- misunderstandings of simple code could cause you to make changes that are really problematic. I have know idea why you though this was pulsing the outputs.
Jon McPhalen
EFX-TEK Hollywood Office

michilson

It was just for clarification of what the code was doing. Again I am new to this controller and understanding what each part of that code is doing is hard for those who haven't had back ground in it.

Again however I thank you so much for all the help with this code. I did verify that my LED boards are running on 12V so I shouldn't have any issues driving them with the HC-8.

I now look forward to getting into Proto-Type production gathering up all the parts and starting to build this. I cant wait. Thanks Again.

Mike


JonnyMac

We're happy to help. Keep us apprised of your project. It's likely that code will need adjustments along the way -- that is the normal course of things.
Jon McPhalen
EFX-TEK Hollywood Office

michilson

I have a question? does the DMX channels directly link to the 12V outputs / Inputs?

if I'm not mistaken i think we have a couple DMX channels still open correct? I know all 8 Inputs/outputs are used.

   +0    - Relay 1  (0..127 = OFF, 128..255 = ON)
   +1    - Relay 2
   +2    - Actuator position
   +3    - RGB Red
   +4    - RGB Green
   +5    - RGB Blue

   +6    - Strobe
   +7    - Overall Brightness


Is there a way to make it strobe the RED, Green, Blue Channels via the DMX signal?

DMX CH (6) 0 is Off - 255 is ON

And 20 - 240 is strobe slow to fast ( 30hz - 120 hz) something like that?

And Ch (7) a overall Brightness of CH 3-5 0- OFF 255=100%

Could someone help me with the code for this and where is should reside in the program Jon helped me to create. Thanks guys.

As a side note development and engineering are almost finished starting to purchase parts to start construction of prototype.

JonnyMac

No. Remember that the DMX universe is 512 channels and there are only eight outputs on the HC-8+. This means you have to assign outputs to DMX channels. This is usually a contiguous group, up too eight, starting with the address set on the DMX switch.
Jon McPhalen
EFX-TEK Hollywood Office

michilson

Let me see if I can clarify this question.

If we have outputs/Inputs not assigned to DMX can I double up control of outputs to be controlled differently depending on what DMX channel is used?

Like can DMX channel 6 also control OUT3,4,5 for Strobe functions?

And can DMX channel 7 also control brightness equally across OUT3,4,5?

for example you set the DMX Channels of DMX 3, 4, 5 to create a color lets say white.

But now I want to dim this. Instead of sliding each of the 3 sliders back equally can DMX ch 7 adjust the brightness across those 3 OUTPUTS Equally?

Same goes for the strobe effect can we control the pulse rates of the 3 OUTS depending on the position (or value of DMX Channel 6)?

Basically allow several DMX channels to Control OUTS 3,4,5 with different using different effects.
Hope this clarifies this better.

JonnyMac

Sure, you can do anything with the DMX data that you want. You simply have to define and implement it. As John B says, "It's a small matter of programming."
Jon McPhalen
EFX-TEK Hollywood Office