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.