View unanswered posts | View active topics It is currently Wed Nov 26, 2014 6:38 am






Reply to topic  [ 6 posts ] 
Motor out of Range Errors 
Author Message
Rookie

Joined: Fri Dec 05, 2008 2:05 pm
Posts: 1
Post Motor out of Range Errors
I have written code using RobotC for the FirstTech robot. When we compile the program we get no errors. We are set up to use two NXT motors through Motor A and Motor B ports on the NXT. We are driving four additional 12V motors through the Senor ports via motor controllers two through S1, two through S2, and are trying to run two servos through S4. We are getting power and some reaction from the servo and NXT motors from the program, but no reaction from the 12V motors at all. During the debug process we keep getting "Motor out of Range" and "Servo out of Range" errors. This happens before any input is recieved from the joystick. I need any help or input I can get. Thanks.


Fri Dec 05, 2008 2:46 pm
Profile
Professor

Joined: Fri Sep 19, 2008 1:22 am
Posts: 200
Post Re: Motor out of Range Errors
Post your code.

_________________
Jeff McBride
Benson Robotics Club


Fri Dec 05, 2008 5:25 pm
Profile
Rookie

Joined: Thu Dec 04, 2008 4:40 pm
Posts: 8
Post Re: Motor out of Range Errors
Jeff McBride wrote:
Post your code.
I second that motion. :poke:

_________________
Trying to help you will be like trying to find a worm in the middle of a blizzard. A white worm.


Fri Dec 05, 2008 5:59 pm
Profile
Rookie

Joined: Wed Dec 10, 2008 11:16 pm
Posts: 1
Post Re: Motor out of Range Errors
hi, we keep getting the error message

exception type: 'servo out of range(34)
------------------------------------------------------------------------------------------
#pragma config(Hubs, S1, HTMotor, HTServo, HTMotor, none)
#pragma config(Sensor, S4, Compass, sensorI2CHiTechnicCompass)
#pragma config(Motor, mtr_S1_C1_1, motorD, tmotorNormal, PIDControl)
#pragma config(Motor, mtr_S1_C1_2, motorE, tmotorNormal, PIDControl)
#pragma config(Motor, mtr_S1_C3_1, motorF, tmotorNone, openLoop)
#pragma config(Motor, mtr_S1_C3_2, motorG, tmotorNone, openLoop)
#pragma config(Servo, servo1, Servo1, tServoNormal)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//

#include "JoystickDriver.c"

float jx; //joystick input for direction control
float jy; //joystick input for speed control
float sf; //speed factor
float sl; //speed limit
float lws; //left wheel speed
float rws; //right wheel speed
int lwsi; //left wheel speed
int rwsi; //right wheel speed


task main()
{



sl = 20; // set speed limit
getJoystickSettings(joystick); //Update initial joystick/game values

while(joystick.StopPgm) //While the FMS says we're "disabled", keep looping
{
getJoystickSettings(joystick); //Update joystick/game values to see if enabled
wait1Msec(50); //wait 50 milliseconds
}


motor[motorD] = 100;
motor[motorE] = 100;

wait1Msec(1500);

motor[motorD] = 0;
motor[motorE] = 0;



while (true)
{
getJoystickSettings(joystick);
//////------------ Drive Motor Speed Control---------------
// Control Speed of motor
jx = joystick.joy1_x1;
jy = joystick.joy1_y1;
sf = jy/127;
if (jy > 0) // go forward
{
if (jx > 0) // turn right
{
lws = sl * sf;
rws = lws - (sl * (jx/127));
}
else // turn left
{
rws = sl * sf;
lws = rws - (sl * ((jx * -1)/127));
}
}
else // go backward
{
if (jx > 0) // turn right
{
lws = sl * sf;
rws = lws + (sl * (jx/127));
}
else // turn left
{
rws = sl * sf;
lws = rws + (sl * ((jx * -1)/127));
}
}
lwsi = lws;
rwsi = rws;
motor[motorD] = lwsi;
motor[motorE] = rwsi;

/// -- old --
// motor[motorD] = joystick.joy1_y1;
// motor[motorE] = joystick.joy1_y1;

//////------------ Drive Motor Speed Control-------END--------

motor[motorA] = joystick.joy2_x2;
motor[motorB] = joystick.joy2_x2;
servoTarget[servo1] = joystick.joy2_x2 + 127;
//servoTarget[servo3] = joystick.joy2_y1 + 127;
}}


Wed Dec 10, 2008 11:33 pm
Profile
Professor

Joined: Fri Sep 19, 2008 1:22 am
Posts: 200
Post Re: Motor out of Range Errors
What version of RobotC do you have installed? If you have upgraded from one version to another, did you completely uninstall the old version before installing the new version? What is the version number of the firmware on your NXT?

_________________
Jeff McBride
Benson Robotics Club


Thu Dec 11, 2008 12:29 am
Profile
Rookie

Joined: Thu Jan 08, 2009 7:51 pm
Posts: 25
Post Re: Motor out of Range Errors
In the Motor/Servo configuration page, you need to to open up the "FTC Servo/Motor Ctl" tab, click on the "Custom" radio button and adjust your setup accordingly. Each of the rows (S1, S2, etc..) represents a different sensor port on the NXT. I've included a screenshot that will show you how to configure it the way you want although I would recommend daisy-chaining the controllers together. Hope this helps.

Image

_________________
It must be user error.


Sun Jan 11, 2009 4:28 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 6 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.