It is currently Tue May 21, 2013 6:11 am
       


All times are UTC + 1 hour




Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: ASURO: FUNCTION TO TURN;
PostPosted: Wed Feb 27, 2008 9:44 pm 
Offline
arexx.com user

Joined: Mon Nov 12, 2007 11:09 am
Posts: 16
Hi,

I was wondering if any of you have a function to turn asuro left or right?

I am mostly interested to turn asuro left or right 90 degrees.

Any help appreciated.

Regards,
giannis


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 28, 2008 2:33 pm 
Offline
Administrator

Joined: Mon Mar 28, 2005 12:17 pm
Posts: 451
Hello Giannis,

Most simple way is to do this with the program EASY ASURO.

See the ASURO downloads at our homepage.

Good luck!

Aalt


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 28, 2008 8:56 pm 
Offline
arexx.com user

Joined: Mon Nov 12, 2007 11:09 am
Posts: 16
aalt wrote:
Hello Giannis,

Most simple way is to do this with the program EASY ASURO.

See the ASURO downloads at our homepage.

Good luck!

Aalt


Thanks for the quick response,

I dont see any software called EasyASURO in your download page.
Do you mean Doctor ASURO?

Regards,
Giannis


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 28, 2008 9:24 pm 
Offline
Administrator
User avatar

Joined: Fri Mar 25, 2005 6:19 pm
Posts: 1378
Location: NRW
Hello Giannis,

the info site is currently not translated to english - sorry for that - here the link to the German Version:
http://www.arexx.com/arexx.php?cmd=syst ... pro.dat|DE)

The Program itself is in English. It is still BETA Release so you may encounter some Bugs.


Anyway - if you want to use C - have a look at :
http://www.asurowiki.de/pmwiki/pmwiki.php
http://www.asurowiki.de/pmwiki/pub/html/index.html
http://sourceforge.net/projects/asuro

This is a mixed german / english language project for a more advanced ASURO Library. It has a function "GoTurn" which does exactly what you want. It can move a specific distance and turn by specific angles.
Instead of asuro.h and asuro.c you have to change the makefile to use this library. There are several example files included in the download archive of this library.

Best regards,
SlyD


Top
 Profile E-mail  
 
 Post subject:
PostPosted: Thu Feb 28, 2008 10:07 pm 
Offline
arexx.com user

Joined: Mon Nov 12, 2007 11:09 am
Posts: 16
SlyD wrote:
Hello Giannis,

the info site is currently not translated to english - sorry for that - here the link to the German Version:
http://www.arexx.com/arexx.php?cmd=syst ... pro.dat|DE)

The Program itself is in English. It is still BETA Release so you may encounter some Bugs.


Anyway - if you want to use C - have a look at :
http://www.asurowiki.de/pmwiki/pmwiki.php
http://www.asurowiki.de/pmwiki/pub/html/index.html
http://sourceforge.net/projects/asuro

This is a mixed german / english language project for a more advanced ASURO Library. It has a function "GoTurn" which does exactly what you want. It can move a specific distance and turn by specific angles.
Instead of asuro.h and asuro.c you have to change the makefile to use this library. There are several example files included in the download archive of this library.

Best regards,
SlyD


Sorry about asking again but because these links are in German and there quite a few links, Could you tell me which file to download from these? I downloaded the one from sourceforce but it does not seem to contain any function GoTurn.

Regards,
Giannis


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 29, 2008 12:33 pm 
Offline
Administrator
User avatar

Joined: Fri Mar 25, 2005 6:19 pm
Posts: 1378
Location: NRW
There are some different files on Sourceforge!
You need AsuroLib 2.7.1!

Then have a look at the examples folder - and at the file "encoder.c".

GoTurn works like
GoTurn(distance, angle, speed)
if distance > 0 it moves for that distance at speed,
else if angle > 0 it rotates by that angle at speed.

I did not try this myself, but it should be fairly easy to use.

Best regards,
SlyD


Top
 Profile E-mail  
 
 Post subject:
PostPosted: Fri Feb 29, 2008 3:12 pm 
Offline
arexx.com user

Joined: Mon Nov 12, 2007 11:09 am
Posts: 16
SlyD wrote:
There are some different files on Sourceforge!
You need AsuroLib 2.7.1!

Then have a look at the examples folder - and at the file "encoder.c".

GoTurn works like
GoTurn(distance, angle, speed)
if distance > 0 it moves for that distance at speed,
else if angle > 0 it rotates by that angle at speed.

I did not try this myself, but it should be fairly easy to use.

Best regards,
SlyD


Thanks a lot for your help my friend.

I will test this within a few day and confirm so other users know it as well.


Regards,
giannis


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 29, 2008 3:29 pm 
Offline
arexx.com user

Joined: Mon Nov 12, 2007 11:09 am
Posts: 16
Hi,

I am having a look now but it seems that there is a file missing from here. myAsuro.h


Regards,
Giannis


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 29, 2008 5:21 pm 
Offline
Administrator
User avatar

Joined: Fri Mar 25, 2005 6:19 pm
Posts: 1378
Location: NRW
Did you try to compile the examples? Does that work?
(for example "MotorTest" - there GoTurn is used...)

If it works - copy one of them completely with all files - especially the makefile. (The makefile need to have all the correct paths set up in order to find the files)

Your Computer is dumb and does not know where files are - you need to tell him ;)

Best regards,
SlyD


Top
 Profile E-mail  
 
 Post subject:
PostPosted: Fri Feb 29, 2008 6:06 pm 
Offline
arexx.com user

Joined: Mon Nov 12, 2007 11:09 am
Posts: 16
SlyD wrote:
Did you try to compile the examples? Does that work?
(for example "MotorTest" - there GoTurn is used...)

If it works - copy one of them completely with all files - especially the makefile. (The makefile need to have all the correct paths set up in order to find the files)

Your Computer is dumb and does not know where files are - you need to tell him ;)

Best regards,
SlyD


Hi,

Because I am using the old make file, and i have done quite some work now and i dont really want to change it I have put into a file whatever the function GOTurn needs to run. I will clean this file and put it here these days.

My last problem is that I have this code:
Init();

MotorDir(FWD,FWD);
MotorSpeed(140,140);

GoTurn(0,90,120);

MotorSpeed(0,0);
MotorDir(BREAK,BREAK);

return 0;

To me it would seem that according to that code, asuro should turn 90 degrees and then stop executing. But what it does is keep turning forever.
Could this be because it does no exit the GoTurn function?

Would you have any advice on that?


Kind Regards,
Giannis


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 29, 2008 6:26 pm 
Offline
arexx.com user

Joined: Mon Nov 12, 2007 11:09 am
Posts: 16
Hi again,

It seems that for some reason, asuro never escapes the following while loop inside the GoTurn function:

while (tot_count < enc_count)
{
tot_count += encoder [LEFT];
diff = encoder [LEFT] - encoder [RIGHT];

if (diff > 0)
{ /* Left faster than right */
if ((l_speed > speed) || (r_speed > 244))
l_speed -= 10;
else
r_speed += 10;
}

if (diff < 0)
{ /* Right faster than left */
if ((r_speed > speed) || (l_speed > 244))
r_speed -= 10;
else
l_speed += 10;
}
/* reset encoder */
EncoderSet (0, 0);

MotorSpeed (l_speed, r_speed);
Msleep (1);
}

Hope this may helps.

Regards,
Ioannis


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 29, 2008 8:37 pm 
Offline
arexx.com user

Joined: Mon Nov 12, 2007 11:09 am
Posts: 16
Hi Again,

After a quick investigation. I attach the loop of the function I was talking before.

while (tot_count < enc_count)
{
tot_count += encoder [LEFT];
diff = encoder [LEFT] - encoder [RIGHT];

if (diff > 0)
{ /* Left faster than right */
if ((l_speed > speed) || (r_speed > 244))
l_speed -= 10;
else
r_speed += 10;
}

if (diff < 0)
{ /* Right faster than left */
if ((r_speed > speed) || (l_speed > 244))
r_speed -= 10;
else
l_speed += 10;
}
/* reset encoder */
EncoderSet (0, 0);

MotorSpeed (l_speed, r_speed);
Msleep (1);
}

As you can see from the code, the control will go out of the loop as soon the tot_count is equal or greater than enc_count. The variable tot_count depends on the encoder [LEFT]. Which encoder [LEFT] is getting reset to 0 at the end of the while loop every time " EncoderSet (0, 0);". From this it seems to me that the variable tot_count will never be equal or greater to enc_count, thus i think this is the reason why asuro keeps turning forever.

Would you have any suggestion on this?

Furthermore, I dont really understand what is the use of encoder [LEFT] and encoder [RIGHT].

Regards,
Giannis


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 29, 2008 8:48 pm 
Offline
Administrator
User avatar

Joined: Fri Mar 25, 2005 6:19 pm
Posts: 1378
Location: NRW
Did you call

EncoderInit();

before using this stuff?

I don't think so ;)

Best regards,
SlyD


Top
 Profile E-mail  
 
 Post subject:
PostPosted: Fri Feb 29, 2008 9:02 pm 
Offline
arexx.com user

Joined: Mon Nov 12, 2007 11:09 am
Posts: 16
SlyD wrote:
Did you call

EncoderInit();

before using this stuff?

I don't think so ;)

Best regards,
SlyD


Yeah I did call it in the main method, just before I call the function GoTurn.

So i dont think that this is the reason..


Regards,
Giannis


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 29, 2008 10:03 pm 
Offline
Administrator
User avatar

Joined: Fri Mar 25, 2005 6:19 pm
Posts: 1378
Location: NRW
Uhm - I just noticed that you did not add a infinite loop at the edn - so try adding a

while(true)
{
}

just before the return 0;

I did not see this before but you always have to create a defined END of your Program on a Microcontroller. (in some cases it may restart if you do not do this! This would explain why it does not stop spinning. You should also add more than one movement - this would directly reveal such issues.)

Best regards,
SlyD


Top
 Profile E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


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