Go to Post There is something to be learned (sometimes hard to find) from everyone you meet. - wireties [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 04-02-2008, 20:19
bizarospooky bizarospooky is offline
Registered User
FRC #2642 (Falconaters)
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2008
Location: North Carolina
Posts: 11
bizarospooky is an unknown quantity at this point
Re: Lag Issue

neat so, baisically ignore the function stuff and do something like in the operator control

If(Joystick_1(that's the desired)>rampspeed(that's the actual? with it starting at 127))
{
rampspeed+=2
SetPWM(1, rampspeed)
}

Something like that?
  #2   Spotlight this post!  
Unread 04-02-2008, 21:28
TubaMorg TubaMorg is offline
Programmermechanicalelect ricalcoach
AKA: Dan
FRC #1480 (Robatos Locos)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Houston
Posts: 450
TubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond repute
Re: Lag Issue

Quote:
Originally Posted by bizarospooky View Post
neat so, baisically ignore the function stuff and do something like in the operator control

If(Joystick_1(that's the desired)>rampspeed(that's the actual? with it starting at 127))
{
rampspeed+=2
SetPWM(1, rampspeed)
}

Something like that?
That will work, but I like how you break the steps out into functions. That's good style and will make it easier to tweak your code. Because you want to add limits (make sure rampspeed stays between 0 and 254), perhaps a deadband (127 +- 10 maybe), or maybe some PID (for greater control). Also consider how your code will handle different situations:

1. If you go from forward to reverse, do you really want to wait for your ramp to count through neutral before it changes direction?

2. If you are going full forward and need to stop (joystick in neutral) do you want to wait for the code to count to neutral?

Good luck!
  #3   Spotlight this post!  
Unread 06-02-2008, 15:59
Alexa Stott's Avatar
Alexa Stott Alexa Stott is offline
All I do is twin.
AKA: elixir
FRC #0025 (Raider Robotix)
Team Role: College Student
 
Join Date: Oct 2005
Rookie Year: 2006
Location: No. Bruns., NJ/College Park, MD
Posts: 781
Alexa Stott has a reputation beyond reputeAlexa Stott has a reputation beyond reputeAlexa Stott has a reputation beyond reputeAlexa Stott has a reputation beyond reputeAlexa Stott has a reputation beyond reputeAlexa Stott has a reputation beyond reputeAlexa Stott has a reputation beyond reputeAlexa Stott has a reputation beyond reputeAlexa Stott has a reputation beyond reputeAlexa Stott has a reputation beyond reputeAlexa Stott has a reputation beyond repute
Send a message via AIM to Alexa Stott
Re: Lag Issue

Correct me if I'm wrong, but, because the joysticks are analog devices, couldn't you just have your driver slowly ramp up the speed manually?

It would make your job as a programmer much easier and give your driver something to practice other than making left turns for hours on end.
__________________
|Email:alexastott[at]gmail.com|Facebook|@zelixir|Google+|
[University of Maryland Computer Science, Psychology]
[Brunswick Eruption]
  #4   Spotlight this post!  
Unread 07-02-2008, 12:33
TubaMorg TubaMorg is offline
Programmermechanicalelect ricalcoach
AKA: Dan
FRC #1480 (Robatos Locos)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Houston
Posts: 450
TubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond repute
Re: Lag Issue

Quote:
Originally Posted by Alexa Stott View Post
Correct me if I'm wrong, but, because the joysticks are analog devices, couldn't you just have your driver slowly ramp up the speed manually?

It would make your job as a programmer much easier and give your driver something to practice other than making left turns for hours on end.
You are correct. Joysticks are analog devices, however the analog signal is converted to a digital one which the program passes along as output to the Victor. Ideally you would like motor behavior to be linearly proportional to joystick input, but this isn't the case most of the time. Depending on robot and drive train design a small deflection from neutral joystick position can translate to a high speed reaction. Two-wheel drive robots with 2 motors on a single speed transmission often have this problem. Because of this drivers will find it impossible to have fine control of their robot because it goes from stop to very fast with very little user input.

The solution, therefore, is for the programmers to make the driver's job as easy as possible by providing a range of controllability (when desired) without sacraficing full speed and power. It is our view that controlling the robot should be as intuitive as possible so that robot responds as the driver desires in high-pressure game situations. The programmers on our team take input from the drivers seriously, because in the end they need to feel comfortable with the controls. This applies not only to how it drives, but which buttons should perform which actions.
  #5   Spotlight this post!  
Unread 08-02-2008, 17:31
ericand's Avatar
ericand ericand is offline
Registered User
AKA: Eric Anderson
FRC #3765 (Terrabots)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2004
Location: St. Paul, MN
Posts: 148
ericand is a jewel in the roughericand is a jewel in the roughericand is a jewel in the rough
Re: Lag Issue

Quote:
Originally Posted by bizarospooky View Post
neat so, baisically ignore the function stuff and do something like in the operator control

If(Joystick_1(that's the desired)>rampspeed(that's the actual? with it starting at 127))
{
rampspeed+=2
SetPWM(1, rampspeed)
}

Something like that?
That is the general idea. We actually did not take the joysticks directly either. We fit the joystick raw value to a curve such that large movements around neutral gave small changes in target speed, and small movements at the extreme ends gave larget changes in target speed.

For those that question ramping through zero on the way to reverse, we did do that, it helped avoid skidding/tipping. We had to work closely with the drivers though because a little ramp helps, but too much response lag makes controll feel mushy (hard to control).
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
digital inputs lag 0.5-1.0 second before registering change colman77 Programming 6 17-02-2006 12:40
Autonomous issue NJ M. Hicken Programming 2 16-02-2005 21:59
Software Issue patTeam241 Programming 0 28-01-2005 17:12
Lead-Lag Compensator eSouL Control System 0 13-08-2004 03:21
Less lag animation. Psy Guy 3D Animation and Competition 6 22-04-2003 00:18


All times are GMT -5. The time now is 23:47.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi