View unanswered posts | View active topics It is currently Wed Oct 01, 2014 9:44 am






Reply to topic  [ 4 posts ] 
glide wheel for M run alone .... 
Author Message
Novice

Joined: Sat Sep 15, 2012 11:28 am
Posts: 68
Post glide wheel for M run alone ....
Hello

I bought glide wheel for M ;

but there is a problem :

when I use robotc program below , the motor works well and get the target , and then stop ;

but when the program stop ( run out ) , the motor start to run
at hight speed until I shut off the NXT ;

it is a big problem to have a motor which run when the progrm is off ; :D :-(

would you tell me what's happen , please ?

there is no driver for this item , I think ?

thanks

didier


it is a program from the help of robotc :

> task main
>
> {
>
>
>
> nMotorEncoder[motorB] = 0; // reset the Motor Encoder of Motor B
> nMotorEncoderTarget[motorB] = 360; // set the target for Motor Encoder of Motor B to 360
> motor[motorB] = 75; // motor B is run at a power level of 75
> motor[motorC] = 75; // motor C is run at a power level of 75
>
> while(nMotorRunState[motorB] != runStateIdle) // while Motor B is still running:
> {
> // do not continue
> }
> motor[motorB] = 0; // motor B is stopped at a power level of 0
> motor[motorC] = 0; // motor C is stopped at a power level of 0
>
> }


Tue Jan 15, 2013 3:31 pm
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1347
Post Re: glide wheel for M run alone ....
didiercoll wrote:
Code:
task main
{
    nMotorEncoder[motorB] = 0;                // reset the Motor Encoder of Motor B
    nMotorEncoderTarget[motorB] = 360;        // set the  target for Motor Encoder of Motor B to 360
    motor[motorB] = 75;                       // motor B is run at a power level of 75
    motor[motorC] = 75;                       // motor C is run at a power level of 75

    while(nMotorRunState[motorB] != runStateIdle)  // while Motor B is still running:
    {
        // do not continue
    }
    motor[motorB] = 0;                       // motor B is stopped at a power level of 0
    motor[motorC] = 0;                       // motor C is stopped at a power level of 0
}

I can see some problem in this code. Are motor B and C the left and right motors? If so, you may need to set the nMotorEncoderTarget for motorC as well and also check its runStateIdle. I assume you have turned on PID control in your pragma statements. Since you are running motorB with PID control and motorC without, motorB will slow down closer to the target but motorC will still run at 75% speed, your robot will turn. That probably will mess up motorB and caused the runStateIdle to remain false. That's my guess.


Tue Jan 15, 2013 4:19 pm
Profile
Novice

Joined: Sat Sep 15, 2012 11:28 am
Posts: 68
Post Re: glide wheel for M run alone ....
Thanks a lot for your advice ;


yesterday I tried on NXT G ; it was OK ;

I tried again this morning ;

and then it works well with two programs from help ;

sometimes there is something strange with the firmware robotC ;

the NXT do not do the program until

I run my PC again and then the problem is out ;




thanks a lot for your advice about target ; very usefull ;

but everything is OK with code ; the motors B and C do the job now ;

didier

> task main
>
> {
> nMotorEncoder[motorB] = 0;
> while (nMotorEncoder[motorB] < 1000) // wait for motor to reach a specific location
> {
> motor[motorB] = 50; /* Run the motors forward at a power level of 50
> until 1000 encoder counts have been reached. */
> wait1Msec(10)
>
> }
>
> }


Wed Jan 16, 2013 3:08 am
Profile
Novice

Joined: Sat Sep 15, 2012 11:28 am
Posts: 68
Post Re: glide wheel for M run alone ....
Bonjour

I have the same problem , but with the PSP V4 from minstroms and mux motor add to tha glide wheel ;

see below , please , about the problem with PSP V4 ;



perhaps somebody has the same problem with the psp2 megaforce , the croos button gives always "1 " ;

thanks

didier

----------------------------------------------------------------------------------

Hello

I use robotc and this driver

> /*!@addtogroup mindsensors
> * @{
> * @defgroup PSP4 PSP-Nx V4
> * Playstation 2 Controller Sensor
> * @{
> */
>
> /*
> * $Id: mindsensors-ps2ctrl-v4.h 123 2012-11-02 16:35:15Z xander $
> */

is is good ?

didier


Le 16/01/2013 19:52, info@mindsensors.com a écrit :
> The binary values returned for the PSP-Nx-v4 are different from PSP-Nx-v3.
> You should use PSP-Nx-v4 API while using v4 controller.
> which programming language are you using?
>
> On 1/16/2013 1:16 PM, Didier Collumeau wrote:
>> Hello
>>
>> I have always the same problem , but worst !!!!!!!!!!!!!
>>
>> With the new PSP2 magnaforce and receiver PSP NXV4 , the cross button is always at " 1" on display sreen ;
>>
>> and when I stop the program on NXT , the mmotor_S1_2 run always until I put the NXT on off ;
>>
>> well , now ....
>>
>> with my " old " psp2 lynxmotion , with the psp nx V3 receiver , the crossbutton is at level 0 or 1 , ( OK ) ,
>>
>> and the mmotor_S1_2 stop well , and the motor do not run when the program stop ;
>>
>> it mean that my problem today ( but not yesterday , I did not use it ) come from the psp nx V4 ???????
>>
>> when the motor run alone with the program , if I plug off off the pspnxv 4 and plug in the v3 the motor stop ;
>>
>>
>> each time I use the motormux without NXTG , at the end I have a problem , never the same ...
>>
>> I am sorry to worry you about nyour products ...
>>
>> please , what could I do now ?
>>
>> thanks
>>
>> didiert
>>
>>
>>
>>
>>
>>
>>
>>> task moteursEFAun()
>>> {
>>>
>>> MSMMUXinit();
>>>
>>> while (true)
>>> {
>>>
>>>
>>> motor[motorB] = 100;
>>>
>>>
>>> //dataE14 = controller.left1Btn;traction avant et arriere
>>>
>>> if (dataR14 == 1 )motor[motorA] = vitesseTraction ;
>>> else if (dataR15 == 1)motor[motorA] = -vitesseTraction ;
>>> else motor[motorA] = 0 ;
>>>
>>>
>>> //dataE5 = controller.joypadUp; direction arriere //Smux BI 1
>>>
>>> //dataE6 = controller.joypadDown;direction arriere //Smux BI 1
>>>
>>> if (dataR5 == 1 )MSMMotor(mmotor_S1_1, vitesseTraction ) ;
>>> else if (dataR6 == 1)MSMMotor(mmotor_S1_1, -vitesseTraction );
>>> else MSMMotor(mmotor_S1_1, 0);
>>>
>>>
>>> //dataE9 = controller.triangleBtn;direction avant//Smux BI 2
>>>
>>> //dataE10 = controller.crossBtn;direction avant//Smux BI 2
>>>
>>> if (dataR9 == 1 )MSMMotor(mmotor_S1_2, 100) ;
>>> else if (dataR10 == 1)MSMMotor(mmotor_S1_2, -100);
>>> else MSMMotor(mmotor_S1_2, 0);
>>>
>>> //dataE2 = controller.joystickLeft_y ;verins double arriere C I
>>>
>>> if (dataR2 == 1 )motor[motorC] = vitesseVerin ;
>>> else if (dataR2 == 2)motor[motorC] = -vitesseVerin;
>>> else motor[motorC] = 0 ;
>>>
>>> wait1Msec(10);
>>> }
>>> }
>>


Wed Jan 16, 2013 3:44 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

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.