Go to Post "A robot can always be fixed but a match can never be replayed." - Brian C [more]
Home
Go Back   Chief Delphi > Technical > Control System
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 19-09-2011, 19:21
flameout flameout is offline
AKA Ryan Van Why
FRC #0957 (SWARM)
Team Role: Alumni
 
Join Date: Sep 2009
Rookie Year: 2009
Location: Oregon
Posts: 168
flameout is a name known to allflameout is a name known to allflameout is a name known to allflameout is a name known to allflameout is a name known to allflameout is a name known to all
Disabling PWM outputs w/out disabling entire bot.

We have been operating a mobile T-shirt launcher based on the IFI control system (we're using one from 2008, so it's the "2004 control system").

Although we already have a disable switch implemented on the control board (using the Competition Port on the OI), it would be nice to have an additional "disable drivetrain" mode that leaves the relay outputs operational (so the compressors are still running).

Since the joysticks are essentially uncalibrated (all our calibration is done with the victors), outputting a value of 127 does not guarantee a neutral output from our victors. Instead, I would like to disable the PWM outputs entirely.

The only way I've found to do this is to move the drivetrain outputs to PWM 13 and PWM 14, then make the call to Generate_Pwms() conditional on the state of the "drivetrain disable" switch.

Is there a better way to do this?

Thanks for any help.
  #2   Spotlight this post!  
Unread 19-09-2011, 22:13
PAR_WIG1350's Avatar
PAR_WIG1350 PAR_WIG1350 is offline
Registered User
AKA: Alan Wells
FRC #1350 (Rambots)
Team Role: Alumni
 
Join Date: Dec 2009
Rookie Year: 2009
Location: Rhode Island
Posts: 1,190
PAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond repute
Re: Disabling PWM outputs w/out disabling entire bot.

Or, you could attach the victors to a separate fuse panel with its own breaker so that you could turn on the main breaker for control system/ spike/ relay power while the victors would need both switches to be 'on' to receive power from the battery.
__________________
  #3   Spotlight this post!  
Unread 19-09-2011, 22:38
flameout flameout is offline
AKA Ryan Van Why
FRC #0957 (SWARM)
Team Role: Alumni
 
Join Date: Sep 2009
Rookie Year: 2009
Location: Oregon
Posts: 168
flameout is a name known to allflameout is a name known to allflameout is a name known to allflameout is a name known to allflameout is a name known to allflameout is a name known to all
Re: Disabling PWM outputs w/out disabling entire bot.

Quote:
Originally Posted by PAR_WIG1350 View Post
Or, you could attach the victors to a separate fuse panel with its own breaker so that you could turn on the main breaker for control system/ spike/ relay power while the victors would need both switches to be 'on' to receive power from the battery.
That would work, except I am looking for something that could be done remotely (I apologize for not making it clearer). Specifically, I'm looking for a better software solution (I'm not very familiar with the IFI system, so I might've overlooked a better way to do it).

Thanks for the help.
  #4   Spotlight this post!  
Unread 19-09-2011, 22:58
Cuog's Avatar
Cuog Cuog is offline
Registered Linux User: 390661
AKA: Alex
FRC #0422
Team Role: Mentor
 
Join Date: Nov 2005
Rookie Year: 2004
Location: Richmond, Virginia
Posts: 852
Cuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond repute
Send a message via AIM to Cuog
Re: Disabling PWM outputs w/out disabling entire bot.

You could use some small relay. http://www.mouser.com/ProductDetail/...KkytrQ6uppE%3d might be a bit overkill, but I'm sure you could find something similar.
__________________
KK4KQO
http://voltair.us
Too many projects, too little time.
  #5   Spotlight this post!  
Unread 19-09-2011, 23:04
flameout flameout is offline
AKA Ryan Van Why
FRC #0957 (SWARM)
Team Role: Alumni
 
Join Date: Sep 2009
Rookie Year: 2009
Location: Oregon
Posts: 168
flameout is a name known to allflameout is a name known to allflameout is a name known to allflameout is a name known to allflameout is a name known to allflameout is a name known to all
Re: Disabling PWM outputs w/out disabling entire bot.

Quote:
Originally Posted by Cuog View Post
You could use some small relay. http://www.mouser.com/ProductDetail/...KkytrQ6uppE%3d might be a bit overkill, but I'm sure you could find something similar.
Thanks -- but I've thought of using a relay already.

Let me add an additional constraint: I'm looking for a purely software solution (for the sake of space, reliability, and simplicity).

Thanks for the help.
  #6   Spotlight this post!  
Unread 19-09-2011, 23:32
PAR_WIG1350's Avatar
PAR_WIG1350 PAR_WIG1350 is offline
Registered User
AKA: Alan Wells
FRC #1350 (Rambots)
Team Role: Alumni
 
Join Date: Dec 2009
Rookie Year: 2009
Location: Rhode Island
Posts: 1,190
PAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond repute
Re: Disabling PWM outputs w/out disabling entire bot.

If you calibrate the victors such that 127 is neutral by using code rather than joysticks to calibrate them, why couldn't you just have a toggle switch on the OI to lock all pwm channels at 127?
__________________
  #7   Spotlight this post!  
Unread 19-09-2011, 23:46
flameout flameout is offline
AKA Ryan Van Why
FRC #0957 (SWARM)
Team Role: Alumni
 
Join Date: Sep 2009
Rookie Year: 2009
Location: Oregon
Posts: 168
flameout is a name known to allflameout is a name known to allflameout is a name known to allflameout is a name known to allflameout is a name known to allflameout is a name known to all
Re: Disabling PWM outputs w/out disabling entire bot.

Quote:
Originally Posted by PAR_WIG1350 View Post
If you calibrate the victors such that 127 is neutral by using code rather than joysticks to calibrate them, why couldn't you just have a toggle switch on the OI to lock all pwm channels at 127?
Because I'd be spending a large amount of time calibrating the joysticks in software -- it takes around 25 minutes to download new code and I'd have to "tweak" the center values several times to get it right (I could also display binary through the OI's LEDs to calibrate them, needing only 2 downloads). If a joystick's calibration changes (they're not exactly new, and I'm already noticing drift), or a joystick is replaced, I'd have to do it all over again.

That is a good idea, though; I'd just rather not calibrate them in software.

Thanks for the help.

Edit: To clarify, I think it's the "correct" solution, but I also think that it's more difficult to maintain than my "solution."

Last edited by flameout : 20-09-2011 at 00:00.
  #8   Spotlight this post!  
Unread 20-09-2011, 00:14
PAR_WIG1350's Avatar
PAR_WIG1350 PAR_WIG1350 is offline
Registered User
AKA: Alan Wells
FRC #1350 (Rambots)
Team Role: Alumni
 
Join Date: Dec 2009
Rookie Year: 2009
Location: Rhode Island
Posts: 1,190
PAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond repute
Re: Disabling PWM outputs w/out disabling entire bot.

Quote:
Originally Posted by flameout View Post
Because I'd be spending a large amount of time calibrating the joysticks in software -- it takes around 25 minutes to download new code and I'd have to "tweak" the center values several times to get it right (I could also display binary through the OI's LEDs to calibrate them, needing only 2 downloads). If a joystick's calibration changes (they're not exactly new, and I'm already noticing drift), or a joystick is replaced, I'd have to do it all over again.

That is a good idea, though; I'd just rather not calibrate them in software.

Thanks for the help.

Edit: To clarify, I think it's the "correct" solution, but I also think that it's more difficult to maintain than my "solution."
But you aren't calibrating the joysticks, your calibrating the victors.

To fix the joystick drift issues, designate a button that, when pressed, makes the current value the new center and, thus, send 127. Offset from center determines offset from 127.
__________________

Last edited by PAR_WIG1350 : 20-09-2011 at 00:19.
  #9   Spotlight this post!  
Unread 20-09-2011, 00:23
flameout flameout is offline
AKA Ryan Van Why
FRC #0957 (SWARM)
Team Role: Alumni
 
Join Date: Sep 2009
Rookie Year: 2009
Location: Oregon
Posts: 168
flameout is a name known to allflameout is a name known to allflameout is a name known to allflameout is a name known to allflameout is a name known to allflameout is a name known to all
Re: Disabling PWM outputs w/out disabling entire bot.

Quote:
Originally Posted by PAR_WIG1350 View Post
But you aren't calibrating the joysticks, your calibrating the victors.
Calibrating the victors isn't the hard part... the joysticks would still read something other than 127 when centered, and that has to be compensated for.

Quote:
Some trimmer pots connected to the OI and a few extra lines of code could compensate for drift in the joysticks and a toggle switch doesn't drift since it is either on, or not with nothing in between.
Adding in trimmer pots would be adding complexity mechanically/electrically, something I'm not inclined to do (it's something else to fall apart/get bumped on the OI). Also, a trimmer pot wouldn't be able to scale the joystick's input -- although the center would be at 127, the endpoints wouldn't be at 0 and 254 (I believe 0 to 254 is correct, although the exact values are unimportant for the point I'm trying to make).

What would the toggle switch be used for?
  #10   Spotlight this post!  
Unread 20-09-2011, 00:26
AdamHeard's Avatar
AdamHeard AdamHeard is offline
Lead Mentor
FRC #0973 (Greybots)
Team Role: Mentor
 
Join Date: Oct 2004
Rookie Year: 2004
Location: Atascadero
Posts: 5,526
AdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond repute
Send a message via AIM to AdamHeard
Re: Disabling PWM outputs w/out disabling entire bot.

Why not calibrate the Victors, then have a switch that sets all outputs to 127 rather than the joysticks.

Trivially simple.
  #11   Spotlight this post!  
Unread 20-09-2011, 01:07
Cuog's Avatar
Cuog Cuog is offline
Registered Linux User: 390661
AKA: Alex
FRC #0422
Team Role: Mentor
 
Join Date: Nov 2005
Rookie Year: 2004
Location: Richmond, Virginia
Posts: 852
Cuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond repute
Send a message via AIM to Cuog
Re: Disabling PWM outputs w/out disabling entire bot.

I'm starting to think that you're over-complicating the issue, then complaining when the solutions are complicated. No matter how you slice this pie, its going to take a little work, some added parts, or both.
__________________
KK4KQO
http://voltair.us
Too many projects, too little time.
  #12   Spotlight this post!  
Unread 20-09-2011, 02:15
flameout flameout is offline
AKA Ryan Van Why
FRC #0957 (SWARM)
Team Role: Alumni
 
Join Date: Sep 2009
Rookie Year: 2009
Location: Oregon
Posts: 168
flameout is a name known to allflameout is a name known to allflameout is a name known to allflameout is a name known to allflameout is a name known to allflameout is a name known to all
Re: Disabling PWM outputs w/out disabling entire bot.

Quote:
Why not calibrate the Victors, then have a switch that sets all outputs to 127 rather than the joysticks.
The joysticks don't read "127" when they're centered -- outputting "127" would cause the robot to move. It's not tough to find out exactly what needs to be output to stop the motors, but if (when) the joysticks drift, re-calibrating would require a code download to adjust for the new bias (not a big deal, unless the issue's discovered 5 min. before a presentation or something).

Quote:
I'm starting to think that you're over-complicating the issue, then complaining when the solutions are complicated. No matter how you slice this pie, its going to take a little work, some added parts, or both.
I'm comparing the solutions proposed with the solution I came up with (conditionally calling Generate_Pwms()). In terms of maintainability (which suffers (even if only a little) if I need to compensate for the joysticks' biases) and reliability (which suffers (even if only a little) with electrical solutions (I am referring to using a relay)), conditionally calling Generate_Pwms() appears (to me) to be the best solution so far.

Thanks for all the great solutions.
  #13   Spotlight this post!  
Unread 20-09-2011, 02:30
AdamHeard's Avatar
AdamHeard AdamHeard is offline
Lead Mentor
FRC #0973 (Greybots)
Team Role: Mentor
 
Join Date: Oct 2004
Rookie Year: 2004
Location: Atascadero
Posts: 5,526
AdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond repute
Send a message via AIM to AdamHeard
Re: Disabling PWM outputs w/out disabling entire bot.

Quote:
Originally Posted by flameout View Post
The joysticks don't read "127" when they're centered -- outputting "127" would cause the robot to move. It's not tough to find out exactly what needs to be output to stop the motors, but if (when) the joysticks drift, re-calibrating would require a code download to adjust for the new bias (not a big deal, unless the issue's discovered 5 min. before a presentation or something).
This isn't true. I spent years programming on the IFI system. If you calibrate the victors properly (which takes mere moments, and a BIC pen), and then specifically output 127, they will not move. Not tomorrow, not a year from now, never. I'm not saying let the joystick control it, I understand they drift. I'm saying have a switch, or trigger pull, or something to put it in "sit mode" where you tell it 127 specifically. This won't result in a much different system than just no calling the pwms, but it works perfect (and you can do it on more than 2 outputs).

We used to have a psuedo-disable that just 127'd all outputs and it was used routinely during programming/debugging. Hundreds of hours of robots with 6-10 victors all content with their neutral signal and never moving.
  #14   Spotlight this post!  
Unread 20-09-2011, 02:41
flameout flameout is offline
AKA Ryan Van Why
FRC #0957 (SWARM)
Team Role: Alumni
 
Join Date: Sep 2009
Rookie Year: 2009
Location: Oregon
Posts: 168
flameout is a name known to allflameout is a name known to allflameout is a name known to allflameout is a name known to allflameout is a name known to allflameout is a name known to all
Re: Disabling PWM outputs w/out disabling entire bot.

Quote:
Originally Posted by AdamHeard View Post
This isn't true. I spent years programming on the IFI system. If you calibrate the victors properly (which takes mere moments, and a BIC pen), and then specifically output 127, they will not move. Not tomorrow, not a year from now, never. I'm not saying let the joystick control it, I understand they drift. I'm saying have a switch, or trigger pull, or something to put it in "sit mode" where you tell it 127 specifically. This won't result in a much different system than just no calling the pwms, but it works perfect (and you can do it on more than 2 outputs).

We used to have a psuedo-disable that just 127'd all outputs and it was used routinely during programming/debugging. Hundreds of hours of robots with 6-10 victors all content with their neutral signal and never moving.
That's news to me... I'll have to try that out (since an unplugged joystick reads as exactly 127, it's a really easy thing to test).

Thanks for letting me know about that -- this is exactly the type of advice I was looking for. I'll let you know if it doesn't work for us -- I thought I tested this before (with differing results from what you obtained), but I wasn't very thorough about it.
  #15   Spotlight this post!  
Unread 20-09-2011, 10:58
Dave Flowerday Dave Flowerday is offline
Software Engineer
VRC #0111 (Wildstang)
Team Role: Engineer
 
Join Date: Feb 2002
Rookie Year: 1995
Location: North Barrington, IL
Posts: 1,366
Dave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond repute
Re: Disabling PWM outputs w/out disabling entire bot.

It's been mostly covered already, but please do not calibrate the victors for a center value other than 127. This is a serious safety hazard! If the joysticks on your OI become unplugged, the values will default to 127. If your victors are calibrated for something else, your robot will start moving! This is not good, especially since many people ignore the safety warnings and get too close to the robot to work on it or look at it when it's not disabled.

I strongly recommend that you write a "calibration program" that outputs 127 on all PWMs, and then can output 254 and 0 when two different buttons are pressed. Use this program to calibrate all your victors (this way they're also interchangeable). Then, write some code that deals with the joystick inputs. What you probably need is a dead zone, so that any joystick values from say 117-137 get mapped to an output of 127. If you search around CD, there should be many code examples of joystick code for dead zones & scaling. I'm sure it seems like more work to you, but this really is the correct (and safe) way to implement this. Then, you can easily have a switch that forces all outputs to 127.

My understanding of the way the IFI RC works is that there will be no way to keep the relay outputs enabled while simultaneously disabling the PWMs, other than the user-generated PWM functions that you've found. But be aware that those user PWMs can be jittery if your code is too complicated, and this can cause your motors to twitch and move even when you are outputting a neutral value of 127.
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


All times are GMT -5. The time now is 11: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