This class controls the LED Strobe Controller.
The LED strobe controller is designed as a current source. It allows generation of pulses with programmable duration and current value.
The following schematic shows a simplified strobe output:
For a detailed electrical specification please take a look into the hardware manual.
The typical workflow for programming the Strobe Unit with this API is as follows:
The internal calculations of this API ensure that the hardware will not be damaged by overload. These calculations are based on the operating conditions given to SetLimits() or SetFixedCurrent():
For VisionBox / VisionCam hardware with integrated LED controllers, the supply voltage for the strobe unit is equal to the power supply voltage used.
With the information provided to the functions, the library calculates the allowed parameters for maximum allowed output power. When using SetLimits(), the parameter LimitCurrent
specifies if the API should limit the minimum allowed OFF-time between pulses, or if the current will be adjusted to avoid overload. SetFixedCurrent() will always limit the minimum OFF-time.
During operation, the FPGA ensures that the maximum ON-time is not exceeded and that the minimum OFF-time is not undercut. Trigger signals will be ignored under such conditions.
The following calculator can be used to estimate the results for SetFixedCurrent() and SetLimits() depending on the hardware and operating conditions:
Consider the following sequence of output pulses:
When using the original firmware, a pause of MinOffTime
is required after each pulse. The timing parameters have to be adjusted as follows:
MaxOnTime:
1 msMinOffTime:
1 msThis results in a duty cycle of 0.5. The calculated power losses do not account for the longer pause time for each period.
With newer firmware versions it is possible to add up both parameters across multiple pulses. In the example above, we can use the sum for one time period between position 2 ms and 10 ms:
MaxOnTime:
2 msMinOffTime:
6 msThe resulting duty cycle is now 0.25, which allows the use of higher output currents under the same conditions. The user could also decide to add up the values for multiple periods. But please note that higher absolute time values will also reduce the maximum output current.
Public Types | |
enum | STROBE_MODE |
Mode definitions for the strobe unit, used by SetTriggerMode() More... | |
enum | STROBE_OUTPUT_TYPE |
Type definitions for setting the output channel of the Strobe unit, used by SetOutputType() More... | |
enum | STROBE_SOURCE |
Trigger source definitions for the strobe unit, used by SetTriggerSource() More... | |
Public Member Functions | |
bool | Calibrate (char LogText[20 *1024]) |
Calibrates the strobe unit More... | |
bool | GetCurrent (int &Current) |
Gets the current value of the strobe output. More... | |
bool | GetLimits (unsigned int &MaxOnTime, unsigned int &MinOffTime, unsigned int &MaxCurrent) |
Returns the power related limits currently used. More... | |
bool | GetOnTime (int &OnTime) |
Returns the ON-time of the strobe output. More... | |
bool | GetOutputType (STROBE_OUTPUT_TYPE &OutputType) |
Return the OutputType of the Strobe unit. More... | |
bool | GetTemp (unsigned short &Temp) |
Reads temperature of the FlashBox Strobe unit. More... | |
bool | GetTriggerDelay (int &TriggerDelay) |
Returns the trigger delay. More... | |
bool | GetTriggerMode (int &TriggerMode) |
Returns the trigger mode. More... | |
bool | GetTriggerSource (STROBE_SOURCE &TriggerSource, int &InvertTrigger) |
Returns the trigger source. More... | |
bool | GetVoltage (int &Voltage) |
Returns the voltage value of the strobe output. More... | |
bool | Init (bool ResetParameter=true) |
Initializes the Strobe unit. More... | |
bool | SetCurrent (int Current, int Validate=0) |
Sets the current value of the strobe output. More... | |
bool | SetFixedCurrent (int SupplyVoltage, int LoadVoltage, unsigned int MaxOnTime, unsigned int MinOffTime, unsigned int Current, int &Result) |
Sets a fixed operating point for the strobe output. More... | |
bool | SetLimits (int LimitCurrent, int MaxSupplyVoltage, int MaxLoadVoltage, unsigned int MaxOnTime, unsigned int MinOffTime, unsigned int MaxCurrent, int &Result) |
Calculates the minimum permitted OFF-time or the maximum permitted current. More... | |
bool | SetOnTime (unsigned int OnTime) |
Sets the ON-time of the strobe output for edge triggered modes. More... | |
bool | SetOutputType (STROBE_OUTPUT_TYPE OutputType) |
Selects the output channel for the Strobe unit. More... | |
bool | SetTriggerDelay (unsigned int TriggerDelay) |
Sets the trigger delay. More... | |
bool | SetTriggerMode (STROBE_MODE TriggerMode, int &Result) |
Sets the trigger mode. More... | |
bool | SetTriggerSource (STROBE_SOURCE TriggerSource, int InvertTrigger) |
Sets the trigger source for hardware triggered modes. More... | |
Strobe () | |
Default constructor for the device object More... | |
bool | SwTrigger (int Value) |
Sets the trigger signal for software triggered and manual mode. More... | |
Public Member Functions inherited from VIB::iDevice | |
bool | Close () |
Closes a device More... | |
iDevice (const iDevice &device) | |
The copy constructor makes a copy of the existing device object More... | |
bool | isOpen (bool &state) |
Returns the open state of a device object More... | |
bool | Open (unsigned int Index=0) |
Opens a device More... | |
iDevice & | operator= (const iDevice &device) |
The assignment operator makes a copy of the existing device object More... | |
virtual | ~iDevice () |
Deletes the device object More... | |
Mode definitions for the strobe unit, used by SetTriggerMode()
Type definitions for setting the output channel of the Strobe unit, used by SetOutputType()
Trigger source definitions for the strobe unit, used by SetTriggerSource()
VIB::Strobe::Strobe | ( | ) |
Default constructor for the device object
The device must be opened with Open() before it can be used.
bool VIB::Strobe::Calibrate | ( | char | LogText[20 *1024] | ) |
Calibrates the strobe unit
Calibration of the strobe unit is normally not required because the hardware is delivered calibrated.
Connect a zero Ohm bridge between the LED+ and LED- terminals before calling this function.
After success, the calibration values are stored permanently.
LogText | Text containing the calibration result data |
true
for success, use VIBSystem::GetLastErrorString() for an error descriptionbool VIB::Strobe::GetCurrent | ( | int & | Current | ) |
Gets the current value of the strobe output.
Current | ≥ 0: Current in mA < 0: Error |
true
for success, use VIBSystem::GetLastErrorString() for an error descriptionbool VIB::Strobe::GetLimits | ( | unsigned int & | MaxOnTime, |
unsigned int & | MinOffTime, | ||
unsigned int & | MaxCurrent | ||
) |
Returns the power related limits currently used.
MaxOnTime | Maximum allowed ON-time (µs) |
MinOffTime | Minimum allowed OFF-time (µs) |
MaxCurrent | Maximum allowed current (mA) |
true
for success, use VIBSystem::GetLastErrorString() for an error descriptionbool VIB::Strobe::GetOnTime | ( | int & | OnTime | ) |
Returns the ON-time of the strobe output.
OnTime | > 0: ON-time in µs < 0: Error |
true
for success, use VIBSystem::GetLastErrorString() for an error descriptionbool VIB::Strobe::GetOutputType | ( | STROBE_OUTPUT_TYPE & | OutputType | ) |
Return the OutputType of the Strobe unit.
OutputType | The current used sink type |
true
for success, use VIBSystem::GetLastErrorString() for an error descriptionbool VIB::Strobe::GetTemp | ( | unsigned short & | Temp | ) |
Reads temperature of the FlashBox Strobe unit.
Temp | Temperature in °C |
true
for success, use VIBSystem::GetLastErrorString() for an error descriptionbool VIB::Strobe::GetTriggerDelay | ( | int & | TriggerDelay | ) |
Returns the trigger delay.
TriggerDelay | ≥ 0: Trigger delay in µs < 0: Error |
true
for success, use VIBSystem::GetLastErrorString() for an error descriptionbool VIB::Strobe::GetTriggerMode | ( | int & | TriggerMode | ) |
Returns the trigger mode.
TriggerMode | ≥ 0: Trigger mode (see STROBE_MODE) < 0: Error |
true
for success, use VIBSystem::GetLastErrorString() for an error descriptionbool VIB::Strobe::GetTriggerSource | ( | STROBE_SOURCE & | TriggerSource, |
int & | InvertTrigger | ||
) |
Returns the trigger source.
TriggerSource | Trigger source |
InvertTrigger | Polarity of the trigger signal |
true
for success, use VIBSystem::GetLastErrorString() for an error descriptionbool VIB::Strobe::GetVoltage | ( | int & | Voltage | ) |
Returns the voltage value of the strobe output.
Voltage | ≥ 0: Voltage in mV < 0: Error |
true
for success, use VIBSystem::GetLastErrorString() for an error descriptionbool VIB::Strobe::Init | ( | bool | ResetParameter = true | ) |
Initializes the Strobe unit.
ResetParameter | The parameter is ignored, the strobe unit is always reset to default settings |
true
for success, use VIBSystem::GetLastErrorString() for an error descriptionbool VIB::Strobe::SetCurrent | ( | int | Current, |
int | Validate = 0 |
||
) |
Sets the current value of the strobe output.
If the Validate
parameter is set to 0, the characteristics value of the analog strobe circuit stored within an EEPROM is used without validation.
The Validate
parameter can be set to 1 in order to measure and adjust the current. The deviation of the desired current can be minimized in this mode. If the deviation is too high, this function will return with an error. The strobe output is activated multiple times for 200 µs at the given current when calling this function. Please note that the Max. ON-time parameter must be 200 µs or more in this mode.
Current | Desired current in mA |
Validate | 0: Don't validate current 1: Validate current |
true
for success, use VIBSystem::GetLastErrorString() for an error descriptionbool VIB::Strobe::SetFixedCurrent | ( | int | SupplyVoltage, |
int | LoadVoltage, | ||
unsigned int | MaxOnTime, | ||
unsigned int | MinOffTime, | ||
unsigned int | Current, | ||
int & | Result | ||
) |
Sets a fixed operating point for the strobe output.
This function can be used as an alternative to SetLimits() and SetCurrent(). It allows for higher output power, if the difference between SupplyVoltage
and LoadVoltage
is small.
The output current will be set to the specified value and this function returns the calculated minimum OFF-time. The current can't be changed with SetCurrent() after calling this function. But SetCurrent() can still be used with the same current value in order to validate the actual current.
Background: SetLimits() assumes a resistive load characteristic, which can lead to higher internal power losses at lower currents. Because the current can be decreased by the user, SetLimits() will calculate the limits based on the worst-case current.
SupplyVoltage | Supply voltage used for the strobe output:
| ||||
LoadVoltage | The voltage across the load when the output current is equal to Current | ||||
MaxOnTime | Maximum allowed ON-time in µs (max. ~ 4s) | ||||
MinOffTime | Minimum allowed OFF-time in µs (max. ~ 4s, use 0 to allow steady ON state) | ||||
Current | Output current in mA | ||||
Result | ≥ 0: Minimum allowed OFF-time (µs) < 0: Error |
true
for success, use VIBSystem::GetLastErrorString() for an error description bool VIB::Strobe::SetLimits | ( | int | LimitCurrent, |
int | SupplyVoltage, | ||
int | LoadVoltage, | ||
unsigned int | MaxOnTime, | ||
unsigned int | MinOffTime, | ||
unsigned int | Current, | ||
int & | Result | ||
) |
Calculates the minimum permitted OFF-time or the maximum permitted current.
The operating parameters for the strobe output can be limited by the strobe unit or by the lighting hardware connected to the output. This function is be used to calculate and limit these parameters.
The MaxOnTime
, MinOffTime
and Current
parameters should first be chosen by the user in a way, that the limits of the lighting unit are not exceeded.
Based on these parameters, this function ensures that the limits of the strobe unit are not exceeded. The parameter LimitCurrent
controls whether the minimum OFF-time or the maximum current will be reduced.
If the strobe active time exceeds the maximum ON-time, the output will be turned off by the FPGA, until the inactive time reaches the minimum OFF-time.
LimitCurrent | 0: Calculate the minimum allowed OFF-time 1: Calculate the maximum allowed current | ||||||
SupplyVoltage | Supply voltage used for the strobe output:
| ||||||
LoadVoltage | The load voltage when the output current is equal to Current (set to -1 to use worst-case value) | ||||||
MaxOnTime | Maximum allowed ON-time in µs (max. ~ 4 s; set MinOffTime to 0 to allow steady ON state) | ||||||
MinOffTime | Minimum allowed OFF-time in µs (max. ~ 4 s) | ||||||
Current | Maximum allowed output current in mA | ||||||
Result | LimitCurrent = 0 : New minimum allowed OFF-time (µs)LimitCurrent = 1 : New maximum allowed current (mA) |
true
for success, use VIBSystem::GetLastErrorString() for an error description bool VIB::Strobe::SetOnTime | ( | unsigned int | OnTime | ) |
Sets the ON-time of the strobe output for edge triggered modes.
OnTime | On time in µs |
true
for success, use VIBSystem::GetLastErrorString() for an error descriptionbool VIB::Strobe::SetOutputType | ( | STROBE_OUTPUT_TYPE | OutputType | ) |
Selects the output channel for the Strobe unit.
This function is primarily used by the VisionCam XM which can provide the LED current to the supply and I/O connector, or to the internal ring light (default).
OutputType | The desired channel |
true
for success, use VIBSystem::GetLastErrorString() for an error descriptionbool VIB::Strobe::SetTriggerDelay | ( | unsigned int | TriggerDelay | ) |
Sets the trigger delay.
The trigger delay is only used in software triggered and edged triggered hardware mode.
TriggerDelay | Delay in µs (max. ~4s) |
true
for success, use VIBSystem::GetLastErrorString() for an error descriptionbool VIB::Strobe::SetTriggerMode | ( | STROBE_MODE | TriggerMode, |
int & | Result | ||
) |
Sets the trigger mode.
The strobe output can be triggered using four different modes:
TriggerMode | Desired trigger mode |
Result | ≥ 0: New trigger mode < 0: Error |
true
for success, use VIBSystem::GetLastErrorString() for an error descriptionbool VIB::Strobe::SetTriggerSource | ( | STROBE_SOURCE | TriggerSource, |
int | InvertTrigger | ||
) |
Sets the trigger source for hardware triggered modes.
Hardware triggered mode must be selected first with SetTriggerMode().
TriggerSource | Select the signal used as trigger source |
InvertTrigger | Polarity of the trigger signal |
true
for success, use VIBSystem::GetLastErrorString() for an error descriptionbool VIB::Strobe::SwTrigger | ( | int | Value | ) |
Sets the trigger signal for software triggered and manual mode.
Value | 1: Activates the strobe output 0: Deactivates the strobe output (only used in level/copy mode) |
true
for success, use VIBSystem::GetLastErrorString() for an error description