|
Page 1 of 1
|
[ 5 posts ] |
|
| Author |
Message |
|
tclancey
Rookie
Joined: Sat Jan 12, 2013 7:26 am Posts: 12
|
 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 |
|
 |
|
magicode
Moderator
Joined: Tue Sep 14, 2010 9:19 pm Posts: 495
|
 Re: Noob Motor Question
Try using: bFloatDuringInactiveMotorPWM = true;
_________________ sudo rm -rf /
|
| Sat Jan 12, 2013 3:12 pm |
|
 |
|
tclancey
Rookie
Joined: Sat Jan 12, 2013 7:26 am Posts: 12
|
 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 |
|
 |
|
Coder A
Expert
Joined: Thu Jan 03, 2013 5:10 pm Posts: 138 Location: Southern Indiana
|
 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 asparagusI am not a robot! I am a unicorn! ~ quote from a robotPlay chess for free!
|
| Sun Jan 13, 2013 8:07 pm |
|
 |
|
tclancey
Rookie
Joined: Sat Jan 12, 2013 7:26 am Posts: 12
|
 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 |
|
|
|
Page 1 of 1
|
[ 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
|
|