Smart Camera Doesn't Capture First Few Images After Loading New Vision Application

Hello everyone,

Project description:

  • 2 units of VSS122R22.051P-000 (Smart Sensor) - VfMatching
  • 1 unit of VSC123R22.051P-000 (Smart Camera) - VfMatching + DeepOCR

Issue description:

  • When loading new vision application to the smart camera (ViBaseLoadApplication) , the smart camera will miss the first few image even after image acquisition command is given.
  • Tried loading new vision application to the other 2 smart sensors but there were no similar issue found.
  • In my program, I will reset the image acquisition command after detecting a new image (by comparing the image nettime and image result). I’ve also used a TON timer (10s) as a timeout to turn off the image acquisition command (if not the command will stay TRUE and subsequent image acquisition command will not work).
  • However, from the trace graph recorded it seems like the image acquisition command is reset by the TON timer instead of a new image detected for the first 3 images.
  • Subsequent image acquisition after the first 3 images works fine.
  • I load new vision application after the green LED on the camera become solid (after startup) and I start giving image acquisition command after the LED on camera become solid (after loading new VA)

Trace graph:

  • First acquisition - command reset by timeout timer (camera LED turns blue for a moment)
  • Second acquisition - command reset by timeout timer

I’m confused on what is causing this issue with the smart camera, anyone has any clue to troubleshoot or fix the issue? The program for handling load VA and image acquisition for smart camera is the same as the smart sensors.

I would also like to know if there are better ways to reset the image acquisition command if no new image is detected other than using a TON timer as timeout.

regards,
Alvin

Hard to say with just this information available.

Could you add the CameraStatus datapoint to the trace, or check how it behaves?

Automation Help: Cyclic Image Acquisition Data

2 Likes

Hello,

The camera only accepts image trigger when CameraStatus = 0 (or ImageAcquisitionReady = TRUE).
In your case, this is likely not true due to the loading of the new Vision Application, which causes a short delay.
During this time, the camera is not ready to acquire images, as indicated by CameraStatus ≠ 0 or ImageAcquisitionReady = FALSE.

Additionally, the available counters can be very helpful for debugging and verifying the trigger process.

AcceptedAcquisitionCnt increments and indicates whether the camera has accepted the trigger signal.
CompletedAcquisitionCnt increments when the image has actually been captured.
Once AcceptedAcquisitionCnt increaseses, you can safely reset ImageAcquisition to FALSE.

Recommended Procedure:

  1. Check CameraStatus == 0 (or ImageAcquisitionReady == TRUE).
  2. Store the current value of AcceptedAcquisitionCnt for later comparison.
  3. Set all necessary parameters for image acquisition, then set ImageAcquisition = TRUE.
  4. Wait until AcceptedAcquisitionCnt increments, indicating the trigger was accepted.
  5. Set ImageAcquisition = FALSE and wait for the image processing results.

If the camera does not accept the trigger (which should not happen when CameraStatus == 0),
you can reset ImageAcquisition to FALSE and issue a new trigger by setting it to TRUE again.
ImageAcquisition must remain TRUE for at least one POWERLINK cycle. If your task cycle is slower than the POWERLINK cycle, one task cycle is sufficient.

The following data points in the trace would be helpful for further analysis:
CameraStatus, ImageAcquisition, AcceptedAcquisitionCnt, CompeltedAcquisitionCnt, DelayNetTime01, and ImageNettime

Best regards,
Florian

2 Likes

Hello @tommi.piiparinen and @muehlauer ,

Thanks for your response!

Unfortunately, I don’t have access to the camera at the moment, but I’ll make sure to capture a more detailed trace once I’m able to connect to it.

Regards,
Alvin

Hello @muehlauer ,

Thanks for the advice on checking for new image acquisition. I’ll keep that in mind for future projects.

Regards,
Alvin

Hey guys,

I got the trace from the machine.

Hopefully it provides more information about the issue.

Also, from the system dump, I got these empty errors coming from VfMatching on the smart camera (gCamera1).


I’ve tried to search the error in Automation Help but I can’t find anything.

Could this be causing the issue?

Regards,
Alvin

Hello,

Unfortunately, the transitions are difficult to see in the trace image. Can you please upload the trace directly?
While we’re at it, please also upload the log file.

Best regards,
Florian

Hello Florian,

Here are the trace and log.

Best regards,
Alvin

SmartCamera_Issue.zip (2.3 MB)

Hello,

thank you for the data.
As I see in the trace there are 6 imageAcquisition requets but only 5 images taken. Is that right?
The image which was not taken was the first one.

As you can see with the acceptedAcquisitionCnt the camera is not accepting the the first imageAcquisition trigger.
If we look a little more closely, it is actually the case that the camera is ready at the time of the trigger (CameraStatus = 0),
but in the next cycle the CameraStatus = 128 (0x80) which means that the focus module is busy.
So it looks like a focus change is in progress and wos requested before or in the same time as the imageAcqusition trigger.
This is a little bit tricky with all the task and POWERLINK bus transmission times.

The camera is busy in case of a focus change an no image can be taken.
The way would be:

  1. change the focus (the command is processed asynchronously by the camera)
  2. to ensure that the camera has processed the command wait at least 5 PLK cycle + ca. 5ms
  3. check the CameraStatus
  4. if the cameraStatus is 0 you can trigger the image

Additional informations and recommendations from my side:

General Information
When operating the camera cyclically, special attention must be paid to task and bus cycle times.
On one hand, it takes some time for an action to be recognized, accepted, and displayed in the CameraStatus. On the other hand, some operations are processed so quickly that they may not appear in the CameraStatus or can be easily overlooked. The camera does not artificially extend the status display, as this would slow down the entire system from the perspective of trigger control.

Internal Processing
Only the trigger control (ImageAcquisition including the associated trigger parameters) is processed by the camera synchronously with guaranteed fixed jitter via POWERLINK. This is necessary to maintain overall camera performance.
Other commands from the cyclic frame (e.g., SearchAcquisitionSettings, IRFilter, SetFocus, or GainLevel) are processed by the camera during remaining time slots and may therefore take slightly longer to be processed and signaled in the CameraStatus, potentially with a jitter of a few milliseconds. This also applies to changes in the SDOs of the image acquisition configuration, which are asynchronous by nature.

Task Cycle and Bus Cycle Time
To avoid missing information in the CameraStatus, the task cycle should match the PLK cycle time and be synchronized with it.
For all requested camera actions, at least the bus cycle time must be considered before the action is recognized and signaled in the CameraStatus. For trigger control, this is guaranteed to be 5 PLK cycle times; for other actions, an additional ~5 ms may be required. Only after this time has elapsed following the issuance of a command is the CameraStatus and the camera’s Ready flag guaranteed to be valid.
Since some camera actions are processed so quickly internally that they may not appear in the CameraStatus (e.g., GainLevel), the following applies: if the corresponding flag in the CameraStatus is not set after the time period mentioned above, the action has been fully executed.

Actions with Feedback
For actions that provide cyclic feedback (SetFocus and ReadFocus, or GainLevel and ReadGainLevel), it is recommended to wait for the corresponding feedback after issuing the command.

Command Cascading
Commands are partially processed sequentially by the camera. Therefore, if commands are requested while other actions are still running, it may happen (due to bus cycle times and internal processing times) that the Ready flag briefly switches to TRUE before the next action is executed.
It is therefore recommended that users avoid requesting multiple actions before the previous ones are fully completed, or ensure that all actions are completely finished before a trigger is requested. Otherwise, the trigger will be ignored because the camera is not “Ready”.

I don’t have any information about the logbook entry at the moment, I’ll get back to you as soon as I have more information

Best regards,
Florian

1 Like

Good points ! Thank you for this details