View unanswered posts | View active topics It is currently Wed Oct 22, 2014 4:43 am






Reply to topic  [ 5 posts ] 
DC-Motors refuse to stop 
Author Message
Novice
User avatar

Joined: Mon Oct 22, 2012 2:14 pm
Posts: 51
Post DC-Motors refuse to stop
hello!
for about 3 months our motors have been working correcting correctly and doing what we want, but now all of a sudden they refuse to stop!
here is the code we used:
Code:
#pragma config(Hubs,  S1, HTMotor,  HTServo,  none,     none)
#pragma config(Sensor, S1,     ,               sensorI2CMuxController)
#pragma config(Sensor, S2,     touch,          sensorTouch)
#pragma config(Sensor, S3,     light,          sensorLightActive)
#pragma config(Sensor, S4,     sonar,          sensorSONAR)
#pragma config(Motor,  motorB,           ,             tmotorNXT, openLoop)
#pragma config(Motor,  motorC,           ,             tmotorNXT, openLoop)
#pragma config(Motor,  mtr_S1_C1_1,     motorD,        tmotorTetrix, openLoop, reversed)
#pragma config(Motor,  mtr_S1_C1_2,     motorE,        tmotorTetrix, openLoop)
#pragma config(Servo,  srvo_S1_C2_1,    armservo,             tServoStandard)
#pragma config(Servo,  srvo_S1_C2_2,    servo2,               tServoNone)
#pragma config(Servo,  srvo_S1_C2_3,    servo3,               tServoNone)
#pragma config(Servo,  srvo_S1_C2_4,    servo4,               tServoNone)
#pragma config(Servo,  srvo_S1_C2_5,    servo5,               tServoNone)
#pragma config(Servo,  srvo_S1_C2_6,    servo6,               tServoNone)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

task main()
{

   servo[armservo] = 160;
   wait1Msec(1000);

   servo[armservo] = 200;
   wait1Msec(1000);

   servo[armservo] = 252;
   wait1Msec(1000);

   motor[motorA] = -30;
   wait1Msec(1000);

   motor[motorD] = 30;
   motor[motorE] = 30;
   wait1Msec(40);

   servo[armservo] = 230;
   wait1Msec(1000);

   servo[armservo] = 122;
   wait1Msec(1000);

   servo[armservo] = 225;
   wait1Msec(2000);

}

we dont know why but for some reason the servos and everything else work correctly except for the DC motors.....obviously this is a problem, any help is apreciated, ty


Fri Dec 14, 2012 5:33 pm
Profile
Moderator
Moderator
User avatar

Joined: Tue Sep 14, 2010 9:19 pm
Posts: 496
Post Re: DC-Motors refuse to stop
Can you be a little more specific? What do you mean by not "working correctly"? Just that they do not stop? When are they supposed to stop, when the program is over? Try adding motor["motorname"] = 0; at the end of your program to stop the motors.

_________________
sudo rm -rf /


Fri Dec 14, 2012 6:09 pm
Profile
Novice
User avatar

Joined: Mon Oct 22, 2012 2:14 pm
Posts: 51
Post Re: DC-Motors refuse to stop
Yes, the motors won't stop for some reason, on Monday I will try the motor 0 thing on Monday


Fri Dec 14, 2012 7:38 pm
Profile
Novice

Joined: Sun Oct 21, 2012 10:01 pm
Posts: 76
Post Re: DC-Motors refuse to stop
magicode is right; if you don't tell a motor to stop moving (with a command like motor[motorD] = 0;), it will continue running at whatever power you gave it until the program ends.


Sat Dec 15, 2012 2:35 pm
Profile
Novice
User avatar

Joined: Mon Oct 22, 2012 2:14 pm
Posts: 51
Post Re: DC-Motors refuse to stop
you are right sir, untill now i havnt had to use multiple movement commands, so that would explain why i didnt know haha!
thank you!
(if you can help at all on my remote control post that would be fantastic cuz i have been working on it for 3 irritating months and i havent got it to work yet... >.<


Fri Jan 04, 2013 12:22 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: Stefan 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.