NXT Motor output?

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

Moderators: 99jonathan, roger, imaqine

NXT Motor output?

Postby Xpyd3r » Thu Jan 31, 2008 9:40 pm

I have been working with the NXT motor outputs, and i know they can be off, forward, or backwards, meaning the two wires are low low, high low, and low high, respectively. But can you output both high? or is that not a possibility either by software or hardware? Any ideas guys?
Xpyd3r
Novice
 
Posts: 50
Joined: Tue Aug 07, 2007 5:58 am

Postby lawrie » Sat Feb 02, 2008 9:29 pm

I do not fully understand how the M1 and M2 pins on the motors work, but they use pulse-width modulation (PWM) signals and support 4 states: forwards, backwards, brake and float. There is information on this in Chapter 3 of the Extreme NXT book.

The code that drives these pins is in the separate AVR processor. If you want to see the code it is in the ATmega48 directory in the downloadable LEGO MINDSTORMS NXT Firmware Open Source.

Neither leJOS nor the standard Lego firmware has direct access to these pins. Its interface is via messages send from the ARM chip to the AVR (Atmega48) processor. The information sent for each motor is the power (-100 to +100) and 1 bit specifying brake or float. It is also possible to specify the PWM frequency in this message. leJOS uses the same value as LEGO - 8khz. The leJOS code that sends the message is in nxtvm/platform/nxt/nxt_avr.c.
lawrie
leJOS Team Member
 
Posts: 929
Joined: Mon Feb 05, 2007 1:27 pm

Postby Xpyd3r » Mon Mar 24, 2008 1:08 pm

but using PWM, if I apply +100 or -100 its the same as being continuously on correct?, because I need to be able to have a continuous current both ways If this is not possible I will have to try and figure out how to make it possible..
Xpyd3r
Novice
 
Posts: 50
Joined: Tue Aug 07, 2007 5:58 am

Postby lawrie » Mon Mar 24, 2008 11:50 pm

I think +/-100 will set the current continuously on, but I am not a hardware expert.
lawrie
leJOS Team Member
 
Posts: 929
Joined: Mon Feb 05, 2007 1:27 pm


Return to NXJ Hardware

Who is online

Users browsing this forum: No registered users and 0 guests

more stuff