Java RoboJDE & Java Project: Smoothing Robot Motion

AI Thread Summary
The discussion centers on optimizing the movement of a robot using RoboJDE and Java to track a color swatch. The robot's movement is currently based on the centroid's position and the size of the swatch detected by the camera, with the goal of achieving smooth motion. The initial approach involves using while loops to control movement based on changes in position and pixel count. However, concerns are raised about the sensitivity of the current control method to measurement noise, which results in jerky movements. Suggestions include implementing a control mechanism that accounts for velocity and noise, such as a phase plane controller with deadbands, and coordinating forward/backward and left/right movements simultaneously to enhance smoothness and responsiveness.
glid02
Messages
54
Reaction score
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
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.
 
Thread 'Is this public key encryption?'
I've tried to intuit public key encryption but never quite managed. But this seems to wrap it up in a bow. This seems to be a very elegant way of transmitting a message publicly that only the sender and receiver can decipher. Is this how PKE works? No, it cant be. In the above case, the requester knows the target's "secret" key - because they have his ID, and therefore knows his birthdate.
Thread 'Project Documentation'
Trying to package up a small bank account manager project that I have been tempering on for a while. One that is certainly worth something to me. Although I have created methods to whip up quick documents with all fields and properties. I would like something better to reference in order to express the mechanical functions. It is unclear to me about any standardized format for code documentation that exists. I have tried object orientated diagrams with shapes to try and express the...

Similar threads

Replies
2
Views
2K
Replies
1
Views
2K
Replies
2
Views
3K
Replies
4
Views
2K
Replies
2
Views
2K
Replies
1
Views
3K
Replies
1
Views
2K
Back
Top