|
[DPRG] Absolute reference for angular position
Subject: [DPRG] Absolute reference for angular position
From: Jeffry Sampson
jsampson at cray.com
Date: Wed May 28 15:24:39 CDT 2008
> -----Original Message-----
> From: dprglist-bounces at dprg.org [mailto:dprglist-bounces at dprg.org] On Behalf Of dpa
> Sent: Wednesday, May 28, 2008 2:29 PM
> To: dprglist at dprg.org
> Subject: [DPRG] Absolute reference for angular position
>
> Howdy
>
> Jeff wrote:
> > I was following what dpa (if I may use dpa instead of Doctor David
> > Anderson) was saying about odometry and calibration. I thought that I
> > have a perfectly good robot sitting here collecting dust and I could
> > run these calibrations. But when I got to the statement that "now you
> > drive in a square" I got totally lost. I thought that turning precisely
> > 90 degrees is a whole 'nother problem. Afer I thought about it for
> > awhile I realized it meant to turn 90 degrees based on the resultant
> > odometry.
>
> Sorry if that wasn't explained very clearly, but basically yes.
[...]
No, it was explained very well. It is just that when I got to the statement "now drive in a square" it threw me.
I turn by knowing how many counts per degree it will take. So I immediately assumed that I had to have a calibrated counts per degree before I could make this work. Then I finally realized that a "square" or any other pattern is based on the same heading that is being extracted from the odometry. Therefore I don't actually need to have the "extra" counts per degree that I treated as sacred.
So during calibration I need to have a routine that has new heading as the input. The routine compares current (calculated from the odometry) heading to the new requested heading and rotates the robot in the correct direction. And in reality I can use the same method all of the time, not just during calibration.
I was thinking about this over the weekend as I was driving. It occurred to me that I need to slew-rate limit my turns. So if I am heading 0 degrees and request 90 degrees, I need to be able to control the turn. So I was thinking of just adding to an intermediate heading that gets updated each servo cycle. So if the turn rate is 5 degrees per servo tick then I just add 5 degrees to the intermediate value until it matches the requested value.
But it occurred that is getting close to the way my main drive motors work with the PID/velocity/trajectory control. So I may just make this work like my other motors. But instead of encoder input I will have heading input. And instead of creating a PWM for the motors it will output a rotation command that feeds into the main motor drive.
But to back up, it seems to me that to get good calibration that you would have to have the robot do the driving. But maybe I will believe differently after trying some experiments. :-)
> > My biggest concern about using odemetry for rotation is backlash in my
> > gear train. I still have to address that issue.
>
> Jeff, I've not really found that to be a problem for odometry.
> It must be that it averages out. The two-wheel balancing robot
> nBot had to have a back-lash correction, but that's because the
> motors go back and forth through zero when trying to balance
> and the backlash was interpreted by the balance algorithm as
> a jerk of the robot. I haven't found the need to do that
> correction for odometry.
It just seemed like I have a lot of backlash. I couldn't decide if the backlash would accumulate or just average out. When I get ready to try this I will specifically watch for backlash effects. I was even considering adding encoders directly to my wheels as a way to indentify the backlash during testing.
I'll let you know how it turns out.
BTW, here is an image of my odometry results without a lot of calibration:
http://www.sampson-jeff.com/r3/firstlook.htm
I have some better looking results but that is the only one handy. In reality this is calibrated after the fact. I recorded the data as I drive the robot with a joystick. Then later tweaked the numbers (counts/inch, wheelbase) to get it to line up. This rectangle is about 65' x 40'. The blue line is the current position from the odometry. The red and brown spots are sonar returns from the walls. It was off by several feet when I got back to the starting point. But it looks promising.
--
Jeff Sampson
More information about the DPRG mailing list
|