To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.nxtOpen lugnet.robotics.nxt in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / NXT / 828
827  |  829
Subject: 
RE: RotateMotor is stuck/nxc
Newsgroups: 
lugnet.robotics.nxt
Date: 
Fri, 27 Jul 2007 12:06:46 GMT
Viewed: 
21161 times
  
Just to clarify more although it probably is very clear to most...

LEGS_TURNING_DEG = some int to indicate the turning degree
MOVENOW & DONE contains different integer values

--E

-----Original Message-----
From: news-gateway@lugnet.com [mailto:news-gateway@lugnet.com] On Behalf Of
Elizabeth Mabrey
Sent: Thursday, July 26, 2007 11:26 PM
To: lugnet.robotics.nxt@lugnet.com
Subject: RotateMotor is stuck/nxc


Symptom:

Stuck in RotateMotor function call.



================================

Synopsis of how to create the problem :

-       2 tasks

-       Task1 handles motor A & C

-       Task2 handles motor B

-       Task1’s motor movements have to synchronize with the Task2’s motor B
movement

-       Mutex is used.



================================

Code segment:

(Note: TORSO is motor B)

Task 2 :

       ResetRotationCount(TORSO);

        Leg = LEFT;

        Acquire(FootMutex);

        FootMove=MOVENOW;

        Release(FootMutex);



        TextOut(0, LCD_LINE2, false, "DO ROTATE");  ß- does display ok

        RotateMotor (TORSO, 100, 360);   ß---- stuck in this call

        TextOut(0, LCD_LINE2, false, "DONE ROTATE");  ß does not display,
i.e.  execution has been stuck at RotateMotor.



       until (FootMove==DONE);



Task 1:

(Note: Leg will only be either motor A or C)

   until (FootMove==MOVENOW);

        RotateMotor (Leg, 75, LEGS_TURNING_DEG);

        RotateMotor (Leg, -75, LEGS_TURNING_DEG);

        Wait(1000);

        Acquire(FootMutex);

        FootMove=DONE;

        Release(FootMutex);

        TextOut(…., FootMove);ß- this shows up on the LCD fine.  This tells
me that the mutex is indeed released.

                                               So FootMove is also set to
DONE.





// note the FootMove is initialized to DONE before these tasks are invoked.



================================

How to further prove the it is hung in the RotateMotor call?

-       Once I replace the RotateMotor   with  Wait(500); or Wait(250), etc.
The flow is fine.



--E



--
MIME ATTACHMENTS DISCARDED:

1.  Content-Type: text/html;
    charset="iso-8859-1"
    Content-Transfer-Encoding: quoted-printable
    Content-Length: 8082



Message has 1 Reply:
  Re: RotateMotor is stuck/nxc
 
(...) Elizabeth, Could you upgrade to b31 of NXC and see if you still have this problem? You will need to update your TextOut call to put the "false" as the last parameter or leave it out altogether. TextOut(0, LCD_LINE2, "DONE ROTATE"); Also, could (...) (17 years ago, 27-Jul-07, to lugnet.robotics.nxt)

Message is in Reply To:
  RotateMotor is stuck/nxc
 
Symptom: Stuck in RotateMotor function call. ===...=== Synopsis of how to create the problem : - 2 tasks - Task1 handles motor A & C - Task2 handles motor B - Task1’s motor movements have to synchronize with the Task2’s motor B movement - Mutex is (...) (17 years ago, 27-Jul-07, to lugnet.robotics.nxt)

4 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR