|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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
|
||||
|
||||
|
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
|
|||
|
|||
|
Re: Disabling PWM outputs w/out disabling entire bot.
Quote:
Thanks for the help. |
|
#4
|
|||||
|
|||||
|
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.
|
|
#5
|
|||
|
|||
|
Re: Disabling PWM outputs w/out disabling entire bot.
Quote:
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
|
||||
|
||||
|
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
|
|||
|
|||
|
Re: Disabling PWM outputs w/out disabling entire bot.
Quote:
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
|
||||
|
||||
|
Re: Disabling PWM outputs w/out disabling entire bot.
Quote:
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
|
|||
|
|||
|
Re: Disabling PWM outputs w/out disabling entire bot.
Quote:
Quote:
What would the toggle switch be used for? |
|
#10
|
|||||
|
|||||
|
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
|
|||||
|
|||||
|
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.
|
|
#12
|
|||
|
|||
|
Re: Disabling PWM outputs w/out disabling entire bot.
Quote:
Quote:
Thanks for all the great solutions. |
|
#13
|
|||||
|
|||||
|
Re: Disabling PWM outputs w/out disabling entire bot.
Quote:
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
|
|||
|
|||
|
Re: Disabling PWM outputs w/out disabling entire bot.
Quote:
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
|
||||
|
||||
|
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. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|