Skip to main content

Grasshopper 3 USB3 Single Frame External Trigger

Answered

Comments

7 comments

  • TDY_Manuel
    Community team
    Expert (Gold)

    Hello Emre, 

    You should set AcquisitionMode to Continuous. Otherwise you have to start the camera for every frame. 
    If the camera starts with the first trigger pulse and then keeps running, it sounds like you enabled TriggerMode for TriggerSelector AcquisitionStart. Could you please make sure you used TriggerSelector FrameStart for that test? 

    Best regards,

    Manuel 

    0
  • Emre Kurtoglu

    Got it, thank you so much. I got it working on SpinView with the following settings:

     

    Now, I want to do it in PySpin. I am trying the following but the camera doesn't wait for the hardware trigger for some reason. Do you know what might be going wrong here? 

     

    ```
    nodemap = self.camera.GetNodeMap()

    # set trigger selector
    trigger_selector=PySpin.CEnumerationPtr(nodemap.GetNode("TriggerSelector"))
    trigger_selector.SetIntValue(trigger_selector.GetEntryByName("FrameStart").GetValue())

    # Set trigger mode to On
    trigger_mode=PySpin.CEnumerationPtr(nodemap.GetNode("TriggerMode"))
    trigger_mode.SetIntValue(trigger_mode.GetEntryByName("On").GetValue())

    trigger_source=PySpin.CEnumerationPtr(nodemap.GetNode("TriggerSource"))
    trigger_source.SetIntValue(trigger_source.GetEntryByName("Line3").GetValue())

    trigger_activation=PySpin.CEnumerationPtr(nodemap.GetNode("TriggerActivation"))
    trigger_activation.SetIntValue(trigger_activation.GetEntryByName("RisingEdge").GetValue())

    # Set trigger overlap to ReadOut (optional)
    trigger_overlap=PySpin.CEnumerationPtr(nodemap.GetNode("TriggerOverlap"))
    trigger_overlap.SetIntValue(trigger_overlap.GetEntryByName("ReadOut").GetValue())

    # Ensure frame rate control is disabled
    frame_rate_enable=PySpin.CBooleanPtr(nodemap.GetNode("AcquisitionFrameRateEnable"))
    ifPySpin.IsAvailable(frame_rate_enable) andPySpin.IsWritable(frame_rate_enable):
    frame_rate_enable.SetValue(False)
     
    pg.set_value(nodemap, 'ExposureMode', self.cam['options']['ExposureMode'])
    pg.set_value(nodemap, 'ExposureAuto', self.cam['options']['ExposureAuto'])
    pg.set_value(nodemap, 'ExposureTime', self.cam['options']['ExposureTime'])
     
    acquisition_mode=PySpin.CEnumerationPtr(nodemap.GetNode("AcquisitionMode"))
    acquisition_mode.SetIntValue(acquisition_mode.GetEntryByName("Continuous").GetValue())

    # set trigger selector
    acq_status_selector=PySpin.CEnumerationPtr(nodemap.GetNode("AcquisitionStatusSelector"))
    acq_status_selector.SetIntValue(acq_status_selector.GetEntryByName("FrameTriggerWait").GetValue())
    ```
     
    Thank you!
     
    Best,
    Emre
    0
  • TDY_Manuel
    Community team
    Expert (Gold)

    Do you mean the camera starts to capture images when you call BeginAcquisition before it has been triggered? I can not spot anything obvious. Have you tried running your code to configure the camera and then starting the camera in SpinView? Do you see any missing setting there? 

    Are you sure there is no trigger signal? What if you run your code with the GPIO cable disconnected? 

    Best regards,

    Manuel 

    0
  • Emre Kurtoglu

    Hi Manuel,

     

    I want to trigger each frame with the pwm. The camera starts capturing with the hardware trigger, and if I disconnect the trigger cable, it doesn't start as expected. However, after the initial trigger, the camera acquires frames in a free running mode with the highest fps possible instead of waiting pwm for each frame. For instance I'd expect 600 frames at 60 fps to be acquired in 10 sec. However, with my current code, it finishes in 4.22 sec. 

     

    I am sure that my hardware setup is correct because it works as expected on SpinView. If I set my pwm to be 60 fps, the camera acquires at 60 hz, and if I change it to 120, it acquires at 120 hz.

     

    After running the configuration code and opening the SpinView, the camera works as expected with a given fps. 

    The complete code I use to configure the camera can be found here. And in the main script, I first create the FLIR() device object, and start acquisition via device.get_n_frames() method.

     

    Thank you for your help!

     

    Best,

    Emre

     

    0
  • TDY_Manuel
    Community team
    Expert (Gold)

    Hi Emre, in your code you don't seem to call configure_trigger, which is where the code resided that you posted, but some other function. Is that a mistake? 

    Best regards,

    Manuel 

    0
  • Emre Kurtoglu

    Hi Manuel,

     

    Since I couldn't make that function work properly, I tried a different version of it (configure_camera_for_trigger()) to configure, but no luck. The camera still disregards the hardware trigger and runs with an automated frame rate. Thank you for your help!

     

    Best,

    Emre

    0
  • Emre Kurtoglu

    I was able to resolve my issue by starting the pwm after the camera is configured. For some reason if I start my pwm for the hardware trigger before configuring the camera, it falls into auto frame rate.

    0

Please sign in to leave a comment.

Powered by Zendesk