Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Control System (http://www.chiefdelphi.com/forums/forumdisplay.php?f=177)
-   -   Disabling PWM outputs w/out disabling entire bot. (http://www.chiefdelphi.com/forums/showthread.php?t=97449)

flameout 19-09-2011 19:21

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.

PAR_WIG1350 19-09-2011 22:13

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.

flameout 19-09-2011 22:38

Re: Disabling PWM outputs w/out disabling entire bot.
 
Quote:

Originally Posted by PAR_WIG1350 (Post 1077685)
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.

Cuog 19-09-2011 22:58

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.

flameout 19-09-2011 23:04

Re: Disabling PWM outputs w/out disabling entire bot.
 
Quote:

Originally Posted by Cuog (Post 1077700)
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.

PAR_WIG1350 19-09-2011 23:32

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?

flameout 19-09-2011 23:46

Re: Disabling PWM outputs w/out disabling entire bot.
 
Quote:

Originally Posted by PAR_WIG1350 (Post 1077704)
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."

PAR_WIG1350 20-09-2011 00:14

Re: Disabling PWM outputs w/out disabling entire bot.
 
Quote:

Originally Posted by flameout (Post 1077707)
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.

flameout 20-09-2011 00:23

Re: Disabling PWM outputs w/out disabling entire bot.
 
Quote:

Originally Posted by PAR_WIG1350 (Post 1077718)
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?

AdamHeard 20-09-2011 00:26

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.

Cuog 20-09-2011 01:07

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.

flameout 20-09-2011 02:15

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.

AdamHeard 20-09-2011 02:30

Re: Disabling PWM outputs w/out disabling entire bot.
 
Quote:

Originally Posted by flameout (Post 1077735)
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.

flameout 20-09-2011 02:41

Re: Disabling PWM outputs w/out disabling entire bot.
 
Quote:

Originally Posted by AdamHeard (Post 1077737)
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.

Dave Flowerday 20-09-2011 10:58

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.


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

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