Search the web
Sign In
New User? Sign Up
Sumo11users · Sumo11 Robot Controller
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Show off your group to the world. Share a photo of your group with us.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Error Messages when downloading   Message List  
Reply | Forward Message #430 of 536 |
RE: [Sumo11users] Re: Error Messages when downloading

I believe the problem is the enable encoder inside the get_spd() routine. I recoded the program as below. Note that I converted the for(j… ) loop to a while loop to establish the sample time. More importantly I moved the enable_encoder() to the main routine and moved the data to global (for debugging purposes mostly. I have commercial encoders that produce 768 ticks per revolution and they produce reasonably consistent rates even when the sample time is .01 seconds. I also used a struct for the output so I can upload the 2 dimension array to a spreadsheet for analysis.

 

Hope that helps,

Jim

 

#define shaftencoder 1

struct encdata {float tim; float spd; float rev; int b;};

struct encdata edta[25];

 

int count, j= 0,b = 0;

float rev,delta, ft_per_sec, srtT, stT;

void main()

{

    motor(0,25);

    sleep(1.0);

    enable_encoder(shaftencoder);

    for (j=0;j<25;j++)

      {

        edta[j].spd=get_spd();

        edta[j].tim=stT;

        edta[j].rev=rev;

        edta[j].b=b;

    }

    ao();

   

}

float get_spd()

{

    reset_encoder(shaftencoder);

    stT = srtT= seconds();

    while (stT - srtT < .25) { 

        stT= seconds();

    }

    b = read_encoder(shaftencoder);

    delta = stT-srtT;           // Time Revolutions were recoreded

    rev = (float)(b)/17.; // One complete revolution equals b/17;

    return ft_per_sec = ((rev/delta))*(2.0/3.0); // ft/sec   

}

 

-----Original Message-----
From: Sumo11users@yahoogroups.com [mailto:Sumo11users@yahoogroups.com] On Behalf Of Belal Ahmad
Sent:
Friday, July 21, 2006 10:13 AM
To: Sumo11users@yahoogroups.com
Subject: RE: [Sumo11users] Re: Error Messages when downloading

 

Thanks for the explanation. Below is the first attempt...

NOTE: I varied 'j' value frm 10 to like 150 or so to see if they were any changes, but no change

 

#define shaftencoder 1
float get_spd()
{
    int count, j= 0,b = 0;
    float rev,delta, ft_per_sec, srtT, stT;
    enable_encoder(shaftencoder);
    reset_encoder(shaftencoder);
    srtT= seconds();
    while (j<10){  
        b = read_encoder(shaftencoder);
        j=j+1;
    }
    stT= seconds();
    delta = stT-srtT;           // Time Revolutions were recoreded
    rev = ((float) b)/17.0; // One complete revolution equals b/17;
    return ft_per_sec = (rev/delta)*(2.0/3.0); // ft/sec   
}

 

 

and the second time I modified to a little bit .......to

NOTE: the function is the same as above but with an exception that I am reading encoder's output multiple times and then taking the average of them for my output value.........but even this did not give a smooth constant value over time. I did one more thing here I kept the Ts constant.

 

  reset_encoder(shaftencoder);
            servo0=3500;
            bAvg=0.0;
            for (k= 1; (k< 20 ); k++){
                reset_encoder(shaftencoder);
                i=0;
                while(i<10){
                    b = read_encoder(shaftencoder);
                    i = i+1;
                    msleep(1L);
                }
                bAvg= ((float)b)+bAvg;
            }   
            //T[j]= s2-s1;
            Ts=0.03103492;
            Rev[j]=((int) (bAvg)/19);
            ftPerSec[j]= 0.75*((float)(Rev[j])/(104.0*(Ts)));

 

Let me know what you guys think. Any help is greatly appreciated...thanks in advance.



Jim Peterson <jimcp@...> wrote:

Actually I was suggesting you post to the board. What I think needs to be shown is how you are transforming the encoder counts to RPM, You need to have the time between samples, and the count delta, and then compute the RPM. If you are using IC to do the programming, the mseconds() returns milliseconds, if your loop averages 10ms the potential delta calculation will vary by 10% in actual time elapsed. The variation will be even larger if the encoder tics are more than 2ms apart.  Lets say they are 4ms between tics and our program loop is 10ms. That means some loops will count 2 tics and some 3 so you will see a 33% variation is speed calculations. These problems can be reduced if you force the rate calculation to be at some larger interval like every 100ms at the 4ms per tick rate expanding the sample interval should get  the rate calculation error down to 4%. If we get more than one tick per ms we should be able to compute to around 1% accuracy.

Hope that helps,

Jim

-----Original Message-----
From: Sumo11users@yahoogroups.com [mailto:Sumo11users@yahoogroups.com] On Behalf Of Belal Ahmad
Sent:
Thursday, July 20, 2006 8:03 PM
To: Sumo11users@yahoogroups.com
Subject: RE: [Sumo11users] Re: Error Messages when downloading

Sure, I have no problem sharing my code. Infact, I would prefer that to make sure that I am not making any mistakes.  Do you want me to sent it to this address as an attachment?

Jim Peterson <jimcp@...> wrote:

I am sure your programming is beyond reproach, everyone’s is. but would you mind sharing your actual logic for the RPM calculation with the encoders? I really suspect that is the issue. Also, you should confirm that the physical encoders are working correctly. That is mount them on an axel and verify that one revolution always produces the correct number of ticks for the resolution of the devices…

Jim

-----Original Message-----
From: Sumo11users@yahoogroups.com [mailto:Sumo11users@yahoogroups.com] On Behalf Of Belal Ahmad
Sent:
Thursday, July 13, 2006 6:02 PM
To: Sumo11users@yahoogroups.com
Subject: Re: [Sumo11users] Re: Error Messages when downloading

Thanks Dan, I appreciate your help. Please let me know if you run accross a fix for the encoder problem. It is hindering with my control system, I hope there is fix for it.

Dan Gates <topazx2@...> wrote:

Hi,
Sorry for the delayed response. Please note that the error message
has absolutly no ill effect on Sumo11 functionality and can simply be
ignored. However it is annoying and can be fixed fairly easyily by
overwriting the lib_sumo11.frm file with the one found in the files
section of this groups message brd.
There was a mixup in communication with the last release of IC, I was
told that the new version would be defined as IC 5.0 and built the
Sumo11 firmware under that assumtion. I sent my files in to be
compiled with the new release of IC and found out later that the
revision did not go to IC 5.0 but 4.301 instead. Anyway, it was
Botball season and the developers of IC did not want to make any
changes at that time, so the Sumo11 gets the error.

As for the encoder issue, I'll have to look into that some more. I do
seem to remember a similar issue I had with the Handyboard, but it was
something to do with the way I set up the encoders in my code. More on
this later.

-Dan

--- In Sumo11users@yahoogroups.com, "bxa1322003" <bxa1322003@...> wrote:
>
> Hello,
>
> Whenever I download a program, I get the following error that reads...
>
> "Please note that the version (430) of the library currently in use
> does not match the version (501) of the firmware on the controller on
> the board. This can result in undefined behavior"
>
> Is there a fix for this?
>
> Also, I have an encoder reading the rpms of dc motor, the value never
> reaches a constant value. The voltage and current of the dc motor are
> constant, but never reaches a steady-state-value. Any ideas?
>

 


Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great rates starting at 1˘/min.

 

Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2˘/min or less.

 

 


How low will we go? Check out Yahoo! Messenger’s low PC-to-Phone call rates.



Sat Jul 22, 2006 1:25 am

jcpjimcp
Offline Offline
Send Email Send Email

Forward
Message #430 of 536 |
Expand Messages Author Sort by Date

Thanks for the explanation. Below is the first attempt... NOTE: I varied 'j' value frm 10 to like 150 or so to see if they were any changes, but no change ...
Belal Ahmad
bxa1322003
Offline Send Email
Jul 21, 2006
2:14 pm

I believe the problem is the enable encoder inside the get_spd() routine. I recoded the program as below. Note that I converted the for(j… ) loop to a while...
Jim Peterson
jcpjimcp
Offline Send Email
Jul 22, 2006
1:25 am

Thanks abundance for your help. I have a few questions. What does the while loop doing? That is, stT = srtT= seconds(); //These two valuabel are equal, always...
Belal Ahmad
bxa1322003
Offline Send Email
Jul 22, 2006
1:50 am

The while has a block of code that sets stT = seconds() each time (stT – srtT <.25) is true. You read reading while as “DO Until, which would not execute...
Jim Peterson
jcpjimcp
Offline Send Email
Jul 22, 2006
4:42 pm

Just one other thing.... Thanks abundance for your help. I have a few questions. What does the while loop doing? That is, stT = srtT= seconds(); //These two...
Jim Peterson
jcpjimcp
Offline Send Email
Jul 22, 2006
10:09 pm

No, that is not what I meant,,,according to your loop.. stT - srtT = seconds() which is 0 <.25 that condition is always true...right? It will never be false. ...
Belal Ahmad
bxa1322003
Offline Send Email
Jul 24, 2006
1:10 am

The block updates stT with the current time. After .25 seconds we exit. ... From: Sumo11users@yahoogroups.com [mailto:Sumo11users@yahoogroups.com] On Behalf Of...
Jim Peterson
jcpjimcp
Offline Send Email
Jul 24, 2006
4:20 am

Jim, thanks so much for your help...I'am going to run it on my controller. I'll let you know how it goes. I appreciate your time. Jim Peterson <jimcp@...>...
Belal Ahmad
bxa1322003
Offline Send Email
Jul 24, 2006
10:30 pm

Hello Jim, Thanks for your help with the encoder. Your code works perfect. I figured out what the problem was with me not getting a constant reading from my...
Belal Ahmad
bxa1322003
Offline Send Email
Sep 8, 2006
9:39 pm

I donlt think I understand your question. What “some other device” where you interested in using? What kind of signal does the “some other device” want...
Jim Peterson
jcpjimcp
Offline Send Email
Sep 9, 2006
9:15 pm

A device that reads the ouput on an encoder for a certain fix time and output the speed of the motor to the Sumo11. The idea is that I don't want to you use...
Belal Ahmad
bxa1322003
Offline Send Email
Sep 11, 2006
12:27 am

Any approach that uses digital measurement will always be some previous speed, not the current. My feeling is the error in the delayed reading would only be...
Jim Peterson
jcpjimcp
Offline Send Email
Sep 11, 2006
2:25 am

Thanks for your advise, I'll do a little more research to see if I can get anywhere with that. Another question for you, is there anyway I can control a small...
Belal Ahmad
bxa1322003
Offline Send Email
Sep 13, 2006
11:39 am

I have seen the motor ports used to operate even larger relays, There is always a concern for ground differential problems so another choice is an opto...
Jim Peterson
jcpjimcp
Offline Send Email
Sep 13, 2006
11:52 am

Ooh that is interesting, how does that work? Where can I get an Opto Isolator to work best with the sumo11? Also, aren't those LEDs used by the servo's output...
Belal Ahmad
bxa1322003
Offline Send Email
Sep 13, 2006
5:29 pm

I can’t take the responsibility of completely educating you, For one thing, I am not really qualified to teach this topic. Do a google search on the terms...
Jim Peterson
jcpjimcp
Offline Send Email
Sep 14, 2006
1:36 am

Hello all, I am using the sonar sensor sr04 with the sumo11 using the following code: persistent int dist_test[50]; void main() { int j; sonar_init(); j = 0; ...
Belal Ahmad
bxa1322003
Offline Send Email
Sep 17, 2006
3:40 pm

When the topic changes change the subject. I think you need to sleep(.040) between samples to allow the prior echoes to dissipate.. ... From:...
Jim Peterson
jcpjimcp
Offline Send Email
Sep 17, 2006
5:11 pm

I tried a range of sleep times, but I'm still reading a constant number of tics that dances around the 1100 region. I was using the port 7 for an encoder...
Belal Ahmad
bxa1322003
Offline Send Email
Sep 17, 2006
5:47 pm

If you still have the encoder module loaded that is probably it. ... From: Sumo11users@yahoogroups.com [mailto:Sumo11users@yahoogroups.com] On Behalf Of Belal...
Jim Peterson
jcpjimcp
Offline Send Email
Sep 17, 2006
6:41 pm

But I changed the encoder port to port # 8 and I'm using port 7 for the sonar. I recycled power to the sumo11 several times but still no real results. The...
Belal Ahmad
bxa1322003
Offline Send Email
Sep 17, 2006
9:13 pm

I am not sure. Both the encoders.asm and the srf04_sonar_asm use TIC3. There certainly is a potential for interference. ... From: Sumo11users@yahoogroups.com...
Jim Peterson
jcpjimcp
Offline Send Email
Sep 17, 2006
10:47 pm

I see. Thanks for your help. I Jim Peterson <jimcp@...> wrote: I am not sure. Both the encoders.asm and the srf04_sonar_asm use TIC3. There...
Belal Ahmad
bxa1322003
Offline Send Email
Sep 17, 2006
11:13 pm

Here's a couple of thoughts: 1- Use the "Wheel Watcher" optical quad encoder to do all the work of decifering speed and direction. I've been told by the...
Dan Gates
topazx2
Offline Send Email
Sep 17, 2006
12:25 am
 First  |  |  Next > Last 
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help