RoboJDE & Java Project: Smoothing Robot Motion

In summary, the conversation discusses a project involving programming a robot to move in response to changes in a color swatch's position. The current code provided is not ideal as it is too sensitive to measurement noise and results in jerky movements. The individual is seeking ideas for a smoother and more efficient control algorithm, which may involve controlling motion in both forward/backward and left/right directions simultaneously and considering velocity and noise in the design.
  • #1
glid02
54
0
Hey, I'm working on a project with RoboJDE and java and I have a few quick questions.

What I'm supposed to do is write code so that the camera will find the coordinates of a swatch of color and move accordingly as the swatch changes positions. The robot is supposed to move from side to side and forward and backward as smoothly as possible.

I've already been provided with the code necessary to move the robot and find the centroid. Basically when the centroid moves to the left or right the robot moves accordingly and when the swatch occupies more pixels on the camera the robot moves backward and when the swatch occupies less pixels the robot moves forward.

Now I'm just trying to figure out the best way to code the commands so the robot moves as smooth as possible.

The best idea I've come up with so far is a series of while loops.

I'd save the original position of the centroid of the swatch and do:
while (new position > old position)
move to the right

and

while(current no. of pixels > original no. of pixels )
move backwards

Is this sound? Any ideas are more than welcome.

Thanks.
 
Technology news on Phys.org
  • #2
This is not a very good controller.
  • It is too sensitive to measurement noise. Your measurement of the centroid and size of the patch is inherently noisy. No besmirching of how you are accomplishing this as all measurements are inherently noisy.
  • It is not 'smooth'. Your control algorithm needs to account for velocity in some way to make it smooth.
  • It is rather jerky. Suppose the target is moving forward and to the left simultaneously. Your robot will follow the patch by making a series of ninety degree turns.

Some suggestions:
  • Control forward/backward and left/right motion simultaneously.
  • Use a control mechanism that accounts for velocity and noise such as a phase plane controller with deadbands.
 
  • #3


Hi there, it sounds like you are on the right track with your approach! Using while loops to continuously adjust the robot's movements based on the changing centroid position and number of pixels is a good idea.

However, you may also want to consider using a smoother algorithm such as a PID controller. This would allow for more precise and gradual adjustments to the robot's movements, resulting in smoother motion overall.

Additionally, you could also experiment with different values for the movement increments in your while loops to find the optimal speed for the robot's movements.

Overall, it's great that you are actively trying to improve the smoothness of the robot's motion and I'm sure with some experimentation and fine-tuning, you will achieve your desired result. Good luck with your project!
 

Related to RoboJDE & Java Project: Smoothing Robot Motion

1. What is RoboJDE?

RoboJDE is a Java-based platform for developing and programming robots. It provides a set of tools and libraries to design, simulate, and control robot motion.

2. How does RoboJDE work?

RoboJDE uses a combination of Java programming language and specialized libraries to create robotic applications. It provides a graphical user interface for designing robot motion, along with the ability to test and debug code in a simulated environment.

3. What is the purpose of the Smoothing Robot Motion project?

The Smoothing Robot Motion project aims to improve the movement of robots by implementing algorithms that reduce jerky and uneven motion. This is achieved by using various smoothing techniques to calculate and control the robot's movement.

4. What are the benefits of using RoboJDE for this project?

RoboJDE offers a user-friendly and efficient way to develop and test robot motion software. It also provides access to a wide range of tools and libraries specifically designed for robotics, making it easier to implement complex algorithms and achieve smoother motion.

5. Can I contribute to the Smoothing Robot Motion project?

Yes, the Smoothing Robot Motion project is open-source and welcomes contributions from other scientists and developers. You can contribute by submitting code, reporting bugs, or suggesting improvements. More information on how to contribute can be found on the project's official website.

Similar threads

  • Programming and Computer Science
Replies
8
Views
1K
  • DIY Projects
Replies
4
Views
1K
  • Programming and Computer Science
Replies
2
Views
2K
  • Programming and Computer Science
Replies
2
Views
2K
  • Programming and Computer Science
Replies
4
Views
992
  • Programming and Computer Science
Replies
2
Views
2K
  • Programming and Computer Science
Replies
1
Views
3K
Replies
13
Views
2K
  • DIY Projects
Replies
13
Views
1K
  • Programming and Computer Science
Replies
1
Views
1K
Back
Top