View unanswered posts | View active topics It is currently Fri Jul 25, 2014 1:10 pm






Reply to topic  [ 6 posts ] 
loaded 1.46 and now our servos don't work 
Author Message
Rookie

Joined: Sat Oct 18, 2008 3:29 pm
Posts: 4
Post loaded 1.46 and now our servos don't work
We loaded RobotC 1.46 today, and now our servo motors no longer operate. We loaded the sample program for the servos, and even this did not work. Any suggestions?


Sat Oct 18, 2008 3:36 pm
Profile
Expert
User avatar

Joined: Sat Sep 20, 2008 12:16 pm
Posts: 106
Location: Curently fighting aliens on P3X-828
Post Re: loaded 1.46 and now our servos don't work
Our motors won't work. There must be a bug with the firmware...

EDIT: Forgot the getJoystickSetings command... :oops:

_________________
:downloading:
Sorry, your program could not be downloaded. Please reboot your computer.
FTC Team #2959 Team Smash Bros CLICK HERE.(or click www)
Quote:
What the world needs is more geniuses with humility, there are so few of us left.

Agreed


Sat Oct 18, 2008 7:28 pm
Profile WWW
Site Admin
Site Admin

Joined: Wed Jan 24, 2007 10:42 am
Posts: 601
Post Re: loaded 1.46 and now our servos don't work
Did you uninstall your previous version of ROBOTC before installing 1.46?
Are your batteries charged?
Are your HiTechnic controllers attached to port 1 on your NXT?
Were your servos working before 1.46?
Is your power switch turned on?

Post the code that you are using to see if it is a programming issue.

Thanks.

_________________
Timothy Friez
ROBOTC Developer - SW Engineer
tfriez@robotc.net


Mon Oct 20, 2008 10:36 am
Profile
Rookie

Joined: Sat Oct 18, 2008 3:29 pm
Posts: 4
Post Re: loaded 1.46 and now our servos don't work
We uninstalled the previous version before loading 1.46.
The batteries are charged.
The HiTechnic controllers are attached to port 1.
The servos were working before we loaded 1.46.
Our power switch is on.
This is the code we are running:

#pragma config(Hubs, S1, HTMotor, HTServo, none, none)
#pragma config(Motor, mtr_S1_C1_1, motorD, tmotorNormal, openLoop)
#pragma config(Motor, mtr_S1_C1_2, motorE, tmotorNormal, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//

#include "JoystickDriver.c" //Include file to "handle" the BT messages.

task main()
{
while (true) //Loop forever
{
getJoystickSettings(joystick); //Update variables with current joystick values
motor[motorD] = joystick.joy1_y1; //Assign motorD (Motor 1) to the Left Y-Axis
motor[motorE] = -joystick.joy1_y2; //Assign motorE (Motor 2) to the Right Y-Axis

servoTarget[servo1] = joystick.joy2_x1 + 127;
//We're setting the servo's position here to the joystick's Left X-axis
//But since Servos range from 0-255 and Joysticks range from -127 to 127
//We'll add the lower limit of the joystick (127) to make the ranges match.

if(joy1Btn(1)) //If Joystick Button #1 is pressed
{
motor[motorA] = 50; //Turn NXT MotorA on at 50% power
}
else //If Joystick Button #1 is not pressed
{
motor[motorA] = 0; //Turn NXT MotorA on at 0% power (off)
}
}
}


Tue Oct 21, 2008 7:54 am
Profile
Site Admin
Site Admin

Joined: Wed Jan 24, 2007 10:42 am
Posts: 601
Post Re: loaded 1.46 and now our servos don't work
I think I may know what the issue is:
Code:
servoTarget[servo1] = joystick.joy2_x1 + 127;

This code will set the position of the servo to whatever the Left X-Axis value is on Joystick 2... I'm betting that you don't have a second joystick, but I could be wrong.

You should change his line of code to...
Code:
servoTarget[servo1] = joystick.joy1_x1 + 127;

That will make it run from Joystick 1.

The other thing to try is to set your servoTargets to specific position (like 100,200, 220) instead of joystick values in order to test it.

Also make sure you have the Joystick Debugger window open, or else you won't send any joystick messages and neither the servos nor motors will move.

_________________
Timothy Friez
ROBOTC Developer - SW Engineer
tfriez@robotc.net


Tue Oct 21, 2008 9:28 am
Profile
Rookie

Joined: Sat Oct 18, 2008 3:29 pm
Posts: 4
Post Re: loaded 1.46 and now our servos don't work
We finally figured this out. We reloaded all software and took everything apart and reassembled -- basically started over from the beginning. Turns out we had the cable hooked into the motor controller backwards. We did not realize the colors were not aligned properly! Once we flipped the cable, everything worked fine. Thanks for your help.


Wed Oct 29, 2008 6:07 pm
Profile
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.