MOTOR CONTROL NOT RUNNING #95
Replies: 3 comments 5 replies
-
here is the code, I only edited the base_controller part to suit the use with L298, the rest is kept the same as the original code. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the new code link. I've reviewed it and everything looks like it should work, so nothing obviously wrong with it in my opinion. What's strange is that your log output shows It seems that template <typename L298MotorController>
void diffbot::BaseController<L298MotorController>::write()
{
motor_cmd_left_ = motor_pid_left_.compute(wheel_cmd_velocity_left_, joint_state_left_.angular_velocity_);
motor_cmd_right_ = motor_pid_right_.compute(wheel_cmd_velocity_right_, joint_state_right_.angular_velocity_);
p_motor_controller_left_->setSpeed(motor_cmd_left_);
p_motor_controller_right_->setSpeed(motor_cmd_right_);
} Looking at your debug output, I can see:
With kp_ = 10 and proportional_ = 7.67, the PID calculation should be:
Your #define K_P 0.6 // P constant
#define K_I 0.3 // I constant
#define K_D 0.5 // D constant I'd suggest to add more logging in the
Looking forward to your new log output 😊 |
Beta Was this translation helpful? Give feedback.
-
but, I wonder, will Teensy 3.2 work well with this diffbot? If yes, why does stm32f411 often get "lost sync..." I thought it was because the stm32 hardware is much smaller than the Teensy 4.0, but in "list-parts" there are two options "Teensy 4.0 or Teensy 3.2" STM32F411CEU6 (128kb SRAM, 512kb FLASH, 100MHz) "wrong checksum for topic id..." appears on Teensy 4.0 but the system still works fine. So temporarily don't worry about it. when launching "diffbot_bringup", the first few seconds will "Emmergency STOP" until the connection to the ROS system is recognized. It will print out the "debug" parameters and the system will start working. Next is the " |
Beta Was this translation helpful? Give feedback.
-
I run with command line
roslaunch diffbot_bringup bringup.launch
then I turn 2 wheels and the encoder-ticks woking proberly.
then I
rosrun rqt_robot_steering rqt_robot_steering
and the wheel_cmd_velocities read ok, too.but the two wheels not move.
@fjp hiii... did i do something wrong or is there a mistake in the repositories code...? can you have any ideas,
thank you so much and have a nice day~ 👍 :D
Beta Was this translation helpful? Give feedback.
All reactions