1
$\begingroup$

I’m working with a group of students trying to create a bipedal wheeled robot similar to this, and I am unsure the best way to run motor control algorithms on ROS2 (which will be running on a BeagleBone Black). The main options I am considering are using normal ROS2 nodes for PID controllers, ros2_control, or running PID controllers on a separate Arduino and receiving setpoint commands from a ROS2 node. I am unsure if latency (or anything else) would become an issue for using a normal ROS2 node for PID control, especially since self-balancing will require very responsive control. I am looking for advice on whether this will cause any issues, and if it does, how to choose between using ros2_control and running control algorithms on a separate Arduino.

Thank you in advance!

$\endgroup$

1 Answer 1

0
$\begingroup$

I assume that you need to run the control loop at least at 100Hz or even faster for such an unstable system. How do you interface your power electronics, can you connect them to the beaglebone directly or do you need the arduino?

  • In the arduino-case, you will have a slow data connection (serial port?) which will introduce additional time delay. Run your control loop on the arduino and just update the setpoints from a ROS node.
  • In the beaglebone case, I suggest using the ros2_control framework and write the controller as ros2_controller to avoid any realtime issues. Additionally, you get the possibility to test your controller in gazebo if you have an appropriate URDF model.
$\endgroup$
3
  • $\begingroup$ We should be able to interface all of our electronics through the BeagleBone (with a robotics cape), so we would only use the Arduino to run the PID controllers. In the Arduino case, we would be running the control loop on the Arduino and only updating the setpoints from a ROS node, like you mentioned. I thought this may be an effective, and potentially simpler, alternative to using ros2_control. Do you think just using ROS PID nodes (without ros2_control or an Arduino to run the controllers) would cause issues with self-balancing? $\endgroup$ Commented Sep 19 at 2:15
  • $\begingroup$ I know that ROS isn’t intended for real-time systems, but I don’t have a good sense of what it is capable of or which of the other two alternatives (ros2_control or an Arduino running control loops) would be best. $\endgroup$ Commented Sep 19 at 2:15
  • $\begingroup$ If you interface them directly from the BeagleBone, you have to write code to use it from a ROS node anyways. TBH, to write a ros2_control hardware component is only little additional work then. But you could start with a simple PID node and see how far you will come. But without additional tracing tools it will be hard to see "why" something doesn't work well if you have realtime problems. $\endgroup$ Commented Sep 19 at 7:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.