![]() |
Need help with our deadspace.
This is what we are using for our deadspace. Only problem with it is that it jumps from being 127 to say 142 without slowly getting up to speed. We would like to make this much smooth. I am fairly new at robot language but have c++ experience if that helps any. Please reply if you can help thankyou.
temp2 = (unsigned int)p2_y; if (temp2 > (127 + DEADSPACE)) { pwm02 = 255 - (unsigned char)(((temp2 - (127 + DEADSPACE)) * (127 / (127 - DEADSPACE))) + 127); } else if (temp2 < (127 - DEADSPACE)) { pwm02 = 255 - (unsigned char)(temp2 * 127 / (127 - DEADSPACE)); } else { pwm02 = 127; } |
Re: Need help with our deadspace.
Quote:
Other users here may suggest alternatives to this. Programming that will apply the standard slope equation, Y=MX+B, is one of them. I find that calibrating the Victor is a little easier, but by no means is it "The Best" way to do it. |
Re: Need help with our deadspace.
Quote:
I also got around the fact that the Victor controllers see a value within about +/-7 units of 127 and just call it zero. If the value you want to send is less than 127, subtract an additional 7. If it is more than 127, add an additional 7: if ( val > 127 ) val += 7; if ( val < 127 ) val -= 7; The Victors have a calibration procedure designed to match them to your joystick, but I like to calibrate them to specific values, so I wrote some code that would produce 127s, then 0s when I pushed one button, then 255s when I pushed another (like I was swinging the joystick through its range). I used that while I calibrated the Victors. The Victor calibration procedure is explained in the Victor data sheet. |
| All times are GMT -5. The time now is 11:46. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi