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 / 827
826  |  828
Subject: 
RotateMotor is stuck/nxc
Newsgroups: 
lugnet.robotics.nxt
Date: 
Fri, 27 Jul 2007 03:26:13 GMT
Viewed: 
21155 times
  
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
 
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 (...) (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
    

Custom Search

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