View unanswered posts | View active topics It is currently Mon Sep 15, 2014 8:59 pm






Reply to topic  [ 5 posts ] 
Noob Motor Question 
Author Message
Rookie

Joined: Sat Jan 12, 2013 7:26 am
Posts: 12
Post Noob Motor Question
Hi folks. I have just bought RobotC, great fun. Been programming for years, nothing to do with C, certainly a fun way to get into it.

However, I have a question about the motor function.

I'm running an NXT 2 brick with the latest firmware and the latest dev environment, if I run the following:

nMotorEncoderTarget[motorA] = 0;
motor[motorA] = -100;
wait1Msec(1000);
motor[motorA] = 0;

at the end of a program, and the program ends, I notice the motor is still under load, I can manually move it, but it's as if the brakes are 50% on. The help suggests [motorA]=0; should end all control of it. Is there a command to 'turn off' the motor? I can't see anything obvious.

Thanks.


Sat Jan 12, 2013 7:34 am
Profile
Moderator
Moderator
User avatar

Joined: Tue Sep 14, 2010 9:19 pm
Posts: 496
Post Re: Noob Motor Question
Try using: bFloatDuringInactiveMotorPWM = true;

_________________
sudo rm -rf /


Sat Jan 12, 2013 3:12 pm
Profile
Rookie

Joined: Sat Jan 12, 2013 7:26 am
Posts: 12
Post Re: Noob Motor Question
Yeah, I found that in the help, it doesn't make any difference.
It's not as though the brakes are fully on, the motors turn without much effort, but they are definitely loaded compared to a power off state, which motor=0 is stated do.
It doesn't really bother me, except I have one application where I wanted gravity to return a block to a 'start' position. I will have to add some power.

Thanks for your reply.


Sun Jan 13, 2013 2:05 pm
Profile
Moderator
Moderator

Joined: Thu Jan 03, 2013 5:10 pm
Posts: 198
Location: The plateau north of the Ohio River Valley, also known as Cave Country.
Post Re: Noob Motor Question
Motor[motora] = 0 does not mean that the motor turns off. Conversely, it means the speed of the motor is set to zero, but the motor's internal tachometer is still taking measurments, and it needs power to operate. When I tested out your code, bfloatwhenmotorpwminactive = true does it. try putting it at the very end of your code.

_________________
I'm not a robot! I'm british! ~ quote from an asparagus
I am not a robot! I am a unicorn! ~ quote from a robot


Sun Jan 13, 2013 8:07 pm
Profile
Rookie

Joined: Sat Jan 12, 2013 7:26 am
Posts: 12
Post Re: Noob Motor Question
Ah, sorry, I understand now. I thought it was program state or constant so I have the code in the wrong place.

Thank you so much for your explanation.

Cheers,
Tull.


Thu Jan 17, 2013 10:33 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 5 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.