![]() |
Re: Move Robot a set angle
1 Attachment(s)
I'd recommend the gyro as well. We found the provided gyro sensors to be very responsive and accurate. Easy to program too!
Using a gyro, it would be pretty easy to set up a PID loop like in the attached image. |
Re: Move Robot a set angle
Quote:
|
Re: Move Robot a set angle
What do you mean by "continuous" process variables? This should get the current gyro heading every time the loop runs and compare that to the setpoint. (And this is just a 2-minute example anyhow...)
|
Re: Move Robot a set angle
Quote:
|
Re: Move Robot a set angle
Ah, I see what you mean. I didn't say this was a perfect example, I just wanted to quickly demonstrate how one could zero in on an angle using a gyro and PID.
|
Re: Move Robot a set angle
Quote:
|
Re: Move Robot a set angle
Quote:
On the other hand, if I wanted to turn the robot to an absolute heading, I would probably...you know what, I'm not sure. All my ideas thus far would eliminate the problem of whirling in circles when going from, say, 2520 degrees to 45. But all my ideas would not fix the problem of going from 359 to 0. |
Re: Move Robot a set angle
You could use a PID loop with the x-offset in pixels as the input of the image, and have the output move the wheels.
|
Re: Move Robot a set angle
Quote:
|
Re: Move Robot a set angle
Quote:
Mod or Quotient and Remainder will collapse them into those represented in a single circle. As you noted, there are still two useful solutions to your 359 move to 0. You can move 359 degrees one direction or 1 degree the other. You usually want to select the movement with the smaller absolute value. So you need mod, and you need to consider both the positive movement and negative movement. For crab systems or turrets, there is usually a further restriction that may invalidate one of the solutions -- cables only stretch and twist by so much. I'd highly recommend you develop your input filter as a separate VI and test it for the full range of values it is to deal with. Often it is useful to plot the output versus input and sweep across the range of values at some resolution. Greg McKaskle |
Re: Move Robot a set angle
Thanks for the advice! Granted, I'm not the one who started the thread, but I hope the info is useful to people who are attempting to do this.
|
Re: Move Robot a set angle
2 Attachment(s)
Well, compwiztobe saves the day again with this awesome VI. I worked with him to get this written up; it takes a "continuous" gyro input and computes the appropriate setpoint to use in a PID loop. I've attached the VI and an example image.
|
Re: Move Robot a set angle
Quote:
|
Re: Move Robot a set angle
To add to Ether's recommendation.
I was teaching how to use encoders and applying geometry and trigonometry. One of the tasks I had them figure out is to make the robot turn a certain angle using left and right encoders. They were successful, but due to the slip-n-slide nature of your drive train, it really is by chance (aka lottery and moon phase). It was within about 10˚ of where it should have been. Of course, a better solution (as also mentioned) would be to use the included gyro. It's easy to wire (have a spare PWM Cable?), easy to program (They have an example on how to use it), and easy to use (output is already in degrees). |
Re: Move Robot a set angle
Quote:
I've got little confused before. Now I understood why what I proposed wouldn't work. Sorry. |
| All times are GMT -5. The time now is 03:55. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi