Hi all,
Most of you guys can probably do this in your sleep, so please bear with me. I'm working on a project in which I want to control an Azimuth/Elevation mount with a NXT. I want to be able to supply it with a list of co-ordinates like:
Time / Az / El
0 / 1 / 1
1 / 1.5 / 1.1
2 / 1.9 / 1.2
3 / 2.2 / 1.25
4 / 2.4 / 1.2
5 / 2.5 / 1.1
etc
The units of time could be anything - seconds, 10ths of seconds, minutes, etc
The units for Az and El will be motor rotations (from origin)
I would like the motion to be as smooth as possible, so at the end of each segment I want to not stop the motor if it needs to keep moving to the next point. And I want it to hit each point as accurately as possible. Does anyone have an algorithm that could do something like this?
Thanks
ROSCO
Azimuth / Elevation control
-
- Posts: 346
- Joined: 27 Sep 2010, 03:05
- Contact:
Re: Azimuth / Elevation control
I assume you want the "time" intervals to be consistent. Meaning the time to move between 0 and 1 is the same as the time from 4 to 5, even though from 0 to 1 the distance is .5, while 4 to 5 the distance is .1, right?
I think the first key is to use the "motor block" and turn on "Control: motor power". This will force the NXT to move the motor at the correct power level to move the motor at the desired speed.
Second, you want to move the motor some number of degrees (or rotations) per second. So the power will be proportional to the distance.
step 1: az=.5 rot/sec; el=.1 rot/sec
step 2: az=.4 rot/sec; el=.1 rot/sec
step 5: az=.1 rot/sec; el=-.1 rot/sec
Assuming .5 rot/sec is the maximum value, that should be set to a power of 100, and .0 rot/sec = 0, so .1 rot/sec = 20% power.
Get it?
Steve
I think the first key is to use the "motor block" and turn on "Control: motor power". This will force the NXT to move the motor at the correct power level to move the motor at the desired speed.
Second, you want to move the motor some number of degrees (or rotations) per second. So the power will be proportional to the distance.
step 1: az=.5 rot/sec; el=.1 rot/sec
step 2: az=.4 rot/sec; el=.1 rot/sec
step 5: az=.1 rot/sec; el=-.1 rot/sec
Assuming .5 rot/sec is the maximum value, that should be set to a power of 100, and .0 rot/sec = 0, so .1 rot/sec = 20% power.
Get it?
Steve
---> Link to lots of MINDSTORMS stuff under my picture --->
Re: Azimuth / Elevation control
Thanks Steve, yes the time intervals will all be equal.
How do I set (for example) .5 rot/sec as power 100? (Noting that perhaps in my next run, the max may be .8 rot/sec).
ROSCO
How do I set (for example) .5 rot/sec as power 100? (Noting that perhaps in my next run, the max may be .8 rot/sec).
ROSCO
-
- Posts: 346
- Joined: 27 Sep 2010, 03:05
- Contact:
Re: Azimuth / Elevation control
Good question. Somewhere, you have to decide what the maximum speed will be, and scale everything from there. I would see two ways to do that. One method would be to pick the maximum distance you'll EVER need to travel, and set that as your max power; so if you may travel 1.0 rot/sec, that has to be your max (100).roscohead wrote:How do I set (for example) .5 rot/sec as power 100? (Noting that perhaps in my next run, the max may be .8 rot/sec).
Another would be to scan the data, and find the max value (ie: .8 or .5 or 1.0) and set that as your max.
Steve
---> Link to lots of MINDSTORMS stuff under my picture --->
Re: Azimuth / Elevation control
Sounds like you need the new speed/ acceleration control in the latest firmware. See https://sourceforge.net/apps/phpbb/mind ... =pid#p7314 and elsewhere in these forums.
This enables you to monitor the speed of rotation and continually change it to get a smooth result.
This enables you to monitor the speed of rotation and continually change it to get a smooth result.
A sophistical rhetorician, inebriated with the exuberance of his own verbosity, and gifted with an egotistical imagination that can at all times command an interminable and inconsistent series of arguments to malign an opponent and to glorify himself.
Re: Azimuth / Elevation control
They look interesting, but the doco is a bit lean. Am I able to specify an actual speed, in rotations / sec, or degrees / ms or whatever? I can't find any info about that?
Thanks
ROSCO
Thanks
ROSCO
Who is online
Users browsing this forum: No registered users and 2 guests