Drawing Squares
🌓 : Progress
The robot arm is moving! The photo above is ~40 second exposure of a laser drawing made by the robot arm.
To create the double-square, I sent cartesian coordinate commands over a ROS topic, which were converted into desired shoulder and elbow joint velocities via a ROS2 controller. The transformation from cartesian-space commands to joint-space commands was done using differential inverse kinematics with the help of the Drake CalcJacobianTranslationalVelocity function and the Eigen pseudoinverse function.
Because both the ODrive shoulder joint and NEMA17 stepper elbow joint use position control, these resulting joint-velocity commands are then integrated to give joint-position commands. These commands are sent from ROS2 (running on a RPi5) to the ODrive S1 and Arduino via CAN bus. These two devices also send their motor’s position and velocity back to ROS2 over CAN, which is important for Drake to use to calculate a new Jacobian matrix.
One of the most obvious problems, which can be seen via the spiraling laser lines, is that the shoulder joint vibrates at low speeds. I’m going to spend some time properly tuning the PI parameters for the ODrive, and maybe enabling anticogging to hopefully improve this.
The other problem is that the sides of the square are not really straight. I feel like I can even see this slightly concave path taken by the end effector in RViz (see the video below). I’m not too sure whats causing this yet… probably need to think of a way to better keep the ODrive and stepper in sync with each other.
🌗︎ : Possible Next Steps
- try current/acceleration/velocity control
- anticogging and better PI tuning for ODrive to reduce shoulder actuator jitter
- abstracted solution to transmissions that Drake accepts (Drake multibody plants do not accept transmissions in URDFs)
- motion planning and trajectory optimization
- tracing photos from paths generated by canny edge detection
- calculate ping pong ball trajectories with stereo vision (is two OpenCV SimpleBlob streams to get stereo disparity enough? RAFTStereo?)
- adding position and velocity limits. hardware side… (on the arduino and S1), or software side (in ROS2)? both?