Segway RMP 50XL Odometry value problem

RMP 50, 50XL, 100, 200, 400
User avatar
phussey
Posts: 79
Joined: Fri Apr 20, 2012 8:12 am
Contact:

Re: Segway RMP 50XL Odometry value problem

Post by phussey » Tue Sep 18, 2012 4:37 pm

Hi Akin,

I will post it on the forum when I get in tomorrow morning.
PATRICK HUSSEY
Principal Engineer

STANLEY INNOVATION, INC
www.stanleyinnovation.com

User avatar
phussey
Posts: 79
Joined: Fri Apr 20, 2012 8:12 am
Contact:

Re: Segway RMP 50XL Odometry value problem

Post by phussey » Tue Sep 25, 2012 9:12 am

Hi Akin,

I am trying to upload the demo but there is a problem with the forum server permissions. We are attempting to get it fixed, I should be able to post it today. Sorry for the delay.
PATRICK HUSSEY
Principal Engineer

STANLEY INNOVATION, INC
www.stanleyinnovation.com

Akin
Posts: 24
Joined: Mon Aug 13, 2012 12:21 pm
Contact:

Re: Segway RMP 50XL Odometry value problem

Post by Akin » Thu Sep 27, 2012 9:33 pm

Did you manage to upload it? I don't see it in this thread, but maybe the files are somewhere else in the forum.

Akin
Posts: 24
Joined: Mon Aug 13, 2012 12:21 pm
Contact:

Re: Segway RMP 50XL Odometry value problem

Post by Akin » Wed Oct 03, 2012 7:42 pm

Hi Patrick,

I checked the code. The conversion value for the integrated forward position in the code (3085.92counts/m) does not match to the documentation (33216 counts/m); and neither of them matches to the reality which is ~15000.

For the Integrated Turn Position the code and the docs have the same values but again not the correct value.

For the odometry I think I will just multiply the values that I've found by running the robot on a straight line and turning around itself.

I have 2 small questions to close the topic:

1- What is the unit of the velocity command that I need to provide to the platform? Do I need to provide the speed as m/s or counts/s. The docs says 147cnts/mph in the interpretation coulumn with no further explanation.

2- When I tell the robot to turn around itself with no linear velocity, after 4-5 turns I see that its position is changed by ~10cm. Is this behavior normal and common on segways?

Thanks

Akin
Posts: 24
Joined: Mon Aug 13, 2012 12:21 pm
Contact:

Re: Segway RMP 50XL Odometry value problem

Post by Akin » Thu Oct 04, 2012 7:45 pm

Following up my previous post.

About the odometry:
I made the platform go forward one wheel turn.

The number of counts that it ran are: Left: 23880 and Right: 24632. The platform moved 1.46m, which makes 16356.16 counts/m
The Documentation says that it should be 33216 cnts/m
The latest demo code says that it should be 3085.92758778538392 cnts/m

About the speed:

The doc indicates to send a value between -1024 and 1024 with header 0x0413 to the platformfor the rotation. The graph on the following page indicates a maximum angular velocity of 3.14rad/s when the platform is stationary. By sending the platform 1024/10 the platforms move at 1.08rad/s rather than the expected 0.31415.

edit:

It seems that the relationship between given command and wheel velocities is not linear. I have given 4 different linear velocity command values and measured the reported counts/s. Here are what I got:

Command: 75 Wheel vel: 3560.51 counts/s
Command: 150 Wheel vel: 7491.38 counts/s
Command: 300 Wheel vel: 23786.91 counts/s
Command: 600 Wheel vel: 59162.60 counts/s

Is there an input-output equation that is not listed in the docs?

I wonder if there is a problem with my platform or its encoders....

User avatar
phussey
Posts: 79
Joined: Fri Apr 20, 2012 8:12 am
Contact:

Re: Segway RMP 50XL Odometry value problem

Post by phussey » Tue Oct 09, 2012 11:03 am

Hi Akin,

About the odometry:
I made the platform go forward one wheel turn.

The number of counts that it ran are: Left: 23880 and Right: 24632. The platform moved 1.46m, which makes 16356.16 counts/m
The Documentation says that it should be 33216 cnts/m
The latest demo code says that it should be 3085.92758778538392 cnts/m

Sorry the demo code conversion was wrong. There was a an unused #define in the code that gave the conversion from counts to ft and I mistakenly used that. I updated the conversion factor and ran your same test (commanding 1 wheel revolution (1.45229m) and verifying the wheel infact turned 1 revolution and reported ~49698 cnts for the linear travel)

The conversion factor should be 34220.578.
The doc indicates to send a value between -1024 and 1024 with header 0x0413 to the platform for the rotation. The graph on the following page indicates a maximum angular velocity of 3.14rad/s when the platform is stationary. By sending the platform 1024/10 the platforms move at 1.08rad/s rather than the expected 0.31415.
I am not sure what documentation you have but the yaw rate command is calculated as

#define DIFFERENTIAL_WHEEL_COUNTS_PER_RAD_PER_SEC (179.286858159557)
#define YAW_RATE_LIMIT_RAD_PER_SEC_F (3.14)
#define YAW_RATE_LIMIT (YAW_RATE_LIMIT_RAD_PER_SEC_F * DIFFERENTIAL_WHEEL_COUNTS_PER_RAD_PER_SEC ) // = 562.96;

so the command would then be:
float yaw_cmd_f = 0.0;
float yaw_cmd_scale =0.0;
float yaw_limit_sf = 12.0; (this value gets initialized to 12 on the platform so 75% max yaw rate)
short yaw_cmd =0;

yaw_cmd_f = 0.5; //-1.0...1.0 this comes from your input;
yaw_cmd_scale = (YAW_RATE_LIMIT * (yaw_limit_sf / 16.0));
yaw_cmd_f *= yaw_cmd_scale;
yaw_cmd = (short) yaw_cmd_f;

all of this was in the demo I posted in the function OnTimer(TIMER_ID_JOYSTICK). For implementation of the input mapping see the function turn_cmd_to_diff_wheel_cnts in the demo.
It seems that the relationship between given command and wheel velocities is not linear. I have given 4 different linear velocity command values and measured the reported counts/s. Here are what I got:

Command: 75 Wheel vel: 3560.51 counts/s
Command: 150 Wheel vel: 7491.38 counts/s
Command: 300 Wheel vel: 23786.91 counts/s
Command: 600 Wheel vel: 59162.60 counts/s

Is there an input-output equation that is not listed in the docs?
I am not sure what variable you were watching. If you watch the wheel velocity variables (id:0x402 LW Velocity and RW Velocity (slot 0 and 1)) you should see the output match the command:

#define WHEEL_COUNTS_PER_METER_PER_SEC (332.166481073751)
#define VEL_LIMIT_METER_PER_SEC_F (3.576)
#define VEL_LIMIT (VEL_LIMIT_METER_PER_SEC_F * WHEEL_COUNTS_PER_METER_PER_SEC ) //= 1187.83;

so the command would then be:
float vel_cmd_f = 0.0;
float vel_cmd_scale =0.0;
float vel_limit_sf = 12.0; (this value gets initialized to 12 on the platform so 75% max vel)
short vel_cmd =0;

vel_cmd_f = 0.5; //-1.0...1.0 this comes from your input;
vel_cmd_scale = (VEL_LIMIT * (vel_limit_sf / 16.0));
vel_cmd_f *= vel_cmd_scale;
vel_cmd = (short) vel_cmd_f;


so repeating your test using:

wheel_vel_cnts = (left_wheel_vel+right_wheel_vel) / 2;
The command matches the wheel velocity with some error (it is a closed loop control system it will not match exactly).
I wonder if there is a problem with my platform or its encoders....
There are many layers of fault detection to catch faulty hall sensors. Your machine will not run if there is something wrong with the motor hall sesnor feedback. It seems likely that you are not interpreting the data and commanding the machine appropriately. I have attached the demo with corrected values. I have also verified all the feedback with physical experiments.
You do not have the required permissions to view the files attached to this post.
PATRICK HUSSEY
Principal Engineer

STANLEY INNOVATION, INC
www.stanleyinnovation.com

Akin
Posts: 24
Joined: Mon Aug 13, 2012 12:21 pm
Contact:

Re: Segway RMP 50XL Odometry value problem

Post by Akin » Tue Oct 09, 2012 9:16 pm

Thank you for the answer Patrick.
Sorry the demo code conversion was wrong. There was a an unused #define in the code that gave the conversion from counts to ft and I mistakenly used that. I updated the conversion factor and ran your same test (commanding 1 wheel revolution (1.45229m) and verifying the wheel infact turned 1 revolution and reported ~49698 cnts for the linear travel)
With one right wheel turn here is the content of the package 0x0403. It is a serial connection. And the packages are USB packages.

0xF0 0x55 0xAA 0x3F 0x80 0x60 0xFE 0x8F 0x08 0x60 0x37 0x00 0x00 0x60 0x8B 0x00 0x00 0xD5

Page 14 of User Interface Guide v2.2 tells me to parse this package this way:

Byte 0 - Value: 0xF0 - (Start Byte) ---- OK
Byte 1 - Value: 0x55 - (Can Identifier) ---- OK
Byte 2 - Value: Ignore on read ---- Skipped
Byte 3 - Value: Ignore on read ---- Skipped
Byte 4 and 5 Can Message Header High+Low 11 bits valid ----- 0x8060 ignore last 5 bits ---> 0x403 OK
Byte 6 and 7 For send command ---- Skipped
Byte 8 Ignore ----- OK
Byte 9-16 The data
Byte 17 Checksum --- OK it matches.

For 0x403 Byte 13-16 is the integrated right wheel displacement --> 0x60 0x8B 0x00 0x00

With low and high the order becomes Byte 15 Byte 16 Byte 13 Byte 14 ---> 0X0000608B = 24715 counts

So I get a very different number then yours :-/

I don't know what is inside the canlib library in the demo program since it's a closed source library.

User avatar
phussey
Posts: 79
Joined: Fri Apr 20, 2012 8:12 am
Contact:

Re: Segway RMP 50XL Odometry value problem

Post by phussey » Wed Oct 10, 2012 9:33 am

It looks like you are parsing it correctly as far as I can tell. I have attached a version of the old demo that supports USB. An important note is that the FTDI driver in the old architecture systems are not supported beyond windows XP, there are known issues with VISTA and 7 compatibility. That being said I assume you are using XP.

Could you please perform the following test:

1. put the RMP on a stand (wheels off the floor)
2. place a marker (like a piece of tape) on the wheel and some reference point (to measure one revolution)
3. connect USB to the platform
4. power the RMP on
6. open the rmi_demo.exe program
5. in the Vel Cmd (cnts) window in the bottom right corner type 100
6. when the wheel has gone 1 full revolution type 0
7. record the values for integrated left, right, and for/aft travel.
8. take a screen shot, post it and the values recorded

If you are still having a problem there may be something else going wrong with the machine. I will have Chris contact you to either send the machine up or discuss the possibility of upgrading your machine to the new system architecture (which I would recommend).
You do not have the required permissions to view the files attached to this post.
PATRICK HUSSEY
Principal Engineer

STANLEY INNOVATION, INC
www.stanleyinnovation.com

Akin
Posts: 24
Joined: Mon Aug 13, 2012 12:21 pm
Contact:

Re: Segway RMP 50XL Odometry value problem

Post by Akin » Wed Oct 10, 2012 2:28 pm

Ok I run the demo program and did what you said. After one complete wheel turn, the values are following:

Int left: 24636
Int Right: 24886
Fore/Aft Dist: 24620
Int Yaw Pos: 0.694

I also attached the screenshot.

I guess at this point I should contact Chris and send you the machine....
You do not have the required permissions to view the files attached to this post.

User avatar
phussey
Posts: 79
Joined: Fri Apr 20, 2012 8:12 am
Contact:

Re: Segway RMP 50XL Odometry value problem

Post by phussey » Wed Oct 10, 2012 5:58 pm

Hi Akin,

Yes there must be something else going on. I will talk to Chris tomorrow morning a figure out what the options are.
PATRICK HUSSEY
Principal Engineer

STANLEY INNOVATION, INC
www.stanleyinnovation.com

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest