View unanswered posts | View active topics It is currently Thu Oct 22, 2020 8:59 am

Reply to topic  [ 2 posts ] 
Neverest Motors Encoder Problems 
Author Message

Joined: Tue Jan 06, 2015 4:38 pm
Posts: 2
Post 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

Tue Jan 06, 2015 4:50 pm

Joined: Tue Jan 06, 2015 4:38 pm
Posts: 2
Post 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.

Tue Jan 06, 2015 5:10 pm
Display posts from previous:  Sort by  
Reply to topic   [ 2 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

Search for:
Jump to:  

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.