ros-ukraine/leobot

STM32 and motor velocity control integration

Opened this issue · 6 comments

Implement ability of STM32 micro-controller to set desired velocity to motor using encoder.

I propose to use this library for PID: https://github.com/tcleg/PID_Controller

@nemo8 look fine with me. Please make sure that PID parameters are read from ROS parameters server. Also they should be available for tuning using dynamic reconfigure feature http://wiki.ros.org/dynamic_reconfigure or similar approach. Idea is to tune everything in ROS not on micro-controller level :) Some discussion on dynamic reconfigure here https://answers.ros.org/question/270131/how-to-search-ros-parameters-from-arduino/

Idea is to tune everything in ROS not on micro-controller level :)

If we will use PID in ROS it is nice! It will make my job on MCU side simpler :)

PID would be on MCU side but tuning should be read from ROS parameters. Although it really depends on input signal type E.g. if you have input as PWM duty cycle value and output is wheel velocity from encoder you could use ROS controller effort_controllers/joint_velocity_controller which has ROS PID values and no need to MCU PID controller. I have tried to do it here with Arduino https://github.com/AndriyPt/rosserial-arduino-examples/blob/kinetic-devel/first_control/config/hardware/first_control.yml#L5-L12

It is not a problem, instead const we just need to use variables and fill in values from ROS via rosserial.