Lộ trình C# — PC Control & Machine Vision

10 module · 128 buổi · Từ cơ bản đến vận hành máy thực tế
128
Buổi học
241
Bài tập
128
Bài giảng
10
Module
Module 1 — C# Core
OOP · Collections · Async · Design Patterns · SOLID · DI · Clean Architecture
30 buổi Đang học
Phase 1 — OOP Foundation
1
Class & Object cơ bản
Class, field, property · Constructor · Access modifier
2
Method nâng cao & Static
Overloading · Optional params · ref/out · Static
3
Kế thừa (Inheritance)
Base/derived · virtual/override · Constructor chaining
4
Interface & Abstraction
Abstract class · Interface · IDisposable
5
Enum, Struct, Value vs Ref
Enum · Struct vs Class · Boxing · Nullable
Phase 2 — Collections & Data
6
Generic Collections
List<T> · Dictionary · Queue/Stack · Performance
7
LINQ cơ bản
Where, Select, OrderBy · Method vs Query syntax
8
LINQ nâng cao & String
GroupBy, Join · String processing · Regex
9
Exception Handling
try/catch/finally · Custom exception · Retry pattern
Phase 3 — Event-Driven & Async
10
Delegate & Event cơ bản
Delegate · Action/Func · Event pattern · Lambda
11
Event nâng cao & Callback
Custom EventArgs · Memory leak · Event aggregator
12
Multithreading cơ bản
Thread, ThreadPool · lock, Monitor · Race condition
13
Task & Async/Await
Task/Task<T> · async/await · CancellationToken
14
Thread Safety & Sync
SemaphoreSlim · ConcurrentCollections · Producer-Consumer
Phase 4 — Design Patterns
15
State Machine Pattern
FSM · Enum + switch · State pattern · Transition table
16
Observer, Strategy, Factory
Observer cho IO · Strategy cho Vision · Factory
17
Singleton, Command, Template
Thread-safe Singleton · Command + Undo/Redo
18
Kiến trúc ứng dụng máy
Layer architecture · Config-driven · Plugin
Phase 5 — I/O & Communication
19
File I/O & Serialization
StreamReader/Writer · JSON · XML config · CSV
20
Serial Port & TCP/IP
SerialPort RS232 · TcpClient · Modbus/EtherCAT
21
Timer & Background Service
Timer types · IO monitoring · Logging · Stopwatch
Phase 6 — Advanced C#
22
Generic nâng cao & Reflection
Constraints · Reflection · Custom Attribute
23
Memory & Performance
Span<T> · ArrayPool · GC basics · Benchmarking
24
Capstone Project
State machine · Serial/TCP · Vision pipeline
Phase 7 — Software Engineering
25
SOLID Principles
SRP · OCP · LSP · ISP · DIP
26
Dependency Injection
IoC Container · Constructor Injection · Service Lifetime
27
Advanced Design Patterns
Adapter · Repository · EventBus · Pipeline
28
Clean Architecture
Layered Architecture · Config-Driven · Alarm System
Phase 8 — Capstone Console
29
Capstone Console Controller
DI + State Machine · Config + Recipe · Alarm
30
Review & Polish
Code Review · Unit Testing · Anti-patterns · OEE
Module 2 — WPF Fundamentals
XAML · Layout · Controls · Data Binding · Styles · Threading · Charts
10 buổi Đang học
31
XAML & Layout System
XAML syntax · Grid · StackPanel · DockPanel · WrapPanel · Margin/Padding
32
Essential Controls
Button · TextBox · ComboBox · ListBox · CheckBox · Event routing
33
Data Binding cơ bản
Binding markup · DataContext · OneWay/TwoWay · StringFormat · Converter
34
INotifyPropertyChanged & Collections
INPC pattern · ObservableCollection · Collection binding · DataGrid
35
Styles, Templates & Resources
Style · ControlTemplate · DataTemplate · ResourceDictionary · DynamicResource
36
Custom UserControls
UserControl · DependencyProperty · Routed events · Reusable components
37
Multi-Window & Navigation
Window lifecycle · ShowDialog · Frame/Page · ContentControl navigation
38
Threading & Dispatcher
UI thread · Dispatcher.Invoke · Task + Dispatcher · ProgressBar
39
Charts & Real-time Display
LiveCharts2 · Real-time data binding · Gauge · Trend chart · Performance
40
Capstone: Desktop Dashboard
Sensor dashboard · Live chart · Status indicators · Multi-tab layout
Module 3 — WPF MVVM & Machine HMI
MVVM · CommunityToolkit · DI Host · IO Panel · Tray Map · Teaching · Multi-screen
10 buổi Đang học
41
MVVM Pattern & CommunityToolkit.Mvvm
Model-View-ViewModel · ObservableObject · [ObservableProperty] · Tách code-behind
42
RelayCommand & ICommand
[RelayCommand] · CanExecute · AsyncRelayCommand · CommandParameter
43
Messaging & Dependency Injection
WeakReferenceMessenger · DI container · Generic Host · Constructor injection
44
Navigation trong MVVM
ContentControl navigation · INavigationService · DataTemplate mapping · History
45
Validation & Error Handling
INotifyDataErrorInfo · ObservableValidator · Data Annotations · Cross-validation
46
IO Panel HMI
Digital I/O monitor · LED indicator · Toggle output · Grouped IO · Real-time polling
47
Tray Map HMI
Tray/Wafer map · UniformGrid · Slot status · Yield statistics · Multi-tray
48
Teaching Mode HMI
Position teaching · Jog control · Teach points · Save/Load · Coordinate display
49
Multi-screen & Screen Manager
HMI shell · Screen navigation · Permissions · Status bar · Header · Overlays
50
Capstone: Full HMI Application
Complete machine HMI · All screens integrated · DI + MVVM + Navigation
Module 4 — Hardware Abstraction & I/O Control
Layered architecture · Interface design · Factory · Simulation · Digital I/O · Cylinder · Interlock
8 buổi Đang học
51
Kiến trúc phần mềm phân tầng
UI / Core Logic / HAL · Separation of Concerns · Thay hardware không ảnh hưởng logic
52
Interface Design cho Hardware
IMotion · ICamera · IInputDevice · IOutputDevice · ICylinder · ILightController
53
Factory & Adapter cho Vendor
Adapter pattern wrap vendor DLL · Factory tạo instance từ config · Keyed DI registration
54
Simulation Mode
SimulationMotion · SimulationIO · #if SIMULATION · Chạy toàn bộ software không cần hardware
55
Digital I/O — Read/Write
DInput/DOutput abstract · Name + Index + State · I/O board (EtherCAT, PCI) · Config-driven mapping
56
Cylinder Model chuẩn công nghiệp
2 limit sensor + 1 solenoid valve · Extend/Retract async · Timeout → Alarm · CylinderFactory
57
Signal Debounce & Interlock
Chống false trigger do rung · Interlock logic: check vị trí trước khi move · Safety chain
58
Capstone: Full HAL Layer
Device registry · Centralized init/connect/monitor · AllDevice singleton · Config load pipeline
Module 5 — Motion Control
Motor fundamentals · Servo protocols · Homing · Motion Profile · Multi-axis · Teaching
10 buổi Đang học
59
Motor Fundamentals cho Programmer
Servo vs Stepper · Encoder (incremental/absolute) · PUU · Pulse/mm conversion
60
Motion Interface & Factory
IMotion: ServoOn, Home, MoveAbs, Stop, GetPosition · MotionFactory · MotionParameter config
61
Ethernet-based Servo
Kết nối IP qua switch · Fastech EziMotion PlusE · Setup, connect, command flow
62
RS485 Serial Servo
Multi-drop trên 1 bus · Address configuration · Low-cost giải pháp
63
PCI Motion Card
Low-latency, tight sync · Ajinextek / ACS API · Card slot, axis mapping
64
Homing Strategies
Limit switch · Index pulse · Home offset · ProcessOrigin() flow · Home fail → Alarm
65
Motion Profile & Velocity
Trapezoidal · S-curve · Acceleration/Deceleration · Jog mode · Velocity mode
66
Multi-Axis Coordination
Linear interpolation · Circular interpolation · Sync motion · Gantry axis
67
Axis Registry & Teaching
Axis naming · Position table · Teach mode UI · Position recording/playback
68
Capstone: Multi-Axis Pick System
XYZ + R axis · Home sequence · Pick-Place cycle · Alarm handling · Simulation
Module 6 — State Machine & Auto Sequence
Multi-level state · Parent-child process · Alarm system · Manual/Semi/Full-Auto
8 buổi Đang học
69
Multi-level State System
Main state + Transitional state · Graceful stop, không abort ngay
70
Parent-Child Process Model
Master process điều phối N sub-process song song · ProcessBase<T>
71
Process Synchronization
Status flag đồng bộ · Deterministic, no deadlock · WaitForAll pattern
72
Production Cycle Design
Wait Part → Pick → Inspect → Place → Return → Repeat · ProcessStep tracking
73
Operation Modes
Manual (step-by-step) · Semi-Auto (single cycle) · Full-Auto (continuous)
74
Alarm System chuyên nghiệp
Error code + Severity level + Recovery action · EAlarm enum · AlarmService
75
Start / Stop / Reset Sequence
Startup checks (air, driver, limits) · Dry-run verification · Chuẩn vận hành
76
Capstone: Multi-Process Orchestrator
RootProcess + 4 SubProcess · Song song + đồng bộ · Alarm + Recovery · Dry-run
Module 7 — Machine Vision
Camera · Lens · Lighting · OpenCV · Transforms · Contour · Blob · Feature Matching · Calibration · Pipeline
30 buổi Đang học
Vision Hardware — Camera, Lens, Lighting
77
Tổng quan hệ thống Machine Vision
Light → Lens → Sensor → Grab → Process → Result · Application-first approach · So sánh hãng camera (Basler, Cognex, Hikvision, IDS, FLIR)
78
Image Sensor & Camera Selection
Global vs Rolling Shutter · Pixel size trade-off (sensitivity vs resolution) · Exposure & motion blur · Bit depth (8/10/12-bit) · Frame rate · GigE/USB3/CoaXPress
79
Lens & Optics
Focal length · Aperture (f-number) · DOF · Magnification · Telecentric lens cho precision · Pinhole model · Distortion (barrel/pincushion) · FOV calculation
80
Lighting Design — Kỹ thuật chiếu sáng
Camera chỉ capture reflected light · Ring/Bar/Backlight/Darkfield/Dome/Coaxial/Structured light · Selection matrix: surface type × feature · Demo ảnh thực tế
81
Lighting nâng cao & Stability
Strobe vs Continuous · Strobe sync trigger timing · LED degradation theo thời gian · Ambient light interference · Lighting design workflow thực tế
OpenCV Core — Xử lý ảnh cơ bản
82
OpenCV & Mat Structure
Mat (rows, cols, type, data) · Pixel access (at<>, ptr<>) · ROI (SubMat) · Color spaces (BGR/HSV/Gray/Lab) · CvtColor · Channel split/merge · Drawing (circle, line, rect, text)
83
Geometric Transforms
Resize · Rotate · Flip · WarpAffine (GetRotationMatrix2D) · WarpPerspective · GetPerspectiveTransform · Crop & pad · Ứng dụng: image alignment, perspective correction
84
Thresholding & Morphology
Binary/Otsu/Adaptive threshold · Erode/Dilate/Open/Close/Gradient/TopHat/BlackHat · Structuring elements (rect/ellipse/cross) · Noise removal pipeline thực tế
85
Filtering & Edge Detection
GaussianBlur/MedianBlur/BilateralFilter · Sobel operator · Laplacian · Canny edge detection · Derivative filters · Sharpening · Denoising strategies cho production
86
Contour Analysis
FindContours · Contour hierarchy · Moments (area, perimeter, centroid) · BoundingRect/MinEnclosingCircle/FitEllipse · ConvexHull · ApproxPolyDP · Shape descriptors
87
Histogram & Color Analysis
CalcHist · EqualizeHist · CLAHE (adaptive) · InRange cho color segmentation · HSV-based object detection · Back projection · Practical color inspection
Detection & Measurement — Thuật toán nhận dạng
88
Blob Analysis & Connected Components
ConnectedComponentsWithStats · Area/Perimeter/Circularity/Aspect ratio · Blob filtering · Defect detection workflow · Object counting · Ví dụ nhà máy thực tế
89
Line & Circle Detection
HoughLines/HoughLinesP · HoughCircles · FitLine (L2/L1/Huber) · Custom edge-based circle fitting (LMS) · Line angle calculation · Ứng dụng alignment
90
Template Matching
MatchTemplate (NCC, CCORR, SQDIFF) · Rotation-aware matching (WarpAffine + angle sweep) · Multi-scale · Score threshold tuning · Golden sample strategy
91
Feature Detection & Descriptor Matching
ORB · AKAZE · KeyPoint & Descriptor · BFMatcher / FLANN · FindHomography · Perspective correction · Ứng dụng: part ID khi thay đổi góc/scale
92
Geometric Measurement & Calibration
Pixel-to-mm với checkerboard · FindChessboardCorners · CalibrateCamera · Undistort · N-point calibration · Measurement accuracy validation
93
Barcode, QR Code & OCR
ZXing/ZBar cho 1D/2D decode · Multi-code reading · Quality grading · Tesseract OCR · Font training · Character segmentation · Verification workflow
Production Vision — Pipeline & Đồng bộ
94
Vision Pipeline Architecture
Tool chain: Acquire → Pre-process → Locate → Measure → Output · VisionFlow graph · Async execution · Result aggregation · IVisionResult (OK/NG judge)
95
Training & Threshold Tuning
Golden image strategy (50-100 ảnh variation thực tế) · False reject vs false accept · Threshold tuning từ production data · SPC cho vision parameters · Recipe-driven config
96
Vision-Motion Synchronization
3 trigger modes (Software/Hardware/Free-run) · Full sync flow: position → grab → process → offset → compensation · Multi-camera anti-interference · Hand-eye calibration · Cycle time budget
Vision nâng cao — Fixture, Matching, Measurement
97
Fixture & Coordinate Space
Fixture: định vị hệ tọa độ theo sản phẩm · Affine Transform 2D · Training vs Runtime · Multi-Fixture · Cascaded Fixture · So sánh VisionPro/HALCON/VisionMaster
98
Shape-Based Pattern Matching
Edge-based matching · Pyramid search · Rotation/Scale invariant · Tự build shape model từ contour · Sub-pixel accuracy · Score evaluation
99
Caliper & Edge Measurement
1D projection profile · Gradient-based edge detection · Sub-pixel interpolation · Edge pair measurement · CogCaliperTool concept
100
Line/Circle Fitting & Gauging
Multi-caliper → Least squares fitting · Line fitting · Circle fitting · Angle measurement · Distance point-to-line · GD&T basics
101
Surface Inspection & Defect Detection
Golden image subtraction · Local contrast anomaly · Texture analysis · Scratch/Dent/Stain detection · Classification OK/NG
102
Color Inspection
Color space Lab/HSV · Delta E calculation · Multi-region color sampling · Color tolerance · Production color matching
103
Presence/Absence & Assembly Verification
Multi-region check · Pattern count · Orientation verify · PCB component check · Screw presence detection
104
Case Studies thực tế
Connector pin inspection · Label/barcode check · Assembly verification · Surface scratch detection · Robot guidance
105
Vision ↔ PLC/Robot Communication
TCP/IP result output · Trigger timing · Coordinate transform cho robot pick · Hand-eye calibration · Integration testing
106
3D Vision Fundamentals
Structured light triangulation · Height map · 3D point cloud basics · 3D measurement · Stereo vision concept
Module 8 — Vision Application & WPF Integration
Camera abstraction · VisionTool framework · VisionFlow engine · Teaching UI · Live display · Result overlay
8 buổi Đang học
107
Camera Abstraction Layer
ICamera interface (Connect, GrabSingle, ContinuousGrab, ExposureTime) · GrabData → Mat conversion (Marshal.Copy) · Hikvision SDK wrapper · SimulationCamera cho offline dev
108
VisionTool Framework
VisionToolBase (RunAsync, DIPFunction, Parameters/Inputs/Outputs) · ObjectCollection registry · ToolRunCallback · Custom tool development · Tool state machine (Idle → Running → Done)
109
VisionFlow Engine
VisionFlow graph (tools + connections) · Connection key mapping · Async execution (Task.WhenAll) · Mat cloning thread safety · OutputTool result collection · Pixel-to-mm conversion
110
Light Controller & Hardware Integration
ILightController interface · Channel control (SetLightLevel, SetLightStatus) · DI keyed services · SetLightLevel trước khi grab · Strobe timing sync
111
WPF Vision Teaching UI
VisionTeachingView · Tool palette (drag & drop) · Flow graph visualization · ConnectionPathView · Tool position persistence · VisionFlowRepository (JSON serialization)
112
Tool Parameter Editors
Per-tool edit views (ThresholdToolEdit, HoughCircleEdit...) · Live preview · ROI drawing adorners (CircleResize, RectangleResize, LineResize) · Real-time parameter tuning
113
Live Camera Display & Result Overlay
MatToBitmapSourceConverter · ImageDisplayer control · DrawAction callback pattern · Inspection result overlay · Performance optimization · Memory management (Mat.Dispose)
114
Capstone: Vision Inspection App
Full WPF app: camera config → flow design → teach → inspect → result display → save/export · VisionProcess integration · Recipe-driven vision parameters
Module 9 — Communication & System Integration
Serial · TCP/IP · EtherCAT · Robot comm · Database · Recipe · MES · Remote monitoring
8 buổi Đang học
115
Serial RS232/RS485 nâng cao
Protocol design · Multi-drop RS485 · Legacy device integration · Timeout & retry
116
TCP/IP Async Communication
Async client/server · Auto-reconnect · Heartbeat · Event-driven receive · Buffer management
117
Industrial Fieldbus
EtherCAT · Modbus TCP/RTU · Profinet · OPC UA · Realtime I/O control qua fieldbus
118
Robot Communication
KUKA TCP protocol · Send command + Wait completion · Motion parameter · Error handling
119
Database & Structured Logging
SQLite / SQL Server · EF Core · log4net / Serilog · Rolling file · NotifyAppender cho UI
120
Recipe Management System
Recipe CRUD · Attribute-driven UI · Version control · Import/Export · Đổi product → Load parameter set mới
121
MES & Production Data
Lot tracking · Inspection result upload · OEE/UPH/Yield · Shift report · Quality audit export
122
Remote Monitoring & Dashboard
SignalR real-time · Web dashboard · Push notification · Remote debug qua log analysis
Module 10 — Capstone Full Machine
System design → Device init → Motion+Vision+IO → Auto sequence → Production UI → Deploy
6 buổi Đang học
123
System Architecture Design
Requirements → Module decomposition → Interface design · Config structure · DI bootstrap
124
Startup Sequence & Device Init
Load config → Create devices → Connect → Load recipe → Init process → Ready · Each step can fail
125
Motion + Vision + I/O Integration
Coordinate mapping · Trigger sync · Vision sub-process · I/O interlock · Multi-axis + camera pipeline
126
Full Auto Sequence
RootProcess + N SubProcess · Production cycle · Manual/Semi/Auto mode · Alarm + Recovery
127
Production UI & Operation
Full HMI · Recipe switching · Data logging · Report generation · Remote access
128
Testing, Deployment & Final Review
Dry-run verification · Performance tuning · Cycle time optimization · Installer · Code review · Demo