RobinoScan Strobe / Flash System

Wanted to share my RobinoScan Strobe system. Hopefully it helps some of you and hopefully we can improve it with the community.

It works using an Arduino Mega and the flashes are triggered very precisely to each exposure. There are things to improve but this currently works 100% on RobinoScan.

If anyone builds it or improve on it please share your findings. The next step is overdriving the LEDs to get more light output. When strobing we can overdrive the LEDs because they are not constantly turned on.

QUICK GENERAL INSTRUCTIONS: (this is using a Flir Oryx 5.3K camera but it should work for any Genicam compliant cameras - you will need to tweak this to your needsā€¦)

ā€¦in SpinView

  1. Set your camera Trigger mode to ā€œONā€.
  2. Connect your scannerā€™s trigger to an input line (for me I use TTL line 2)
  3. Via DIGITAL I/O - Set an output line (for sending signal to the Arduino and trigger a Flash)
    Set the ā€œline sourceā€ to your input line (in my case itā€™s TTL line 2)

Note that for 35mm you have to set a counter to receive 4 triggers and then trigger the line out for your flashā€¦ itā€™s all in the Genicam software and you can figure that out by experimenting. OR if your trigger is via a microcontroller you can do the counting there as well.

  1. Set a Trigger Delay (from the Acquisition Control menu) if needed to better line-up your flashes pulses to your exposures.
  2. I saved User settings for 16mm and 35mm since they use different counters.

Hereā€™s a diagram to help visualize:

robinoscanLED.pdf (435.2 KB)

Hereā€™s the 3D model (.STEP) of the Integrating Sphere with heatsink mount.

Integrating Sphere

SHOPPING LIST:

100W RGB LED CHIP:

ARDUINO MEGA:

DC2197A-A DAC

or

https://www.mouser.com/ProductDetail/Analog-Devices/DC2197A-A?qs=sGAEpiMZZMsKEdP9slC0YWM%2FWwveLq%252BiPW3IW6BjpkQ%3D

PICOBUCK:

https://www.mouser.com/ProductDetail/SparkFun/COM-13705?qs=sGAEpiMZZMvShe%252BZiYheimaT%2FFx9awhcEGxqmHQZK4U%3D

or

HEATSKINK: (you can ditch the plastic lens or make yourself a ā€œmonocleā€)

PSU: (at your discretion but at least 36V 3A)


ARDUINO MEGA CODE (small thing to improve in code would be to setup an interrupt for the sensor BUT I can guarantee that it doesnā€™t skip a beat the way it isā€¦)

#define PWM_PERIOD  1599    //#     PWM freq = 1/((K+1)*62.5E-09)
#define HIGH_DUTY1  1595    //# BLUE     DC = K/PWM_PERIOD   <-- channel 1
#define HIGH_DUTY2  1595  //# GREEN    DC = K/PWM_PERIOD   <-- channel 2
#define HIGH_DUTY3  1250  //# RED    DC = K/PWM_PERIOD   <-- channel 3
#define LOW_DUTY    0     //#     DC = K/PWM_PERIOD
#define PULSE_LEN   1000ul  //uS    length of high-duty PWM pulse

const uint8_t pinSensor = 10;    //sensor input
//
const uint8_t pinPWM1 = 5;      //OC3A BLUE
const uint8_t pinPWM2 = 2;      //OC3B GREEN
const uint8_t pinPWM3 = 3;      //OC3C RED
//
const uint8_t pinDbg = 6;       //debug

uint8_t
    nowSensor,
    lastSensor;
    
uint32_t
    tNow,
    tBlip;
    
void setup()
{
    //set up timer 3 to use OCA, B and C
    //  WGM14 TOP is ICRx -> 1599 gives 10kHz
    //  prescaler == /1    
    //  for WGM14, COMxA..C1:COMxA..C0 == 10 OCxA..C sets on BOTTOM, clears on COMPARE
    TCCR3A = _BV(COM3A1) | _BV(COM3B1) | _BV(COM3C1) | _BV(WGM31);
    TCCR3B = _BV(WGM33) | _BV(WGM32) | _BV(CS30);
    ICR3 = PWM_PERIOD;
    OCR3A = LOW_DUTY;
    OCR3B = LOW_DUTY;
    OCR3C = LOW_DUTY;
    //
        pinMode(pinSensor , INPUT_PULLUP);
    pinMode( pinPWM1, OUTPUT);
    pinMode( pinPWM2, OUTPUT);
    pinMode( pinPWM3, OUTPUT);
    
    pinMode( pinDbg, OUTPUT );
  
        
}//setup

void loop()
{
  static bool
        bFlag = false;

    switch( bFlag )
    {
        case    false:
            //look for sensor input to transition low to high
            nowSensor = digitalRead( pinSensor );
            if( nowSensor != lastSensor )
            {
                lastSensor = nowSensor;
                if( nowSensor == HIGH )
                {               
                    //transitions seen
                    //set OC to high-duty                    
                    OCR3A = HIGH_DUTY1;
                    OCR3B = HIGH_DUTY2;
                    OCR3C = HIGH_DUTY3;
                    //save the micros count when we went high
                    tBlip = micros();
                    //and move to time the period
                    bFlag = true;                
                    //for debugging/scoping  
                    digitalWrite( pinDbg, HIGH );
                    
                }//if
            
            }//if
            
        break;

        case    true:            
            //when blip done...
            if( (micros() - tBlip) >= PULSE_LEN )
            {                
                //go back to low duty cycle
                OCR3A = LOW_DUTY;
                OCR3B = LOW_DUTY;
                OCR3C = LOW_DUTY;
                //go back to look for next low-transition on sensor input
                bFlag = false;
                //for scoping               
                digitalWrite( pinDbg, LOW );
                
            }//if
            
        break;
        
    }//switch    
 
}//loop

Happy flashing!

ps:. Iā€™m sending my camera back to FLIR for a repair tomorrow- so during the 2 weeks downtime I will be working on a new system, trying to overdrive the LEDs.

2 Likes

The code is simple to use.

To adjust color, change the HIGH DUTY variables for R,G, B (range is 0-1595) and set the pulse width you need (in microseconds) with the ā€œPULSE_LENā€ variable.

The sensor input pin can be changed to any digital input pin you desire OR if changing code to use an interrupt, you will need to use one of the interrupt pins.

Available Interrupt pins on Arduino Mega are:

2, 3, 18, 19, 20, 21 (pins 20 & 21 are not available to use for interrupts while they are used for I2C communication which in RobinoScan are used for the OLED display.)

Thank you very much for sharing all this info. I ordered a couple RGB cobs last night so Iā€™ll get a few more components and report back on here :slight_smile:

From the code, to confirm my understanding.
The PWM levels are constant, which would translate to constant voltages at the output of the DAC.
#define HIGH_DUTY1 1595 //# BLUE DC = K/PWM_PERIOD ā† channel 1
#define HIGH_DUTY2 1595 //# GREEN DC = K/PWM_PERIOD ā† channel 2
#define HIGH_DUTY3 1250 //# RED DC = K/PWM_PERIOD ā† channel 3

The pulse type is also constant = 1000 uS.
#define PULSE_LEN 1000ul //uS length of high-duty PWM pulse

Looking at the required outputs:
3 x DC outputs from 0.5 to 2.5V DC
1 x Pulse of approx. 1 mS triggered by an input pulse.

If my understanding is correct, then a simple alternative is using 3 potentiometers to adjust the reference voltage and the good/old LM555 -the monostable operation on the datasheet- for generating the 1 mS pulse triggered by the camera GPIO.

But there may be other reasons the Mega is used, and you maybe presenting a simplified version only for discussion.

Another item that cut my attention was that the Vf (forward voltage) is listed from 33 to 37V (amazon listing), and that the AL8805 (the IC used in the picobuck) indicates that the Max Operating Input Voltage is 36V.
When regulating current (like the picobuck does) you would like the available voltage across the LED to be higher than Vf. That may be a limiting factor of the system output as is, hard to say for sure without a datasheet for the LED Chip.

Hope the information is helpful when considering your next round of improvements.

PS. Corrected the VCtrl range which is 0.5 to 2.5 V

Correct - for now to adjust colors you can reduce or increase these variables.

Correct - and you can contract or expand the pulse length with this var. 1000us works on my system with 150us exposures at around 6-7fps which is what I run the scanner at right now until I get more light output. For 24fps we will need much shorter pulses (light and camera exposures hence the need for more light output)

Yes this is a very basic system that can be built now and it works. Someone could easily add potentiometers to adjust the colors etc - or do something like you outlined above. The reason I use the Mega is only because Arduino is easier for someone like me. Iā€™m still a rookie in electronics.

This is the data sheet for the LED Chip. (look at bottom for RGB specs)

Yes of course !

I have 3 new drivers that have full range analog dimming - with these I think I could overdrive the LEDs but when using them in the system instead of picobuck they donā€™t turn off when PWM/DUTY is set to 0.

These are the new drivers:

In a similar way to the picobuck, the TI drivers may be controlled either by PWM directly TP3-PWM or using an analog voltage via TP1, IADJ.

From your system diagram, assume you continue to use the PWM DAC? or are you controlling directly to TP3-PWM. If the later, confirm that R14 was removed.

If you continue to use the PWM-DAC, the datasheet of the IC indicates (8.3.7.1 IADJ Pin Clamp):

There is a practical lower limit to the IADJ pin voltage choice due to circuit non-idealities. For example, using VIADJ = 0.5 V results in a sense voltage of 50 mV, which does not allow accurate operation.

While the language is not clear, it appears this IC has a similar limitation to voltage control. From the explanation the VIADJ is probably not meant to use to zero out the output.

The scope charts on the evaluation board datasheet appear to show a typical on/off regulator when using the PWM. In other words, during the on cycle the regulator is operating -limiting the current based on VIADJ- and the LED is ON, and during the OFF cycle the power is shut down and the LED is completely off.

If that is the case, given that the 1mS would be within the range for the PWM (100 Hz to 10 KHz), you may be able to create the flash by removing R14 and connecting the 1mS pulse to TP3.
If the above works, then you can adjust the balance of the colors by changing VIADJ.
WARNING: R14 is listed as Zero Ohms, a short, so do not use the TP3 without removing it.

In other words, use the TI PWM to switch the IC ON (regulating to the current set to VIADJ) and OFF.

Please do not take as a definite answer, it is hard to make an exact determination since I have not previously used that TI IC. Suggestions are based on the information on the datasheets.

PS. In regards to the Vf, looks like the listing says 37V and the spec sheet table says 34V. That would make 36V workable, depending on the limitations of the current regulator used.

Yes Iā€™m still using the DAC

I will try this tonight and report back! Thanks very much for looking into a solution for this setup.

No worries and at this point Iā€™m responsible for any explosions :slight_smile: Only thing is I hate removing these little resistors, I had to change 6 of these on the pico buck to get to 1A per channel. Thankfully I now have a little more experience.

1 Like

@PM490 looks like itā€™s working! the only issue is my camera is being RMAā€™ed so I canā€™t see in camera but setting voltage on VIADJ and pulsing through TP3 works! I will update when the camera is back.

1 Like