Unit 9 / 9

Machine Vision and Quality Control

Gains:

  • Ability to set up basic image processing steps with OpenCV and adapt them to the quality control line with the help of AI
  • Ability to give vision system decisions such as illumination, calibration, and thresholding to AI with the right context
  • Ability to assess the risk of misclassification of machine vision results and the need for verification

Module Exam

1. In the case of an AI-generated engine driving code in mechatronics, which of the following steps should never be skipped before startup?

  • A) Verification and review of the code in a limited/secure environment ✔
  • B) Deleting the comment lines of the code
  • C) Translating variable names into Turkish
  • D) Uploading the code directly to the production line

Description: AI-generated embedded code can drive a physical actuator in the wrong direction or with excessive current, causing damage to hardware and the environment. Validating the code first in simulation or in a safe test environment with current/speed limits is a step the engineer cannot leave out.

2. You asked AI for the inverse kinematics solution for a six-axis robot arm. What should you do first before using the printout safely?

  • A) Sending the solution directly to the robot
  • B) Verify that joint angles remain within limits and working space ✔
  • C) Changing the color of the robot
  • D) Based only on the first solution and ignoring the others

Explanation: Inverse kinematics often produces more than one solution, and some may exceed joint limits or fall into singularity points. It is imperative to verify numerically that the solution remains within the joint limits and the accessible working space.

3. You wrote code to make the AI ​​take sensor readings on a microcontroller, and the code uses delay(1000) in the main loop. Why might this be a problem?

  • A) delay() permanently corrupts memory
  • B) delay() is blocking and prevents real-time response ✔
  • C) delay() only works on 8-bit processors
  • D) delay() physically heats the sensor

Explanation: `delay()` is blocking; The processor cannot do any other work during that time, all tasks except interrupts stop. In real-time mechatronic systems, this leads to missed sensor readings and response delay; Non-blocking (millis-based) structure is preferred.

4. You combine IMU (gyroscope) and encoder data in a mobile robot. What is the main purpose of using a complementary or Kalman filter?

  • A) To reduce the number of sensors
  • B) Combining the strengths of different sensors and reducing drift and noise ✔
  • C) To slow down the data rate
  • D) To simplify wiring

Description: Each sensor has its own error character: gyroscope is accurate in the short term but drifts over time, encoder/accelerometer is noisy. Sensor fusion combines the frequency region where each sensor is strong, producing a more accurate and stable estimation from a single sensor.

5. As we increased the integral (I) term in a PID controller, oscillation and overshoot started in the system. What is the most likely cause of this behavior?

  • A) The derivative term is zero
  • B) Aggressive smoothing due to excessive integral gain and windup ✔
  • C) The sensor is closed
  • D) Set value is negative

Explanation: Excessively large integral gain tries to correct accumulated error too aggressively and can lead to oscillation, overshoot and instability along with integral windup. Usually the I term is increased moderately to eliminate permanent error; If there is oscillation, I is reduced or windup limitation is added.

6. You produced a ladder logic sketch for a PLC with AI. What is the correct approach when designing an emergency stop (E-stop) button?

  • A) Using normally open (NO) contact and trusting the software
  • B) Normally closed (NC), ensuring switching to the safe side with fail-safe contact ✔
  • C) Applying E-stop with screen software only
  • D) Putting the E-stop at the very end of the main cycle

Description: Emergency stop circuits are designed with normally closed (NC) contact and fail-safe logic for safety; When the cable is broken or the power is cut off, the system must switch to the safe side (stop). AI output must be reviewed against this safety principle.

7. When simulating the dynamics of a DC motor with model-based design, AI seems to give results that are exactly in line with the real system. What is the right engineering attitude?

  • A) Accepting the model as a perfect copy of reality and not making measurements
  • B) Verify model assumptions and validity range with actual measurements ✔
  • C) Shortening the simulation time
  • D) Color the chart and report it

Description: The simulation model is an approximation of reality due to neglected friction, saturation, delay and parameter uncertainties. Model results cannot be considered absolutely accurate until they are compared with actual system measurements and the valid range (validation) is determined.

8. In predictive maintenance, you detect anomaly from vibration data for a bearing. What is the typical result of setting the threshold too low (too sensitive)?

  • A) Not producing any alarms
  • B) Generating frequent false positives without actual malfunction ✔
  • C) Automatically calibrate the sensor
  • D) Physically reducing vibration

Explanation: A very low/sensitive threshold produces an alarm even without an actual fault; These false positives lead to unnecessary downtime and maintenance costs, and over time, cause the operator to lose confidence in the alarms. The threshold is set to balance missed faults and false alarms.

9. You detect scratches on the surface of the part with machine vision on a production line. Which controllable factor most affects the reliability of the results?

  • A) Brand of the camera
  • B) Controlled and consistent lighting conditions ✔
  • C) Operator's years of experience
  • D) Color of painting the line

Description: In machine vision, illumination is the most critical and controllable factor of the entire chain. Inconsistent or inadequate lighting will fool even the best algorithm; controlled and repeatable illumination greatly reduces misclassification by managing shadows and reflections.

10. You had the AI ​​write code for a system that requires functional safety. Which of the following is the most accurate statement of responsibility regarding the use of AI?

  • A) AI takes responsibility for safety critical decision, engineer does not have to approve
  • B) Since AI is the most up-to-date model, the output can be taken into the field safely without testing
  • C) Responsibility for safety, testing and standard compliance lies with the engineer and the organization ✔
  • D) Responsibility lies solely with the AI provider who wrote the code

Description: AI is an engineering assistant; produces drafts, recommendations and analysis, but the engineer and the organization are ultimately responsible for the security, testing and compliance of the physical system with standards (e.g. ISO 13849, IEC 61508). AI output cannot be put into a safety critical system without verification.