Stop Motor and hold position

This is where you talk about the NXJ hardware related topics such as the brick, sensors, LEGO pieces, etc.

Moderators: 99jonathan, roger, imaqine

Stop Motor and hold position

Postby venice » Sun Mar 14, 2010 8:10 pm

Hey there.
I have build a simple robot-arm. When i stop motion (with a 90 Degree angle between upper and lower part), the arm does not hold its position. here is what i tested on NXJ ( not remote):

boolean isRunning = true;
while (isRunning){
if (InputManager.isJustReleased(InputManager.ESCAPE)){
isRunning = false;
}
Motor.A.stop();
}

Then i tried lock(100) instead of stop() and both together without any result. In further tries i initially set Motor.A.setPower(100) and Motor.A.setBrakePower(100), without any changes. I tested friction by rotating manually robot-arm but it seemed never to be harder or less hard ( even if NXJ is powered off.) I've read through forum, but i did not find a solution.
Has anyone an idea what is wrong? Did i miss something?
venice
New User
 
Posts: 12
Joined: Tue Jan 26, 2010 7:03 pm

Postby ChrisB01 » Mon Mar 15, 2010 9:14 pm

Motor.lock() has always worked for me, could you try testing it with less stress on the motor (just to see if it has any affect at all).

Failing that, is motor A the correct motor? Could you swap the current motor for another motor? Is the lock command being overwritten later in your code by another motor command?

If your still stuck post you code, that might help.

Good luck,

Chris
ChrisB01
Advanced Member
 
Posts: 189
Joined: Sat Mar 15, 2008 12:19 pm
Location: UK

Postby venice » Tue Mar 16, 2010 8:41 am

Hi Chriss,

thanks for your reply. I will give it a try asap, but it'll take until friday/saturday, because i don't have access all the time to mindstorm's hardware at moment.

venice
venice
New User
 
Posts: 12
Joined: Tue Jan 26, 2010 7:03 pm

Postby venice » Tue Mar 23, 2010 6:57 pm

ok, problem has been too heavy weight of robot arm and object i wanted to lift. everythings fine now.
venice
New User
 
Posts: 12
Joined: Tue Jan 26, 2010 7:03 pm

Postby patchido » Fri Mar 26, 2010 3:11 pm

even so, lock(); has to work, the difference is that lock actually uses power on the motor to stay in that position
patchido
Novice
 
Posts: 64
Joined: Thu Feb 25, 2010 3:26 pm


Return to NXJ Hardware

Who is online

Users browsing this forum: Yahoo [Bot] and 0 guests

more stuff