View unanswered posts | View active topics It is currently Mon Sep 28, 2020 2:44 pm






Reply to topic  [ 20 posts ]  Go to page 1, 2  Next
Motor Power 
Author Message
Rookie

Joined: Thu Mar 01, 2007 12:49 pm
Posts: 11
Post Motor Power
Hi, I'm using RobotC and I'm really loving it

I have a simple question:
How can I access the PID value to check the power sent to the motors?
Thanks!


Last edited by zionbabbo on Sun Mar 18, 2007 12:32 pm, edited 1 time in total.



Mon Mar 12, 2007 12:02 pm
Profile
Rookie

Joined: Thu Mar 01, 2007 12:49 pm
Posts: 11
Post 
yuh-uuuuh...

Is anybody ou there?


Wed Mar 14, 2007 11:12 am
Profile
Site Admin
Site Admin

Joined: Wed Jan 24, 2007 10:44 am
Posts: 442
Location: Pittsburgh, PA
Post 
zionbabbo wrote:
yuh-uuuuh...

Is anybody ou there?


Do you mean to just view them? If you compile and download the program, then open up the "devices" debugger window, you should be able to view the PID value. Does that help?

_________________
Vu Nguyen
Software Training Development Team | Webmaster
Need more support? Email ROBOTC Support at support@robotc.net to put in a support ticket

Robotc.net| Robomatter Store | Robotics Academy | CS2N


Wed Mar 14, 2007 1:40 pm
Profile
Rookie

Joined: Thu Mar 01, 2007 12:49 pm
Posts: 11
Post 
Quote:
Do you mean to just view them?


Thanks, but I mean to use the value in the program. It would be great to check if the motors are finding resistence in theyr rotating movement. In fact, in such situation the PID value increases.

Now I resolved by checking if the motrors are blocked by comparing the last values of encoders. But by this way, you can see the problem only when motors are completely blocked, so the robot has to sustain strong forces befor to know that something is working against its motion.

Anyway, such PID values are displayed in the "Poll Brick" window, I think it is possible to check these values also in the program.

Thanks again!


Thu Mar 15, 2007 4:15 am
Profile
Rookie

Joined: Thu Mar 01, 2007 12:49 pm
Posts: 11
Post 
I'm still trying...
The PID values showed in the Poll Brick window must be possible to read with some function...

I tried, with no luck :?, reading the values of:

tMotorPowerDirection;
tMotorDirection;
motorPowerSigned[motorB];
kNumbOfTotalMotors;
nMotorPIDSpeedCtrl[motorB];
mtrSpeedReg;
nMotorEncoder[motorB];
nMaxRegulatedSpeed;
nPidUpdateInterval;
tMotor;
tMotorControl;
TMotorRegulation;
TMotorState;
tMotors;
motorBrake;
motorFloat;
motorForward;
motorFlip;
motorReverse;
motorState[motorB];

Please, does anyone know how to access to the exact value of the power sent to motors? :( :(


Sun Mar 18, 2007 7:24 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Jan 31, 2007 3:39 am
Posts: 299
Location: San Diego, California. USA
Post 
I just realized what your trying to do, I don't think there is a command to read the power consumption, but it is possible. Guy Ziv did it using the NXT-G block code if this helps at all. To see it here is the link from Nxtasy.org

http://nxtasy.org/2007/03/18/motor-powe ... t-g-block/

I think that would be an awesome command to add to RobotC. You will be able to detect motor stall or motor work without having to take constant encoder samples and seeing how far it has moved in a few milliseconds.

My idea of the new command:

CheckMotorPower[motorA] = __ ;
CheckMotorPower[motorC] = __ ;

What go you guys think?

_________________
Mmmm Legos B-)

My Robot Projects:
http://www.freewebs.com/robotprojects/


Mon Mar 19, 2007 4:17 pm
Profile WWW
Rookie

Joined: Thu Mar 01, 2007 12:49 pm
Posts: 11
Post 
Quote:
Guy Ziv did it using the NXT-G block code if this helps at all.

I saw what he did. It is exactly what I was looking for in the last 3-4 days.
I'm sure it is not only possible, but also easy. Robotc is able to show you the speed the PID is trying to reach to maintain desired velocity. I just want to read this value, because it contain all the information needed to implement a control on the motor status better than the encodercheck one!

Thanks for you support. Tell me if you have some idea on what to try to do it...[/quote]


Mon Mar 19, 2007 6:31 pm
Profile
Site Admin
Site Admin

Joined: Wed Jan 24, 2007 10:42 am
Posts: 620
Post 
Sorry about the delays in response.

As of right now, there is no function to reference the PID values. You can read the motor encoders, but that isn't what you want.

I'm sure this is possible, we just never added the functionality. Look for it in the next update as a function.

_________________
Timothy Friez
ROBOTC Developer - SW Engineer
tfriez@robotc.net


Tue Mar 20, 2007 3:50 pm
Profile
Rookie

Joined: Thu Mar 01, 2007 12:49 pm
Posts: 11
Post 
ok, I will wait :D

thanks for all!


Tue Mar 20, 2007 6:59 pm
Profile
Rookie

Joined: Sat Apr 12, 2008 10:43 am
Posts: 2
Post acces PID value
Hi
Is there any chance to read a PID value of the power sent to a motor?
i didn't find any integrated function for doing this...
Thanks


Sat Apr 12, 2008 11:00 am
Profile
Rookie

Joined: Sun Mar 29, 2009 7:34 am
Posts: 1
Post Re: Motor Power
Hello,
Is this feature implemented yet? (it been 2 years since this was requested :D )
I have same problem I need to know if any thing is in the way of the wheals (slowing it down) is there any possibility of reading PID value with robotc (or using assembly) the debugger already shows pid value, there has to be a way to read it.
thanx in advance


Mon Apr 13, 2009 3:55 am
Profile
Guru
User avatar

Joined: Sat Mar 01, 2008 12:52 pm
Posts: 1030
Post Re: Motor Power
be patient, or they will ban you! ;)

_________________
regards,
HaWe aka Ford
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;task main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PutPixel(x,y);}}}while(1)}


Mon Apr 13, 2009 6:46 am
Profile
Rookie

Joined: Fri May 21, 2010 9:12 am
Posts: 1
Post Re: Motor Power
I'd like to add my voice to those requesting a feature to discover motor power. I've just downloaded version 2 for NXT with high hopes but I still can't see anything like this mentioned in the manual.

In my application I have a line-following robot that can encounter ramps, bumps and other obstacles. Checking motor power is obviously the right way to detect this.


Fri May 21, 2010 9:26 am
Profile
Site Admin
Site Admin
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3654
Location: Rotterdam, The Netherlands
Post Re: Motor Power
Jaa,

Send a mail to support@robotc.net to ask for this feature to be exposed with a call.

Regards,
Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Fri May 21, 2010 9:59 am
Profile WWW
Expert

Joined: Mon Mar 15, 2010 4:24 pm
Posts: 124
Post Re: Motor Power
Or you can write your own PID controller, like I did. Then you have control of *everything*. :D

Maybe some day when I'm happy with its performance (I'm still experimenting with it), I'll put the code in the public domain. One of the really cool features is the ability to output all of the various parameters in real time for import into Excel for graphing.

cu,
Gary


Fri May 21, 2010 7:24 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 20 posts ]  Go to page 1, 2  Next

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.