Neverest Motors Encoder Problems
Page 1 of 1

Author:  Vaktaeru [ Tue Jan 06, 2015 4:50 pm ]
Post subject:  Neverest Motors Encoder Problems

For a few weeks now, my FTC team has been working with the new AndyMark Neverest Motors. We are using HiTechnic Motor Controllers with the standard NXT brick. The robot runs normally in our teleop program, but I decided to try using the encoders in the autonomous program, and nothing seems to be working right. For starters, the robot is behaving as if it is completely ignoring the encoders (even with a target encoder value of 10, it runs indefinitely), as well as our fourth motor controller - instead of running the wheels on the fourth controller, it runs motors H and I on the third controller. Has anyone else experienced similar issues, and if so, how could i fix them?

Here is my current code in the autonomous program:
#pragma config(Hubs,  S1, HTMotor,  HTServo,  HTMotor,  HTMotor)
#pragma config(Sensor, S1,     ,               sensorI2CMuxController)
#pragma config(Motor,  motorB,           ,             tmotorNXT, openLoop)
#pragma config(Motor,  motorC,           ,             tmotorNXT, openLoop)
#pragma config(Motor,  mtr_S1_C1_1,     motorD,        tmotorTetrix, openLoop, encoder)
#pragma config(Motor,  mtr_S1_C1_2,     motorE,        tmotorTetrix, openLoop, encoder)
#pragma config(Motor,  mtr_S1_C3_1,     motorH,        tmotorTetrix, openLoop)
#pragma config(Motor,  mtr_S1_C3_2,     motorI,        tmotorTetrix, openLoop)
#pragma config(Motor,  mtr_S1_C4_1,     motorF,        tmotorTetrix, openLoop, reversed, encoder)
#pragma config(Motor,  mtr_S1_C4_2,     motorG,        tmotorTetrix, openLoop, reversed, encoder)
#pragma config(Servo,  srvo_S1_C2_1,    servo1,               tServoStandard)
#pragma config(Servo,  srvo_S1_C2_2,    servo2,               tServoStandard)
#pragma config(Servo,  srvo_S1_C2_3,    servo3,               tServoStandard)
#pragma config(Servo,  srvo_S1_C2_4,    servo4,               tServoNone)
#pragma config(Servo,  srvo_S1_C2_5,    servo5,               tServoNone)
#pragma config(Servo,  srvo_S1_C2_6,    servo6,               tServoNone)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

#include "JoystickDriver.c"
void forward(int x, int y) //x in this case is the power the robot will travel at, and y is the distance it will travel
   nMotorEncoder[motorD] = 0;
   nMotorEncoder[motorE] = 0;
   nMotorEncoder[motorF] = 0;
   nMotorEncoder[motorG] = 0;
   while((abs(nMotorEncoder[motorD]) < (y*3.6)) && (abs(nMotorEncoder[motorE]) < y*3.6) && (abs(nMotorEncoder[motorF]) < y*3.6) && (abs(nMotorEncoder[motorG]) < y*3.6))
{ //abs = absolute value. It is used in each function because the motors rotate in either direction throughout the program
   motor[motorD] = x;
   motor[motorE] = x;
   motor[motorF] = x;
   motor[motorG] = x;
motor[motorD] = 0;
motor[motorE] = 0;
motor[motorF] = 0;
motor[motorG] = 0;
void arm(int x, int y, int z, int a) //this function controls both the lifting arm and the swinging arm
   motor[motorH] = x; //x controls the swinging arm, with positive bringing it upwards
   motor[motorI] = y; //y controls the lifting arm - positive or negative will bring it upwards, but use positive for the sake of consistency
   wait10Msec(z); //set the duration of movement
   if(a > 0) //this part of the function declares the 'idle' state of the arm. A value of 0 will keep sufficient
   {            //power going to both the lifting and swinging arms to hold their position with no load. A value of
      motor[motorH] = a*10; //greater than 0 allows the robot to keep the arm still and stable, even with a light
      motor[motorI] = 10;   //to moderate load
   if(a == 0)
      motor[motorH] = 5;
      motor[motorI] = 5;
task main()

   arm(0, 60, 105, 0); //bring the lifting arm up while on the ramp
   arm(20, 50, 30, 1); //bring up the swinging arm before moving so as to prevent dropping the scoring elements
   forward(40, 10); //move forward off the ramp

Author:  Vaktaeru [ Tue Jan 06, 2015 5:10 pm ]
Post subject:  Re: Neverest Motors Encoder Problems

Update: I figured out the problem. Apparently you can no longer manually change the motors and sensors setup in robotic, and have to actually go into the motors and sensors setup menu to do so. Everything appears to be functioning normally now, aside from the arm going unusually fast.

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group