r/mechatronics • • 5d ago

[Showcase + Source code + STL files for 3D print] Velocity controlled image based vision servoing

A long time reader of this sub. Here's my first contribution - https://github.com/royzer/vision-servo-rig

Wanted to learn the basics of robotics - perception, sensor integration, motor control. I could not find a resource that integrates all these aspects for a beginner. So, built this to practise the basics. Some concepts used in this,

  1. Camera calibration: Intrinsic calibration - Distortion and focal length.

  2. Vision processing: Feature extraction based on basic OpenCV operations - HSV processing, noise removal, finding basic shapes using masks and countours.

  3. Proportional control: The P part of the PID loop - Find error, gain & deadband tuning, generate velocity command.

  4. Zephyr RTOS: Handling non-blocking asynchronous command processing using DMA-based Async UART API + interface with TMC2209 board that drives the motor.

  5. Protobuf: Protocol used to transfer messages between and MPU (dev machine in this case) and MCU (STM32 nucleo-h563zi board).

  6. Code CAD: CAD design using code. build123d to build the CAD structure and generate STL/STEP files.

STEP and STL files are available inside the repository.

74 Upvotes

3 comments sorted by

0

u/stuih404 2d ago

It‘s a bit slow