• Resolved

DLP4500: How to programmatically set two pattern sequences of variable exposure?

Prodigy 50 points

Replies: 9

Views: 141

We have our own vision software. We want to control this DLP4500 through vision software, to work in pattern sequence [variable exposure] mode to project an image of stripes alternatively upon external hardware trigger from camera. We have another set of LED lighting together with the projector. Camera captures two images of each object, first image with purely LED lighting on (projector off) and 2nd with purely projector lighting to show stripes. 

We have already uploaded two bitmap images into the projector flash memory, with index 2 and 3. The first one is blank image and the 2nd stripes image.

We have written below c++ code in our vision software to programmatically load the pattern sequences to the projector through usb cable communication. But it doesn't work properly. With this code, I see stripes in both 1st image and 2nd image.

DLPC350_PatternDisplay(0);

   //input from flash memory
   DLPC350_SetInputSource(2, 0);

   int nStatus = DLPC350_SetVarExpPatternConfig(1, 1, 1, false);
   MyTrace("DLPC350_SetVarExpPatternConfig() return %d\n", nStatus);

   DLPC350_ClearExpLut();

   // add blank pattern with short exposure time
   //DLPC350_AddToExpLut(1, 1, 1, 7, false, false, true, false, 250, 250);
   // add stripes pattern with long exposure time
   DLPC350_AddToExpLut(1, 1, 8, 7, false, false, false, false, 8500, 8500);

   unsigned char arImgIndex[2] = { 2, 3 };
   DLPC350_SendVarExpImageLut(arImgIndex, 2);

   DLPC350_SetPatternTriggerMode(3);

   nStatus = DLPC350_SendVarExpPatLut();
   MyTrace("DLPC350_SendVarExpPatLut() return %d\n", nStatus);

   DLPC350_SetLedEnables(true, true, true, true);
   // MyTrace("DLPC350_SetExposure_FramePeriod() return %d\n", nStatus);

   if (DLPC350_StartPatLutValidate())
   {
    MyTrace("DLPC350: DLPC350_StartPatLutValidate() failed.\n");
    MessageBox(NULL, "DLPC350: DLPC350_StartPatLutValidate() failed", NULL, MB_OK);
    return 0;
   }

   int numTrials = 0;
   unsigned int status = 0;
   while (numTrials < 5)
   {
    bool ready;
    if (DLPC350_CheckPatLutValidate(&ready, &status) < 0)
    {
     MyTrace("DLPC350: DLPC350_CheckPatLutValidate() failed. \n");
     MessageBox(NULL, "DLPC350: DLPC350_CheckPatLutValidate() failed!", NULL, MB_OK);
     return 0;
    }

    if (ready)
     break;
    else
     Sleep(1000);

    numTrials++;
   }

   if ((status & BIT0) || (status & BIT1))
   {
    CString str;
    str.Format("DLP350: validate result failed. bit0=%d, bit1=%d", (status & BIT0), (status & BIT1));
    MessageBox(NULL, str, NULL, MB_OK);
   }
   else
    DLPC350_PatternDisplay(2);

  • Hello Ruiqiang,

    Could you please clarify a little bit more exactly what the issue you are seeing is? Have you been able to use the GUI to confirm your intended operation can work before implementing it in code?

    Thanks,

    Kyle

  • In reply to Kyle Rakos:

    Hi Kyle,

    Now We are using the GUI to make the operation working. But the issue is that the pattern sequence don't work after power reset of the projector. Imagine the scenario that we reboot PC. Then the projector power reset. We need to run the GUI to set up the pattern sequence again. It's troublesome and seems not professional for our customers.

    RuiQiang

  • In reply to RUIQIANG WANG:

    Hi RuiQiang,

    Did you try attaching your pattern sequence with the FW Build Tool in the GUI? If you do that and flash the modified FW, all you need to do from your frontend is send the pattern start command.

    Thanks & Regards,

    Hirak.

  • In reply to Hirak Biswas:

    Hi Hirak,

    What is FW Build Tool in the GUI? I use Keynot Photonics LC4500 GUI. Are we talking of same GUI? 

    The issue I encounter here is that the pattern sequence doesn't work in correct order after power reset. That means after PC reboot, user need to run the GUI to download the pattern sequence again before launching our vision software. This is troublesome to customers. Correct solution will be that our vision software download the pattern sequence.

    Regards

    RuiQiang

  • In reply to RUIQIANG WANG:

    The firmware build tool is the same in the Keynote GUI as in the TI GUI.  If you prefer you may build your binary in the TI GUI but you must use the Keynote GUI to program the Keynote LC4500 because the flash devices are not the same as on TI's LightCrafter4500 and the TI GUI does not support them.  

    To save a pattern sequence you can:

    Configure the pattern sequence as desired.

    Validate/Play.

    Use the Save Solution button to save the pattern sequence along with other projector settings in an .ini file.

    In the Firmware Build tool choose the .ini file you built with the pattern sequence (not the default .ini file).

    Build the DLPC350 binary and flash it into the projector.

    Layne Jenkins
    Applications Engineer
    Keynote Photonics

     

  • In reply to Layne Jenkins:

    Hi Layne,

    I know how to build pattern sequence through GUI. What I need is advice on how to build it programmatically through our vision software. I have uploaded my code here. Anybody can help?

    Regards

    RuiQiang

  • In reply to RUIQIANG WANG:

    Hi RuiQiang, 

    Kindly look at LCR4500 GUI . This is a tool to operate DLPC350 from TI. This tool contains a Firmware Build Tool inside it, that you can use to attach a .ini pattern configuration with the FW and create a new FW. You can subsequently load this FW to DLPC350 and boot up to a state in which the configuration is auto applied to DLPC350 after boot, and your frontend only needs to send start and stop command.

    ALTERNATIVELY, this GUI tool also allows you to apply any configuration on DLPC350 when it is running. You can find the complete source code for the GUI in the downloaded package. You can use this code as reference for building your application if you want to send pattern configurations on the fly. 

    Hope this resolves your query. 

    Thanks & Regards,

    Hirak.

  • In reply to Hirak Biswas:

    Hi Hirak,

    Finally it works after I attach the .ini file to the .img file that I download later to the projector memory. In the past I didn't notice that I should attach the .ini file to the .img file.

    Thanks very much for your support !

    Regards

    RuiQiang

  • In reply to RUIQIANG WANG:

    Hi RuiQiang, 

    Glad to know I could resolve your issue. Thanks for your interest in TI DLP Technology, have a great day. 

    Thanks & Regards,

    Hirak.