Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: Arduino laser controller

  1. #1
    Join Date
    Jul 2008
    Location
    Maryland
    Posts
    1,691

    Default Arduino laser controller

    DISCLAIMER: This is not for controlling the laser modulation or galvos!
    Code can be found here
    https://github.com/adiastra/Laser-Pr...er_control.ino

    I have written a little piece of code for an Arduino designed to read the current state of the SHUTTER and INTERLOCK.

    The code does the following.

    IF the SHUTTER signal is OPEN (+5v) AND the INTERLOCK is a COMPLETE CIRCUIT, only then will a relay close providing power to the laser(s). (after a 5 second delay)

    If at any point either of these states changes (shutter closes or interlock is broken) the relay immediately opens (its default un-powered state) and the lasers power is interrupted.

    If laser power is interrupted there is a 5 second delay before you can turn the power back and the interlock and shutter have to be in the proper states else you cant turn it back on.

    The current state of the laser power is printed to serial if you want to monitor the state.
    Click image for larger version. 

Name:	serial.jpg 
Views:	0 
Size:	70.6 KB 
ID:	56281

    For safety the GALVO power should not be interrupted

    The Arduino pins are as follows

    ShutterSignal = The signal coming from the ILDA shutter signal. +5v = Shutter OPEN (this is an input pin for reading the shutter voltage)
    ShutterPin = Pin used to control the relay state (Output pin for sending signal to the relay)
    InterlockOut = set to +v5 to send a constant signal over the interlock loop (+5v output pin)
    InterlockIn = Reads the signal from the interlock loop sent from the InterlockOut pin(input pin)


    The interlockIn pin has a 10k resistor to ground so that if the circuit is broken there is no voltage float to worry about.

    Please feel free to ask any question you may have or suggest any additions to the system.

    I am thinking about adding a few temperature sensors that would shut down the ENTIRE system on overheat of a component and wait until it was below a certain threshold before allowing the system to start back up.


    NOTE: This sketch assumes that the your relay requires a LOW signal to turn on. This can be edited in the #define section
    Last edited by keeperx; 01-21-2020 at 04:31.
    Quis custodiet ipsos custodies?
    Solid State Builders Group

  2. #2
    Join Date
    Jul 2008
    Location
    Maryland
    Posts
    1,691

    Default

    Quis custodiet ipsos custodies?
    Solid State Builders Group

  3. #3
    Join Date
    Jul 2008
    Location
    Maryland
    Posts
    1,691

    Default

    Version 1.6
    https://github.com/adiastra/Laser-Projector-Controller

    Changes since 1.0
    • More accurate serial reporting
    • separate delay times for BOOT, SHUTTER, and INTERLOCK delays.
    • ability to edit delay times easily
    • more secure fault check loop (thousands of times a second)
    • cleaned up code and added comments for ease of readability
    Last edited by keeperx; 01-22-2020 at 06:45.
    Quis custodiet ipsos custodies?
    Solid State Builders Group

  4. #4
    Join Date
    Jul 2008
    Location
    Maryland
    Posts
    1,691

    Default

    Updated video with full interlock (through DAC and switch) and live serial readout

    https://www.youtube.com/watch?v=Hbq6VronLjQ
    Quis custodiet ipsos custodies?
    Solid State Builders Group

  5. #5
    Join Date
    Jan 2006
    Location
    Charleston, SC
    Posts
    2,147,489,446

    Default

    Hi Alec;

    Your code is designed to run on an Arduino that is installed inside the projector, right? So it monitors the ILDA-in port on the back of the projector and reacts to the interlock loop status (pins open or pins shorted) and the shutter signal (ground or +5 v differential) coming from the controller.?.

    If that's correct, then you will have problems using this with some laser show controllers, as many controllers will close the shutter (that is, remove the +5V signal) any time no frame is being displayed, even if it's in the middle of a show. So if you have a dark moment in your show, the shutter will close, and then when the next cue starts the shutter will re-open.

    If I understand your code correctly, any time the shutter closes it will trigger the 5 second delay before the lasers are powered back on. That means any time you have a "black" section in a show you will miss at least the next 5 seconds of the show, if you are using a controller that operates the shutter in this manner. (Pangolin controllers all do this, for example.)

    I've never seen an interlock circuit that uses the shutter signal from the controller as a stop condition. Instead, they use a separate circuit with a mushroom switch E-stop to trigger the stop condition. True, one of the common attenuation methods upon an E-stop condition is to interrupt the shutter signal from the controller to the projector and instead force the shutter closed, but that's not the same as actually triggering the stop condition based on the shutter signal. Hope that makes sense!

    Adam

  6. #6
    Join Date
    Jul 2008
    Location
    Maryland
    Posts
    1,691

    Default

    Ok so firstly lets address the shutter issue for controllers that close it during the show.
    The SHUTTER_DELAY can be set to 1 which would be 1 millisecond. essentially removing that from the mix. This would cut power to the laser (if using a relay on the laser power) or close the actual shutter (since its just a signal you can use for whatever mechanism you want) and open it back up plenty fast. The Code is configurable in that respect.


    The interlock sensor is a completely separate loop and can absolutely have a mushroom switch and a key (mine will be here Saturday and I will demo in the mix in a video) that can be setup to close the shutter. it does NOT use the shutter signal from the controller to close the shutter. It simply changes the condition of the interlock circuit to FALSE meaning the conditions are not good to keep the shutter open.

    Here is the logic for the 2 separate conditions.

    If SHUTTER signal is set to OPEN AND INTERLOCK is a complete circuit THEN
    OPEN THE SHUTTER

    If the SHUTTER signal is set to CLOSED
    CLOSE THE SHUTTER and keep it closed for SHUTTER_DELAY

    If the INTERLOCK is BROKEN (perhaps by a mushroom button or key)
    CLOSE THE SHUTTER and keep it closed for at LEAST INTERLOCK_DELAY




    Now here is the part that you may have missed. The Shutter signal is never sent to the relay. The shutter signal is read by the arduino, the interlock loop is also read by the arduino. When conditions are correct for the shutter to be open, the arduino opens the shutter using its own signal from a different pin. The default state of the shutter is closed. Only the arduino can open it. So the shutter signal from the show controller (DAC) is not directly used to open and close the shutter. This makes it even safer since if there is a fault in your Arduino, the shutter remains closed.

    The arduino uses an ATMega326p chip with is commonly used for safety critical operations anyway and since the default state of the system is a closed shutter the arduino must be working properly for the shutter to open.


    I could make the shutter immediately open-able after SHUTTER_DELAY which would resolve the issues as well (just set the delay to whatever the show controller uses as its shortest blank time required to close the shutter)
    Last edited by keeperx; 01-23-2020 at 05:57.
    Quis custodiet ipsos custodies?
    Solid State Builders Group

  7. #7
    Join Date
    Jan 2006
    Location
    Charleston, SC
    Posts
    2,147,489,446

    Thumbs up

    Thanks for the clarification; it definitely cleared up a misunderstanding I had.

    Just so I'm clear though: The SHUTTER_DELAY timer is always applied upon receiving a shutter-open signal, right? So it always delays the opening of the shutter by a set amount? (Assuming that the interlock loop is satisfied and thus opening the shutter is permitted.) I do agree that 1 ms is short enough to not be noticed in the middle of a show, but it sort of defeats the purpose of having a delay at all at that point.

    Then too, in cases where the projector did not have an actual mechanical shutter, I think it would be better to use the shutter output from your board to trigger relays to remove the modulation inputs to the lasers and crowbar the driver inputs to ground. That way as soon as the shutter signal comes back the lasers will turn back on instantly.

    If you instead kill the DC power to the laser drivers you'll have some delay before output resumes due to the lag in the startup of the drivers (some drivers include several seconds of startup delay, and even when bypassed many drivers still take a second or two to come back up).

    Adam

  8. #8
    Join Date
    Jul 2008
    Location
    Maryland
    Posts
    1,691

    Default

    I could easily do this

    If shutter closed
    apply shutter_delay
    once once_delay satisfied
    allow shutter to open immediately when signal is received.

    That would resolve one part of the issue.

    Since the STOP condition just deactivates a pin on the ardiono, you could do whatever you want with that signal. Grounding modulation signals would work well, simply removing the modulation may not be a good idea as some diode modules have a default state as being ON (believe it or not). There are certainly ways to use the controller that I have not mentioned, the point is that as it stands its safe for people using home systems with software like Maxwell, Spaghetti, LSG, etc. Also since its an arduino, its easy to acquire and configure giving no excuse to projector builders for NOT adding safety. It can be easily adapted for use with a Pangolin system which I would be more than happy to do if someone cares to do some testing. (or loan me a pangolin system)
    Quis custodiet ipsos custodies?
    Solid State Builders Group

  9. #9
    Join Date
    Jan 2006
    Location
    Charleston, SC
    Posts
    2,147,489,446

    Default

    Hi Alec;

    Good points. And I agree that an Arduino is cheap enough that anyone can add it to a home-built projector and increase the safety of the unit. Yeah, it might not pass muster with the CDRH (still need Class-IV reset, redundant circuit path, secondary attenuation method, etc), but that's not something the average hobbyist is worried about anyway. A solid E-stop system goes a long way towards improving safety.

    I do want to say that I still don't see the purpose of applying the delay once the shutter has been closed though, particularly if this is a user-adjustable parameter. It would seem that if the user wanted a delay it would be on start-up or resumption of output. Perhaps apply the delay upon successful completion of the interlock loop instead? That would prevent it from delaying the re-opening of the shutter during a show while still providing a start-up delay. Just a thought.

    You're absolutely correct about some laser drivers producing unpredictable output with the modulation inputs left floating; that's why I suggested crowbaring them to ground. (For the record, this is one of the two attentuation methods I used in the laser product report I filed on the early Lightspace Pluto II projectors, and I haven't had any issues from the CDRH on it.)

    Adam

  10. #10
    Join Date
    Jul 2008
    Location
    Maryland
    Posts
    1,691

    Default

    the delay is actually there if you ARE switching DC power to the laser drivers. You don't want to be able to flip that on and off too fast as you can damage the drivers that way. I do however agree that if you have a delay there it should only be applied on CLOSE so it would go.

    SHUTTER OPEN
    SHUTTER CLOSED
    DELAY
    SHUTTER READY TO OPEN NOW

    Which is what I am changing in the code now.


    This again is configurable so if your show controller only closes the shutter for spans longer than say 2 seconds, you can set the SHUTTER_DELAY to 1500 and you will be out of the delay with .5 seconds to spare.


    There is ALWAYS a delay once INTERLOCK is fixed. currently that is 10 seconds (easily configurable). If the INTERLOCK is broken, the shutter will remain closed (however you do that) and once fixed (circuit completed) there will be a 10 second "restart"delay" before you can reopen the shutter.
    Last edited by keeperx; 01-23-2020 at 07:29.
    Quis custodiet ipsos custodies?
    Solid State Builders Group

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •