background image

CMD

Hex

Description

B

0x42 Motor 2: Brake while stopping.

C

0x43 Motor 1 & 2: Brake while stopping.

Encoder Reset Commands

r

0x72 Motor 1: Reset Encoder to zero

s

0x73 Motor 2: Reset Encoder to zero

These commands are issued on command register (0x41).

Motor Command Register Explained

Each motor has two command registers (Register A and Register B).
In current release Register B is reserved for future use and must be 
set to zero.
Bits in Register A should be set to 1 to avail functionality as 
described below.

Register 
Bit

Turn this bit to 1 for following functionality

Least 
significant 
bit (bit 0)

Speed control of your motor.

 The NXTMMX will 

honor speed values specified in the speed register for 
the respective motor.

Bit 1

Ramp the speed up or down.

 While starting the motor 

or changing speed, the NXTMMX will ramp up or ramp 
down the power to new value.
If this bit is zero, the power changes are sudden, e.g. 
full power is applied to motors as they start.

Bit 2

Relative change based on encoder values.

 This is 

useful when Bit 3 is turned on, and in this case, the 
NXTMMX will make a relative movement from last seen 
Encoder position (it will add the new Encoder position 
to old position and move to that resulting position). 
Useful when turning by degrees or rotations.
If this bit is 0, the Encoder positions are taken as 
absolute values.

Bit 3

Encoder control of your motor.

 The NXTMMX will 

honor Encoder values specified in Encoder position 
register for respective motor. If speed values are also 
specified, and speed bit is set on, motors will rotate to 
new encoder position with the specified speed.

Bit 4

Brake or Float at the completion of motor 
movement.

 If this bit is 1, motor will Brake at the 

completion, otherwise it will float.

Bit 5

Encoder active feedback. 

This bit is used when 

Encoder control is used. If this bit is set to 1 at the 
completion of motor movement, the NXTMMX will 
continue to hold the Encoder position (i.e. if motor is 

Copyright © 2016  mindsensors.com

 10/14

Summary of Contents for NXTMMX-v2

Page 1: ...ensors please read the relevant section from the Advanced Information Appendix of this doc Mounting NXTMMX on your contraption The holes on the NXTMMX enclosure are designed for tight fit of Technic pins or axles with cross section The holes however are not designed for repeated insertions removals of these pins To mount NXTMMX on your contraption we suggest that you use two dark gray Technic Axle...

Page 2: ...y store To connect these batteries to NXTMMX you can purchase a connector cable from the following location http www mindsensors com rpi 10 rc battery pack connector cable Lithium Polymer Battery also known as Li Po or LiPo batteries With NXTMMX use 7 4 Volts battery Select the capacity based on your load and anticipated duration of use For nominal load we recommend 7 4Volts 800 mAh battery You ca...

Page 3: ... free to rotate by external force Holding Encoder position At the end of run hold the encoder position i e motor turned by external force is restored to last set encoder position Turning motor by degrees Move it in forward or reverse direction Turning motor by rotations 360 degrees makes one rotation Running operations asynchronously While a motor is running other operations may be performed Runni...

Page 4: ... custom NXT block from following URL and import it into your NXT G IDE http www mindsensors com index php controller attachment id_attachment 96 If you need instructions on how to import this block in NXT G visit following url http www mindsensors com content 21 nxt g blocks how to install blocks Also download sample NXT G programs from following URL and modify them to suit your needs http www min...

Page 5: ...tion and modify it to meet your needs Current Characteristics Average current consumption of this device is about 5 0 mA NXTMMX can deliver upto 1 Amp current per NXT Motor attached Drawing of excessively large current such as incorrect motors or stalled motors will result in internal shutdown until the situation is corrected I2C Bus address Factory Default Address 0x06 Changing the I2C Bus Addres...

Page 6: ...http www mindsensors com blog how to change i2c device address PiStorms http www mindsensors com blog how to change i2c device address with pistorms Copyright 2016 mindsensors com 6 14 ...

Page 7: ...e 3 0x45 Most Significant Byte Encoder Target of Motor 1 long 0x46 Speed for Motor 1 byte Speed for Motor 1 byte 0x47 Time to run in seconds for Motor 1 byte Time to run in seconds for Motor 1 byte 0x48 Command register B for Motor 1 Command register B for Motor 1 set this value to 0 as this is for future use 0x49 Command register A for Motor 1 read the description below for details of this regist...

Page 8: ...0x66 Least Significant Byte 0x67 Byte 2 0x68 Byte 3 0x69 Most Significant Byte 0x72 Status Motor 1 byte See section below for details of this register 0x73 Status Motor 2 byte See section below for details of this register 0x76 Tasks Running for Motor 1 byte 0x77 Tasks Running for Motor 2 byte Registers for Advanced PID control Writing these registers has immediate effect on operation These regist...

Page 9: ...ositioning but will take longer time Change this only if you need different motor positioning speeds and accuracy For normal usage default values will be OK 0x87 Tolerance The Tolerance in ticks for encoder positioning default 80 Tolerance the accuracy you desire while positioning Low number will position the encoders more accurately but may take longer time Change this only if you need different ...

Page 10: ...nges are sudden e g full power is applied to motors as they start Bit 2 Relative change based on encoder values This is useful when Bit 3 is turned on and in this case the NXTMMX will make a relative movement from last seen Encoder position it will add the new Encoder position to old position and move to that resulting position Useful when turning by degrees or rotations If this bit is 0 the Encod...

Page 11: ...egister Each bit in status register indicates various situations with the motor as explained below Register Bit Value 1 indicates the situation is true Least significant bit bit 0 Speed Control is ON Motor is programmed to move at a fixed speed Bit 1 Motor is Ramping up or down If the Power ramp is enabled this bit is 1 while the motor is ramping while changing its speed Bit 2 Motor is powered Thi...

Page 12: ...ode During moving Position Control bit bit 3 is 1 Motor is Powered bit bit 2 is 1 Finished moving normally All bits are zero Stopped due to stall Position Control bit bit 3 is 1 Motor is Powered bit bit 2 is 1 Stalled bit bit 7 is 1 Running in timed mode During moving Timed Mode bit bit 6 is 1 Motor is Powered bit bit 2 is 1 Finished moving normally All bits are zero Stopped due to stall while tim...

Page 13: ...MX While using this NXTMMX in your program use the new address picture below shows where to use the new address in NXT G program If you are using any other programming environment the API reference should indicate where to specify the new address If you are daisy chaining 5 or more NXTMMX or other digital sensors you may have to disable Pull up resistors in some of the devices The Pull up resistor...

Page 14: ...On a smaller scale usually up to 5 devices this deterioration has no effect on I2C network performance however when you add more devices you may encounter data errors Upgrading NXTMMX firmware The NXTMMX is shipped with latest stable firmware if you need to change upgrade the firmware follow the procedure described at URL below http www mindsensors com content 62 firmware upgrader for compatible d...

Reviews: