My Work
Projects & Creations
Personal and professional projects spanning system modeling and control, weld process physics, perception, and embedded systems.
Robot Dynamics, Controller Design & Seam-Tracking Stability (BCIT)
Description
- Modeling and control study for the Fanuc CRX-10iA in the BCIT welding cell. I derived the arm's rigid-body dynamics, M(q)q̈ + C(q, q̇)q̇ + G(q) = τ, directly from its URDF and implemented them from scratch: the recursive Newton–Euler algorithm for inverse dynamics and the composite rigid-body algorithm for the inertia matrix. The controllers get M, C and G as separate terms, and the model reads the same inertial parameters as the simulator, so a comparison measures the control law and not a model mismatch.
- Designed six joint-space controllers behind one interface: computed torque (the formulation from my MASc thesis, extended with the Coriolis term a six-axis arm can't neglect); MPC on the feedback-linearised plant, solved as a constrained QP with joint, rate and torque limits; computed torque with a learned inverse-dynamics network; iterative learning control, which suits the repeated passes of multipass welding; ADRC with an extended state observer; and an adaptive network whose output weights update online.
- Compared them across three studies, each on 12 randomised weld-representative trajectories. With a nominal model, computed torque and ILC track to about 0.013° RMS. With an unmodelled payload on the distal links, computed torque and MPC degrade to 2.6–3.1°, while the adaptive controller holds 0.077°. Under torque limits with a seam step, MPC does best at 0.152°. No controller wins everywhere, and the model-based ones are only as good as their model.
- The cross-track seam-tracking loop is modelled as e_m[n] = e0[n] − c[n−d] + v[n], with d segments of transport delay from the torch camera's look-ahead. The characteristic polynomial z^(d+1) − z^d + K = 0 gives the stability limits: K < 0.618 at two segments of delay and K < 0.445 at three. The shipped gain of 0.6 was sitting on the boundary, which explained the ringing seen in simulation.
- Recast tracking as estimating the seam offset, ê0[n] = e_m[n] + c[n−d], and compared a plain integrator, a Smith predictor, a trajectory buffer and a Kalman estimator on constant, bowed and stepped seams. In the plant model, worst-case error fell from 1.30 mm to about 0.80–0.85 mm. Against the physics-derived distortion (a ramp rather than a step), the Kalman estimator's rejection dropped from 30% to 20%. In the Isaac Sim cell, a 20-weld interleaved campaign found no significant difference, so the remaining error is a measurement problem rather than a control one.
- A deployment constraint shapes all of this: the Fanuc controller owns the servo loop and only accepts Cartesian path offsets over EtherNet/IP (Dynamic Path Modification, about 24 Hz). The joint-torque controllers therefore characterise the arm model in simulation, and the outer cross-track loop is the part that transfers to hardware.
Technologies
Rigid-Body DynamicsNewton–Euler / RNEACRBAComputed-Torque ControlModel Predictive ControlIterative Learning ControlADRCAdaptive ControlKalman FilterSmith PredictorDiscrete-Time StabilitySystem ModelingPython / NumPyFanuc CRX-10iA
Physics-Based Weld Process Model & Simulated Welding Cell (BCIT)
Description
- Research at the BCIT Centre for Welding Technologies and Metallurgy Research. The rest of the stack treats a weld as a path to follow. This models what the arc actually does to the plate, from the governing equations rather than from curve fits, so a set of parameters can be checked before anyone strikes an arc.
- Heat source and temperature field: a Goldak double-ellipsoid power density, q = 6√3·f·Q / (abc·π^(3/2)) · exp(−3x²/c² − 3y²/a² − 3z²/b²), and Rosenthal's moving point-source solution, T − T₀ = Q / (2πkR) · exp(−v(R + ξ) / 2α), with heat input H = ηUI/v. At the cell's nominal pass it gives t8/5 = 8.1 s, inside the EN 1011-2 band, and the Goldak normalisation integrates back to the arc power exactly.
- Arc as an electrical circuit: on a constant-voltage machine the current is an output, not a setting. It is solved from Lesnewich's melting rate MR = αI + βLI², with α and β derived from an energy balance instead of a regression, together with CTWD = L_ext + L_arc. This reproduces self-regulation, about −2.4 A per mm of standoff (literature: 2–6 A/mm), which is the basis for a through-arc seam-sensing model.
- Distortion by the inherent-strain method: wherever the peak temperature passes the point where steel loses its yield strength, it keeps a plastic strain ε* = −α(T_p − T₀). Integrated through the joint and fed into a beam model, this gives transverse shrinkage, angular distortion and bowing without a full thermo-elasto-plastic FE run. The deposited bead, which sits outside the section, supplies 83% of a 6 mm fillet's 0.66° rotation. The disturbance a seam tracker actually faces turns out to be a ramp to 5.4 mm over a 300 mm pass, not the 3 mm step it had been tested against.
- Weld pool and bead: Marangoni flow and the Heiple–Roper sign reversal set the pool shape. The bead cross-section is solved as a Young–Laplace free surface (capillary length √(γ/ρg) ≈ 4.2 mm) pinned between the fused toes, where mass sets the area (A = A_wire·WFS/v·η_dep) and heat input sets the wetted width. A ray-traced laser line profiler with occlusion then "measures" that bead, and a height-field model fills a groove bead by bead for multipass planning.
- Emissions and arc sound: spatter and fume follow from the same mass balance and the transfer mode. The arc is modelled as a thermoacoustic monopole, p = (γ−1)/(4πc²r)·dP/dt, driven at the metal-transfer rate f = 3·v_wfs·d_w² / (2·d_drop³), so short-circuit, globular and spray each render to a WAV that sounds the way they do.
- All of it feeds a procedure tool with an eight-clause envelope (heat input, t8/5, burn-through, transfer mode, AWS D1.1 leg size, CTWD and torch angles). It flagged the cell's own shipped parameters: t8/5 was too short on 12 mm plate, and 180 A on 1.2 mm wire sat in the globular band at 9.6% spatter.
- The same cell runs in Gazebo and in NVIDIA Isaac Sim 6.0, both built from one SDF/URDF, with an overview camera that finds the joint and a torch camera that tracks it. The stability analysis and controller design for that tracking loop are in the Robot Dynamics & Controller Design project. About 370 unit tests cover the physics, tracking and simulation packages.
Technologies
PythonNumPy / SciPyROS2Heat TransferGoldak Heat SourceRosenthal SolutionInherent-Strain DistortionArc PhysicsWeld Pool PhysicsYoung–LaplaceAcousticsNVIDIA Isaac SimGazeboOpenCVSeam TrackingControl Theorypytest
BCIT Robotic Welding System (ROS2 + AI)
Description
- Wrote a ROS2 driver for the Fanuc CRX-10iA that talks to the controller over EtherNet/IP, in C++ on top of the EIP Scanner library, so the whole cobot can be driven from ROS2 rather than the teach pendant.
- Built the operator UI in PyQt5 for the Fanuc CRX-10iA / Lincoln R450 PowerWave cell: jogging, a multipass planner (four taught base points, per-pass offsets, up to eight passes), and dry-run vs. weld modes, with real-time path correction through Fanuc's Direct Position Mode (DPM).
- Wrote a driver for the R450 that speaks Lincoln's ArcLink/XT protocol over TCP. It started in Python and is now a native C++ ROS2 node that discovers the devices on the power source's bus (weld controller, wire drive, gas controller), selects the procedure and schedule, runs gas, arc and wire inching, and publishes live current, voltage and wire-feed-speed feedback.
- The controller runs a set of background TP and KAREL programs I wrote that act as a thin firmware layer between the hardware and the ROS2 nodes.
- An experiment GUI records current/voltage/WFS traces and arc-on video for each pass and saves them to the lab's WAAM database through its Rails API.
- Now putting an AI agent into the live welding loop — LLMs and VLMs first for the high-level decisions, with smaller task-specific models to follow. To go with it I built a physical-safety benchmark for AI-written welding programs: a 20-row hazard taxonomy (burn-through, gas pre-flow, arc exposure, ...) turned into monitors that score the executed trace, not the model's prose.
Technologies
ROS2C++PythonPyQt5EtherNet/IPArcLink/XTKARELTCP/IPFanuc DPMRuby on Rails APILLM/VLMAI Safety
Vision-Based Weld-Bead Perception & Feed-Forward Control (WAAM)
Description
- Directed studies project (Fall 2026) on the same BCIT welding cell: measuring the geometry of a weld bead as it is laid down and using that to drive the process, all on ROS2 with the Fanuc CRX-10iA and Lincoln R450.
- A camera mounted on the robot hand (eye-in-hand) watches the bead. An existing width-estimation module is validated against a Revopoint Metro X Pro laser scan for ground truth, and I am adding a new height estimator that triangulates the bead surface from multiple frames using the known camera motion.
- The perception data feeds a trained feed-forward model — a learned inverse of the process — that takes a target bead width and height and predicts the travel speed and wire-feed speed needed to produce it, with a WPS bounds check clamping anything out of range before it reaches the controller.
- Part of the work is a feasibility study on whether the perception loop can run on the edge: profiling acquisition, processing, and end-to-end response time on the workstation first, then on CM4-class boards (Raspberry Pi, Radxa).
Technologies
ROS2PythonComputer VisionEye-in-Hand CalibrationTriangulationFeed-Forward ControlNeural NetworksFanuc CRX-10iALaser ScanningEdge Deployment
Custom PCB Design — Flex Camera Cable & STM32 Board (KiCad)
Description
- Hardware design work for the BCIT welding-research vision system.
- The main piece is a custom flexible printed circuit (FPC): a two-layer flex cable that carries the camera interface between a Gowin GW1NR-LV9 FPGA board and the imaging sensor. It fans a 35-pin flip-lock connector out to a 23-pin one, on fine-pitch gold-plated contacts, and I had it fabricated through JLCPCB after a couple of order-review rounds on the flex stackup.
- Alongside it I designed a two-layer STM32F103 (Cortex-M3) MCU board — USB Micro-B, an AMS1117 3.3 V regulator, a 16 MHz crystal laid out to ST's AN2867 oscillator guidelines, boot-mode switches, status LED and an SWD header for ST-Link programming.
Technologies
KiCadPCB DesignFlexible PCB (FPC)Schematic CapturePCB RoutingSTM32F103Gowin FPGAJLCPCBST-Link / SWDHardware Design
In-Pipe Welding Robotic Arm
Description
- Built with the team at the SFU Motion and Power Electronics Control Lab. The mechanical design came from the project lead; I took on the modeling and control, the embedded systems, and the seam-tracking, and co-led the wiring and assembly.
- Modeling and control first: I worked out the DH kinematics, the analytical Jacobian and workspace, closed-form inverse kinematics (solved two ways and cross-checked in Simulink), and the Lagrangian dynamics with inertia tensors from SolidWorks. On that model I designed a computed-torque controller and benchmarked it against independent-joint PI control for the DC and PMSM axes, tuned with frequency-response and time-domain methods, plus a jerk-minimised piecewise-polynomial trajectory generator. All of it was verified on dSPACE with Hardware-in-the-Loop before the portable build went together.
- Prototyped the control software on a TMS320F240 DSP under dSPACE, then moved the final build onto a Raspberry Pi Compute Module 4 and an NXP S32K144 MCU.
- For seam tracking I paired the line-laser sensor with Python that filters the point cloud with KNN and pulls the edge out with piecewise-linear fitting, tight enough to correct in real time.
- The finished arm holds ±0.13 cm in height and 0.4° in rotation, with seam tracking and multi-pass welding emulation both proven on the physical robot. I also built a FreeMaster HMI and a browser dashboard over JSON-RPC (HTML/CSS/JS) for live control and MCU tuning.
Technologies
Lagrangian DynamicsDH KinematicsComputed-Torque ControlPI ControlTrajectory GenerationSimulinkdSPACE / HILC++PythonROS2Raspberry Pi CM4NXP S32K144TMS320F240BTS 7960SOLO UNO v2Wenglor weCat3DSPITCP/IPKNNDifferential EvolutionJSON-RPCMATLAB
SKC Engineering – Level 3 Fitness-For-Service Assessment, Locomotive 2141 Boiler
Description
- I was the FEA lead on a Level 3 Fitness-For-Service assessment (API 579-1 / ASME FFS-1, Part 8) of the 1912 riveted and welded firebox on the Spirit of Kamloops, Locomotive 2141. The report went to a regulator and was independently reviewed.
- Ran seven elasto-plastic simulations in SimScale over four versions of the geometry — the design intent, the as-measured distorted shape, and two weld-overlay repair options — under pressure-only and coupled transient thermo-mechanical loads at 200 psi MAWP.
- The as-measured firebox came from a Revoscan laser-scan point cloud, which I sliced, thickened to the real plate thickness, and swept into a clean parametric CAD model. Material models were bilinear isotropic hardening with temperature-dependent properties at the 350 °C design metal temperature, plus a separate E7018 weld-overlay material with its own calibration.
- To get the structural behaviour right I used symmetry planes, Winkler elastic supports with a per-stay stiffness K = EA/L tied to each missing stay's length, frictionless sliding contacts for the ball-end stays, and a six-zone heat-flux condition that blends convection and radiation from the 1500 °C fire side to the nucleate-boiling water side.
- Wrote a Python post-processor (PyVista/SciPy) to handle the stress and strain checks — projecting the assessment paths onto the deformed mesh, walking Dijkstra geodesics for the worst orientation, and running the local-strain (εL) and stress-linearization checks from ASME VIII Div 2 Annex 5.A. It agreed with the solver's own output to within ±2 ksi, and a 7× mesh-refinement study came back within ±5% when reproduced in Abaqus.
- Also wrote the internal report on the firebox corner-bend geometry, with an interactive MATLAB tool for plane slicing, PCA profile ordering, bend-angle and inscribed-arc extraction, and stay-pitch measurement.
- The result: the boiler was cleared to return to service at its full historical 200 psi MAWP with no derate, which avoided a repair estimated north of $200,000.
- Alongside the FFS work I ran cobot welding trials at BCIT, laser-scanning parts before and after to catch distortion, and built frontend tools for the welding engineers in JavaScript plus the website and database for a Fleet Management module in Ruby on Rails.
Technologies
API 579-1 / ASME FFS-1ASME VIII Div 2SimScaleANSYSAbaqusElasto-Plastic FEAThermo-Mechanical FEAPython (PyVista/SciPy)MATLABSolidWorksLaser ScanningPoint Cloud
ACIM 5010 – Automated Conveyor Sorting System
Description
- Built a conveyor sorting system end to end in Studio 5000 on a CompactLogix L36ERMS Safety PLC.
- Kept the ladder logic modular — separate subroutines called through JSRs, with a state machine driving the sequence rather than one long rung stack.
- Wired in photo-eye sensors, pushbuttons, indicator lamps, and pneumatic actuators, and handled the timing with TON timers and CTU counters so the motion stays deterministic.
- Ran the PowerFlex 525 VFD off digital I/O for safe start/stop, and wrote fault logic on top of the timers and counters to catch missing bins, initialization timeouts, and E-stop conditions.
Technologies
Studio 5000Ladder LogicCompactLogix PLCPowerFlex 525 VFDIndustrial Controls
Automated Bottling Plant — PLC Control System
Description
- Wrote the complete ladder logic control program for a continuous bottling line on Allen-Bradley SLC 500 addressing, developed and validated on the LogixPro simulator, and verified rung by rung against all 25 functional requirements.
- The governing design decision was to measure each bottle once at the inspection station and carry its properties downstream in software, so every later station acts on remembered data rather than re-sensing. Two parallel 32-bit BSL shift registers — one for size, one for condition — are clocked by the conveyor, so a bottle's flags stay aligned with its physical position at any bottle spacing.
- Fixed bit taps read each property at the exact position of the fill tube, scrap gate, cap RAM and divert gate. Property-gated actuation structurally enforces the safety rule that broken bottles are never filled or capped: the fill tube and cap RAM are gated by the tracked condition bit rather than a re-read sensor.
- A single on-delay timer (0.1 s base, preset 10) defines a 1.0 s processing window per bottle, with a LIM-gated 0.2–0.8 s actuation sub-window guaranteeing that fill, cap and gate motion always completes before the belt indexes.
- Five up-counters with TOD conversion multiplex four live production totals — small, large, scrap and completed boxes — through one shared BCD display word via dedicated enable bits, with a PREV BOX GONE / NEXT BOX HERE handshake sequencing the scrap-box changeover.
- Verification surfaced three residual fail-safe gaps that were not in the original requirements, all closed: fill charges re-gated to the master RUN bit so no charge persists through a Stop, a scrap-gate interlock against scrap-conveyor motion, and a first-scan (S:1/15) rung resetting every counter and timer to a known state on download.
Technologies
RSLogix 500Allen-Bradley SLC 500Ladder LogicLogixProShift Registers (BSL)Timers & CountersBCD / TODFail-Safe InterlocksIndustrial Controls
Mobile Robot with Advanced Perception
Description
- A mobile robot that navigates on its own with Hector SLAM and spots stop signs with a YOLOv3 model.
- On top of that, an OpenCV line-tracer keeps it on course and a small CNN reads cat and dog images off ArUco markers — the robot uses those cues to decide where to drop its red and blue balls and finish the mission.
Technologies
ROSPythonYOLOv3OpenCVHector SLAMCNNArUco Markers
Bridge Under Heavy Loading: Fiberglass vs Steel Reinforcement
Description
- A research project comparing fiberglass-reinforced and steel-reinforced concrete under heavy loading, run in ANSYS.
- I looked at how deflection and stress distribution differed between the two, to see whether fiberglass rebar is a viable option for reinforcing concrete floors.
Technologies
ANSYSFEMStructural AnalysisMaterials
Digital PID Speed Control of an RC Car (Register-Level AVR)
Description
- A discrete-time PID speed loop for an RC car, run at a fixed 1 kHz from a Timer2 compare-match interrupt so the sampling period is exactly constant. The encoder speed goes through a first-order low-pass filter, discretised with the Euler approximation, before it reaches the controller. The loop was tuned against the actual car.
- To get that timing I wrote my own ATmega328p library straight from the datasheet (registers, timers, ADC, PWM, interrupts) instead of relying on the Arduino layer.
Technologies
PID ControlDiscrete-Time ControlDigital FilteringCATmega328pAVREmbedded
Rotary Series Elastic Actuator (RSEA) — Technical Review
Description
- A technical review of K.C. Kong's work on Rotary Series Elastic Actuator control for human-robot interaction, with Simulink models I built to reproduce the control behaviour.
- The focus was compliance and force control, and what they mean for keeping physical human-robot interaction safe.
Technologies
SimulinkControl TheoryHRISeries Elastic Actuators
Feelstance – AI Navigation for the Visually Impaired
Description
- A device that turns a flat 2D picture into a 3D touch sensation, aimed at helping blind and visually impaired people navigate. We proposed it and built a prototype.
- Deep learning pulls dense 3D depth out of the 2D image, and that depth gets rendered as touch on the user's skin through small electromechanical actuators.
- It ties a phone, an embedded system, and the deep-learning model together into a single wearable navigation aid.
Technologies
Deep LearningPythonEmbedded SystemsOpenCVComputer VisionMobile Development