|
|
|
Forum Member
      
Group: Forum Members
Last Login: Wednesday, September 24, 2008 4:05 PM
Posts: 35,
Visits: 142
|
|
Hi Jason,
I've checked the .Net documentation on the PID controller interface and it's not clear to me if I can get the distance traveled between any two points in time. In other words, suppose I command my robot to move 48 inches but part way through it has to stop because of an obstacle. I'd like to be able to read off how far it traveled before stopping. If I were doing it at the firmware level I could clear the encoder counters then read off their values when the robot stopped.
Thanks!
patrick
|
|
|
|
|
Forum Member
      
Group: Forum Members
Last Login: Thursday, June 26, 2008 11:27 PM
Posts: 30,
Visits: 306
|
|
| Hi I did a lot of tests with PID.I think if you stop PID with cmd stop or other, you can querry the counter value and convert ticks to inch(the counter is reset only if you send a new pid cmd "i think"). Regards Arnaud
|
|
|
|
|
Supreme Being
      
Group: Administrators
Last Login: Today @ 6:22 AM
Posts: 277,
Visits: 407
|
|
| Patrick, As soon as you issue a PID command, the encoder values are reset. So, you can simply create two WheelEncoder objects, set their Resolution and WheelDiameter properties, and query their value as soon as you stop the robot to obtain distance. Best Regards,
Jason Summerour President, Summerour Robotics Corporation Microsoft MVP www.roboticsconnection.com
|
|
|
|
|
Forum Member
      
Group: Forum Members
Last Login: Wednesday, September 24, 2008 4:05 PM
Posts: 35,
Visits: 142
|
|
Thanks Arnaud and Jason! I don't know how I missed the WheelEncoder object--didn't think to look in the Sensors section of the docs instead of the PID section, though it makes sense that's where they should be. Now I am all set.
--patrick
|
|
|
|
|
Forum Member
      
Group: Forum Members
Last Login: Wednesday, September 24, 2008 4:05 PM
Posts: 35,
Visits: 142
|
|
Hi Jason,
I may have found a glitch in the WheelEncoder object. The Resolution property is typed as a byte which is too small to hold the resolution of the encoders I am using (US Digital encoders that mount to a Lynxmotion gearhead motor). The resolution for these encoders is something like 6250 ticks per revolution which won't fit into a byte. Even the 624-pulse resolution of the Traxster motors won't fit into the byte value. By contrast, the PIDMotorController Resolution property is typed as an int and so I don't have the same problem there.
Thanks!
patrick
|
|
|
|
|
Forum Member
      
Group: Forum Members
Last Login: Thursday, June 26, 2008 11:27 PM
Posts: 30,
Visits: 306
|
|
| Hi, I have same problem with WheelEncoder. I'm interested by this resolution and it is true when we use PID we don't have problem with encoder resolution!!! Regards Arnaud
|
|
|
|
|
Supreme Being
      
Group: Administrators
Last Login: Today @ 6:22 AM
Posts: 277,
Visits: 407
|
|
| Hey guys, Sorry for the delay...I've been taking a few needed vacation days. I'll get that fixed in the lib, and released by this weekend. Best Regards!
Jason Summerour President, Summerour Robotics Corporation Microsoft MVP www.roboticsconnection.com
|
|
|
|
|
Supreme Being
      
Group: Administrators
Last Login: Today @ 6:22 AM
Posts: 277,
Visits: 407
|
|
|
|
|
| | |