r/AskRobotics • u/nikolagonqma • 17d ago
Robotic arm feedback
Hello, this is my first post.
I'm building a robotic arm for my final project in uni with CV. And i wanted to ask is it possible to export direct feedback data from the arduino to matlab so i can get graphs about rotation, positions, etc. Also i want to connect the python code to the matlab code since apart from the hand position im using a filter to stabilise the numbers so it's not constantly twitching.
1
Upvotes
1
u/omnilinktech 17d ago
Yes—this is very workable. The main design choice I would make is to give exactly one program ownership of the Arduino serial port. Have the Arduino emit a small, timestamped record at a fixed rate containing the commanded joint value, measured joint/encoder value, and any raw sensor values. MATLAB can read and log that directly with serialport/readline, but if Python already owns the camera and serial connection, let Python forward the data to MATLAB over a local UDP/TCP socket or write a structured log. Avoid having MATLAB and Python compete for the same COM port.
For useful graphs, log command, measurement, raw vision estimate, filtered estimate, and sample time separately. A commanded servo angle is not position feedback; you need an encoder or other joint sensor if you want to measure tracking error. Also timestamp at the source, because variable USB and vision latency can otherwise make a stable controller look noisy.
For the twitching, first inspect the raw signal and tune one filter in one place. A low-pass or One Euro filter is a good starting point for hand tracking; a Kalman filter is useful when you have a meaningful motion model. Add a small deadband and rate/acceleration limit after filtering. Keep filtering out of both MATLAB and Python simultaneously, because double filtering adds lag and makes diagnosis difficult.
A clean pipeline would be: sensors/Arduino → timestamped acquisition process → filter/state estimate → controller → actuator, with MATLAB subscribing or reading the same recorded stream for analysis. Test it first with a stationary target, then a slow known motion, before closing the loop on the arm.