LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Approach to keep a robot driving in the middle?

I have a left and right distance with respect to the wall. I drive a fixed linear velocity forwards. Now I want to keep the robot in the middle of the the walls. However I can only apply a angular velocity. How the robot works physically is a blackbox

 

What I have:

  • Distance to the left wall
  • Distance to the right wall
  • Fixed linear velocity forwards

What I need

  • Angular velocity

What I want

  • Get the robot to drive in the middle

So what I done now is the following,

I compute the error = distance_left - distance_right, since I want the difference to be zero. I then use a PID controller. From the PID I retrieve a certain effort. Since the mapping from the difference in distance (the error) to the angle is a blackbox, I interpret the effort as the angle we want to drive. However since I need to give a angular velocity rather then a angular position I compute the derivative to retrieve the angular velocity.

 

I'm wondering two things, is it correct what I am doing? Secondly is there maybe a better aproach, since this one does not seem to work very well (proberbly because it is also hard to tune the PID gains correctly plus the noise which is caused by computing the derivative)?

0 Kudos
Message 1 of 2
(2,300 Views)

Hello WG,

 

How did you retrieve your PID-parameters?

Did you test your code in a simulated environment?

 

Can you share any of your current LabVIEW code?

How do you communicate with the robot (wi-fi?) or is your code running on the robot itself?

Or in other words: what kind of robot are you using?

 

When playing around with control algorythms, it can be useful to first start with simple P-controller.

This will allow you to see and tune what the link should be between your effort and the wanted angular velocity.

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 2 of 2
(2,260 Views)