View unanswered posts | View active topics It is currently Sat Oct 25, 2014 11:59 pm






Reply to topic  [ 6 posts ] 
Joystick Control Help 
Author Message
Novice

Joined: Thu Oct 09, 2008 7:58 pm
Posts: 79
Post Joystick Control Help
Hello,

I was driving our FTC Robot today when i realized that the joystick controls were kind of funky. When I was driving the robot and the joysticks were pointed full forward, the robot went forward, but when i immediately moved the joysticks full backwards, the robot kept on going forward. When I let the joystick return to the center, the robot stops and then I am able to change directions.
Can someone please explain what could be going on.

Also, there is a function to make the robot not coast after the joystick value is at zero. It seems that our robot continues to coast. Could it be that
1. We're doing something wrong
2. The robot will still coast a little bit even though coasting is disabled?

Thankx.


Sat Nov 01, 2008 8:58 pm
Profile
Rookie

Joined: Wed Mar 05, 2008 11:37 am
Posts: 3
Post Re: Joystick Control Help
Hi Sunny:
I've seen this happen as well on my bot and based on what I learned from the webinars, it's a simple fix (at least in my case). If you not installed motor encoders on your bot, make sure that you uncheck PIDControl on the motor setup page. PID control is making it continue to drive straight even though you've slammed it in reverse and it takes a while to catch up. However, if there aren't any encoders feeding back to the NXT then the motors know enough to stay in synch and it takes awhile to sync.

As for the other question, I think you want to look at the bFloatDuringInactiveMotorPWM variable in the Motors help (turn on expert mode). I'm not sure about this one, but take a look at it because it talks about coast vs brake.

Mannie


Sun Nov 02, 2008 11:23 am
Profile
Creator
Creator

Joined: Fri Feb 09, 2007 9:21 am
Posts: 615
Post Re: Joystick Control Help
Sunny1261 wrote:
Hello,

I was driving our FTC Robot today when i realized that the joystick controls were kind of funky. When I was driving the robot and the joysticks were pointed full forward, the robot went forward, but when i immediately moved the joysticks full backwards, the robot kept on going forward. When I let the joystick return to the center, the robot stops and then I am able to change directions.
Can someone please explain what could be going on.

Was the problem that the motors never started going in reverse? Or was the problem that the motors seemed unresponsive and there was a noticeable delay before they started moving in reverse?

I have never seen the first problem, except with programming errors in user code. I'm not saying this is the cause in your case. Just that it might be.

The 12V motors are not as responsive as some other systems with smaller motors. You can notice a delay from when you've moved a joystick to when the motor has responded to the joystick command.
Quote:
Also, there is a function to make the robot not coast after the joystick value is at zero. It seems that our robot continues to coast. Could it be that
1. We're doing something wrong
2. The robot will still coast a little bit even though coasting is disabled?

Thankx.

See the comment posted elsewehre about the "float during inactive PWM" variable. It controls whether power level of zero is "coast" or "brake".


Mon Nov 03, 2008 3:44 pm
Profile
Novice

Joined: Thu Oct 09, 2008 7:58 pm
Posts: 79
Post Re: Joystick Control Help
1. Well, in our debugger window, we can actually see the joystick values *changing* so I'm guessing it must be something with the code. We'll double check everything to make sure.

2. I was not able to find other posts about float during inactive pmw, could someone provide a link?


Mon Nov 03, 2008 5:48 pm
Profile
Rookie
User avatar

Joined: Thu Nov 13, 2008 5:28 pm
Posts: 1
Location: Ogdensburg, NY
Post Re: Joystick Control Help
We've got the same problem with out bot - we were using the 2 Joystick Drive sample program on our 'bot to do an initial testing of the controls and wiring to make sure we didn't blow anything up :?, and for some reason after we let off the controls the motors started to twitch in either direction and just move by themselves. I do know we've got the PWM enabled and our encoders are properly connected to our controllers.

I made sure I wasn't hitting either stick when the robot was twitching around, and the Y1/Y2 values in the Debug screen stayed at -0 as they normally do.

What would it be in that case?

_________________
Image


Fri Nov 14, 2008 12:33 am
Profile
Rookie

Joined: Mon Nov 03, 2008 1:45 pm
Posts: 14
Post Re: Joystick Control Help
I wrote the following sample program to demonstrate the poor performance of the motors.

I have the motors set up with encoders disabled.

The program will beep the NXT each second and attempt to change the motor speed at that
same moment. One motor attempts a complete reversal (100 to -100) while the other motor
simply stops (100 to 0).

When you run the program, there is a short lag between the time the beep is heard and the time
that the first motor actually changes direction. However, the second motor stops and starts at the
same time as the beep (no lag).

So it appears to be something with the motor controller having to change directions without stopping first. I find this quite frustrating and expect that this will make autonomous and operator-control much more difficult. Any suggestions?

#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"

task main()
{
while (true)
{
PlaySound(soundShortBlip);
motor[motorD] = 100; // this motor should reverse direction after beep
motor[motorE] = 100; // this motor should start after beep
wait10Msec(100);
PlaySound(soundShortBlip);
motor[motorD] = -100; // this motor should reverse direction after beep
motor[motorE] = 0; // this motor should stop after beep
wait10Msec(100);
}
}

David Burnette
Tigard High School Robotics

_________________
David Burnette
Tigard High School Robotics


Fri Nov 14, 2008 11:47 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:  
cron



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