This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

二次开发控制DLP4500投射图片并触发相机拍照

Other Parts Discussed in Thread: DLP4500, DLPC350

大家好!我根据DLPC350的API函数在windows平台下进行二次开发,通过光机投射系列图,并触发相机进行同步拍照。但是出现了一个问题,每次投射系列图,相机只被触发了一次,仅仅捕捉到了投射的第一张图片,这是什么原因咧?我的代码如下。(我用DLP4500的控制软件却可以正常触发相机!)

-----------------------------

//初始化
    DLPC350_USB_Init();
    DLPC350_USB_Open();
    if (!DLPC350_USB_IsConnected()) {
        return -1;
    }

    //显示设置
    DLPC350_SetPowerMode(false);
    DLPC350_SetMode(true);
    DLPC350_PatternDisplay(0);
    DLPC350_SetPatternDisplayMode(false);

    //图片序列设置
    const int numberOfPatterns = 8;
    const int numberofImages = 6;
    unsigned char imageIndices[numberOfPatterns];
    int countr = 0;
    for (int j = 0; j < numberofImages; j++) {
        for (int i = 0; i < numberOfPatterns; i++) {
            imageIndices[countr] = j;
            if (i == -1) {
                DLPC350_AddToPatLut(0, i, 1, 7, false, false, false, false);
            }
            else {
                DLPC350_AddToPatLut(0, i, 1, 7, false, false, true, false);
            }
            countr++;
        }
    }
    DLPC350_SendImageLut(imageIndices, countr);
    DLPC350_SendPatLut();
    DLPC350_SetPatternConfig(numberOfPatterns*numberofImages, false, numberOfPatterns*numberofImages, numberOfPatterns*numberofImages);

    DLPC350_SetLongAxisImageFlip(false);
    DLPC350_SetShortAxisImageFlip(true);


    //曝光设置
    DLPC350_ClearPatLut();
    DLPC350_ClearExpLut();
    DLPC350_SetPatternTriggerMode(1);
    DLPC350_SetExposure_FramePeriod(80000, 90000);

    //设置触发输出延时
    DLPC350_SetTrigIn1Delay(1);
    DLPC350_SetTrigIn2Pol(false);//rising
    /*
    DLPC350_SetTrigOutConfig(unsigned int trigOutNum,bool invert,unsigned int rising,unsigned int falliing)
    trigOutNum:1=TRIG_OUT_1;2=TRIG_OUT_2
    invert:0=active high signal,1=active low signal
    rising:rising edge delay control.each bit adds 101.2ns 0xBB=0.00us
    falling:falling edge delay control.

    return >=0 = pass
    */
    DLPC350_SetTrigOutConfig(1, false, 187, 187);
    DLPC350_SetTrigOutConfig(2, false, 187, 187);

    DLPC350_SetRedLEDStrobeDelay(187, 187);
    DLPC350_SetGreenLEDStrobeDelay(187, 187);
    DLPC350_SetBlueLEDStrobeDelay(187, 187);

    DLPC350_SetLedEnables(true, false, false, false);
    DLPC350_SetLEDPWMInvert(false);
    DLPC350_SetLedCurrents(150, 135, 130);
    DLPC350_SetLedEnables(true, true, true, true);

    unsigned int status;
    DLPC350_ValidatePatLutData(&status);

    DLPC350_PatternDisplay(2);

    std::cout << "ok..." << std::endl;
    std::cin.get();
    DLPC350_PatternDisplay(0);
    std::this_thread::sleep_for(std::chrono::seconds(1));
    DLPC350_SetPowerMode(true);

------------------------------------------------

请问是不是我代码哪里设置错误,或者哪里没有设置完全。。。恳求大神们能够解答,非常感谢!

  • 您好!

    感谢使用TI的DLP产品。

    从描述上看应该是软件配置不正确造成的。首先确认下需要实现的功能,是需要使用6张图片,每张图片使用8个bit,来投影1bit的pattern 吗?(可以使用两张图片一共48个bit)?使用的是trigger out1还是trigger out2来触发相机?使用示波器检测的trigger out波形是什么样的?

    代码中:

        DLPC350_SendImageLut(imageIndices, countr);的第二个参数应该是图片的数量
        DLPC350_SetPatternConfig(numberOfPatterns*numberofImages, false, numberOfPatterns*numberofImages, numberOfPatterns*numberofImages);的最后一个参数也应该是图片数量

    DLPC350_AddToPatLut(0, i, 1, 7, false, false, true, false);其中的ture是指buffer swap,在切换图片的时候才需要使用

    建议按照void MainWindow::on_pushButton_PatSeqSendLUT_clicked()中的配置顺序来设计您的软件,或者参考http://www.ti.com/lit/ug/dlpu010g/dlpu010g.pdf的4.1节

    Best regards

  • 您好,感谢您的解答。我尝试过,目前可以正常使用,但是还有一个问题是,在DLP4500的控制软件里,我设置exposure=30000us,frame=30000us( 也就是API中的DLPC350_SetExposure_FramePeriod),可以正常触发相机,但是在API中却不行,除非将时间调大,且exposure<frame,这又是为什么咧?

  • 您好!
    请问不行是指什么不行?没有办法配置还是没有办法投pattern。
    曝光时间有两种情况
    1.period = exposure
    2.period- exposure > 230us
    Best regards
  • 您好!感谢您及时答复。

    不行 = 仍然无法正常触发相机拍照

    以下举例说明:
    ------------------------
    当代码是这样的,一切都正常(可以触发相机拍照)
    DLPC350_SetExposure_FramePeriod(90000,100000);//满足您所提到的情况2
    -------
    当代码是这样的,无法正常触发相机拍照(相机只是第一次被触发,并拍了一张图片;后面光机虽然正常投射pattern了,但是相机不工作)
    DLPC350_SetExposure_FramePeriod(40000,50000);//满足您所提到的情况2
    -------------------------------------
    我的相机的帧率是40fps,理论上只要设置>30000us是可以触发相机的(光机的控制软件这样设置可以正常使用),但实际上需要设置更大的曝光才可以触发相机拍照。
  • 您好!
    1.请问目前相机是处于free run的这种模式吗?还是使用trigger in的模式?
    2. 能提供两种配置下的trigger out的波形吗?可以用示波器抓取。
    Best regards
  • 请问api是那个文件
  • 您好!

    请下载LightCrafter4500EVM的GUI控制软件,在其安装路径下有GUI的Source Code可以作为参考。

    Best regards

  • 您好,我用程序控制DLP4500投影图片,比如我要投射1-6张图片,程序如下:
    for (int j = 0; j < 2; j++) {
    splashLut[countr] = j;
    for (int i = 0; i < 3; i++)
    {
    if (i == 0) {
    DLP_AddToPatLut(0, i, 8, 7, false, true, true, false);
    }
    else {
    DLP_AddToPatLut(0, i, 8, 7, false, true, false, false);
    }

    }
    countr++;
    }


    DLP_SetPatternConfig(6, true, 6, 6);
    DLP_SendPatLut();
    DLP_SendImageLut(splashLut, 6);
    为什么正常投影六张之后,后面就乱序投影了?
  • 您好,我是上海交通大学的一名学生,最近也在使用DLP6500,也想通过程序控制其投影图案,看到您论坛也提过这问题,所以想咨询下您,我邮箱是:rockyan108@sjtu.edu.cn,希望您能抽空和我交流下
  • 我邮箱yaopengcheng@seu.edu.cn