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)

Racer26 20-09-2011 11:23

Re: Disabling PWM outputs w/out disabling entire bot.
 
Seems to me the easier solution is to just fix your compressor such that its relay is switched on by the pressure switch, and take the RC completely out of the compressor equation.

Joe Ross 20-09-2011 11:35

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

Originally Posted by Dave Flowerday (Post 1077770)
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.

The jitter only occurred with the IFI default code. Kevin Watson released code to use onboard PWM generators on the PIC which fixed that issue. http://www.kevin.org/frc/ look for frc_pwm.zip. It's also included in his code that's compatible with version 3 of the C18 compiler.

Mark McLeod 20-09-2011 11:48

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

Originally Posted by 1075guy (Post 1077777)
Seems to me the easier solution is to just fix your compressor such that its relay is switched on by the pressure switch, and take the RC completely out of the compressor equation.

P.S. I didn't read closely enough. You clearly said switch the relay.

Don't wire the pressure sensor directly in-line with the Spike. The pressure switch (5 amps) isn't rated for the current draw of the new or old compressor (10 amps), or the peak at startup of 25 amps.
That 25 amp startup is also why FIRST recommends that the 20a fuse in the Spike be replaced with a self-resetting 20a breaker.

Jon Stratis 20-09-2011 11:54

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

Originally Posted by Mark McLeod (Post 1077781)
The pressure switch isn't rated for the peak current draw of the compressor as it starts up.
It's only rated for 5 amps.

Very true (our mechanical team blew a switch doing exactly that one summer... they never asked the electrical team to hook it up for them or we would have done it right). However, the switch can be used as signal inputs directly into a relay - then the relay handles the big current load, while the switch needs a much smaller current to activate the relay.

flameout 20-09-2011 14:08

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

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.
Thanks for mentioning a dead zone -- I've never thought about it for this one bot before, but we really need it.

Quote:

Kevin Watson released code to use onboard PWM generators on the PIC which fixed that issue.
I had forgotten about his libraries -- I see he also has an EEPROM library, which would make maintenance of solutions based on joystick calibration easier (I didn't think about using non-volatile memory for calibrations until I saw that).

Quote:

Seems to me the easier solution is to just fix your compressor such that its relay is switched on by the pressure switch, and take the RC completely out of the compressor equation.
That's an angle that I've never thought about. Unfortunately, though, the compressor logic is more complicated -- the drivers can enable or disable the compressors through the controls (the bot is used for more than just t-shirt launches, so pneumatics aren't always needed or desired).

Thanks for all the help -- I'll write a joystick calibration routine that saves the values to the EEPROM, then just set the outputs to 127 to "disable" the bot.

PAR_WIG1350 20-09-2011 15:19

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

Originally Posted by flameout (Post 1077724)
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?

I amended my post Seconds After I posted it, It no longer suggests trimmers, but rather a method of on the fly calibration. Which I now no longer recommend. If you are still worried about drift, program it such that any joystick input from 117 to 137 sends 127 to the victors.

The toggle switch would tell the robot to ignore the joystick values and send 127 to the victors no matter what as long as the switch is 'on'.


All times are GMT -5. The time now is 16:10.

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