ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Wheel Calibration

asked 2017-07-02 12:22:13 -0500

RandyD gravatar image

I have my first robot prototype build from scratch up and running using ROS + Arduino. :) But when i control the robot straight forward, it goes a bit sideway.

I'm using a L298N Dual H-Bridge to power the motors, which has more power input as the motors require, cause the shield seem to measure whats the max power to put on the motors. I noticed, one side of the motor shield gives more power as the other side. (10v input, left wheel 7V output, right wheel 7.7V output, motors specs 6V)

I also have an MPU6050 connected, but not fully implemented yet in the hardware interface (not publishing the IMU data yet) Will the IMU data update the joint commands received by the hardware interface if it notice the robot don't go straight or should i try to fix this in the firmware code?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2017-07-02 12:28:58 -0500

gvdhoorn gravatar image

Will the IMU data update the joint commands received by the hardware interface if it notice the robot don't go straight [..]

The ros_control diff_drive_controller you mean? not automagically, no.

or should i try to fix this in the firmware code?

That, or write a controller / node that compensates for the discrepancy.

If you have encoders I would actually recommend you implement a velocity controlled system: that would make things closed-loop and would automatically take care of any differences between the two motors.

edit flag offensive delete link more

Comments

What u mean by velocity controlled?

RandyD gravatar image RandyD  ( 2017-07-02 12:32:08 -0500 )edit

Δx/Δt: periodically check the nr of encoder counts, convert to radians and divide by sampling period. Then use that with a (pid) controller to expose a velocity controlled interface to each of your motors (ideally: wheels). 1rad/s == 1rad/s, irrespective of what your motor controller does.

gvdhoorn gravatar image gvdhoorn  ( 2017-07-02 12:40:57 -0500 )edit

That makes things closed-loop. From your description I got the impression that you're currently using an open-loop approach (ie: % PWM or something) and assuming that both motors behave the same. If you add some sensors (ie: encoders), you can make them behave the same.

gvdhoorn gravatar image gvdhoorn  ( 2017-07-02 12:44:44 -0500 )edit

yes, i convert the joint command in the hardware interface to PWM on the Arduino and update the joint position/velocity from the encoders https://github.com/DeborggraeveR/ampr... will do some reading about velocity controlled and see what i need to change

RandyD gravatar image RandyD  ( 2017-07-02 12:49:46 -0500 )edit

The velocity control would be done on the arduino-side, probably / preferably. If you don't already have it, you would probably have to run some control loop on the Arduino that checks desired velocity against effective. Then PD control that.

gvdhoorn gravatar image gvdhoorn  ( 2017-07-02 12:53:39 -0500 )edit

Question Tools

Stats

Asked: 2017-07-02 12:22:13 -0500

Seen: 538 times

Last updated: Jul 02 '17