![]() |
Off season Questions **Need Help Asap/Code Check**
1 Attachment(s)
Hello,
We have recently made changes to our breakaway! robot and are attending CAGE Match. With the recent changes I just wanted to double check some programming thing before we get the robot ready to leave. A) The purpose of the code: When button 6 is true the motor goes forward (aka lifting the lifting device). When False the speed is set to 0. When button 7 is activated, the lifting device is lowered. (Pictured Below) B) I really needed to reduce the sensitivity of our drive system. I tried a method of hooking buttons up to cases and then multiplying the motor speeds by .5. However, when I built and deployed the code, all I got was watchdog errors. Is there any example code or anything of a simple drive system sensitivity system. Thanks, Dustin Shadbolt |
Re: Off season Questions **Need Help Asap/Code Check**
I cannot tell from the code you posted what might be causing the watchdog error since there is nothing I can see that would cause the error.
Watchdog errors are often caused by a loop in the code that does not feed the watchdog before the watchdog times out. You can quickly confirm the code you added is not the problem by removing it and retesting. If the errors continue, the problem is somewhere else. |
Re: Off season Questions **Need Help Asap/Code Check**
A Watchdog error could also be cause if you have connected a watchdog to a "Everlasting loop". The watchdog would have to wait for that everlasting loop until it can continue to the next task, but if you have connected it to a case that never stops, the watchdog is not going to move on.
Check if you have connected a loop that runs forever before watchdog can move on. That was our problem and we fixed it by rechecking this. |
Re: Off season Questions **Need Help Asap/Code Check**
I agree. However, there might be a problem if the driver were to press button 6 and 7 at the same time. I would change the logic selecting the case statements, the first one would be button6 AND !button7; and the second would be button7 AND !button6
|
Re: Off season Questions **Need Help Asap/Code Check**
There's also a problem with the snippet you posted if both underlying FALSE cases are setting the motor speed to 0.
They will be contradicting the other button's TRUE case. You only want to set the motor speed to zero if both buttons are FALSE. ---------- Using one of the joystick throttles for adjusting sensitivity would give you the most control. |
Re: Off season Questions **Need Help Asap/Code Check**
@Mark
How would you go about doing that? |
Re: Off season Questions **Need Help Asap/Code Check**
1 Attachment(s)
Here's a sample of what I mean about using the throttle to adjust the sensitivity.
I didn't include the corrected button logic. |
Re: Off season Questions **Need Help Asap/Code Check**
Quote:
Wire a constant 0 into the first block, connect Button 6 to its select input, and in its false case just pass the input through to an output. In its true case, connect a constant 0.5 to the output instead. Wire the output of the first block into the second block, connect Button 7 to its select input, and in its false case just pass the input through to an output. In its true case, connect a constant -0.5 to the output instead. Feed the output of the second block into the Set Motor vi. Done! This makes the "down" button take priority over the "up" button. Change the order of the case blocks if you want the "up" to override the "down" instead. For this kind of thing I would actually use select functions instead of case blocks, but that's not a big deal. |
Re: Off season Questions **Need Help Asap/Code Check**
3 Attachment(s)
Thanks guys. I think I have it fixed now. I will try it tonight at the shop and post my results.]\
-- Results-- Below I have included pictures of the section of code I'm wondering about. (I fixed the watch dog error thanks to whcirobotics and I got a rough version of motor sensitivity down.) This is the code that Alan suggested (well as I could understand from the text). Should it function properly? :) |
Re: Off season Questions **Need Help Asap/Code Check**
Another way to do this would be to do an Exclusive OR of the Button6 and Button7 values and feed the result into a case.
False would set the motor speed to zero. True would feed the value of Button7 into and If, the true leg = +1, false leg = -1. Output of IF would be multiplied by .5 and fed to motor speed. The Labview XOR looks like this: ![]() XOR returns FALSE if both values are either TRUE or both values are FALSE, otherwise it returns TRUE. |
Re: Off season Questions **Need Help Asap/Code Check**
Quote:
|
Re: Off season Questions **Need Help Asap/Code Check**
Thanks Alan. It makes total sense now after seeing it done. I can't believe I didn't think of doing it that way before.
|
Re: Off season Questions **Need Help Asap/Code Check**
Quote:
The TechnoKats 2009 robot had several motors that were used as either off, fixed speed forward, or fixed speed reverse. Our code got a lot less cluttered when we build a subVI to handle that function. Given a motor reference and a pair of button inputs, it did exactly what you were asking for. The forward and reverse speed values defaulted to +/- 1, but could be overridden by additional inputs. We also added limit switch inputs to disable travel in one or the other direction. That exact subVI wasn't reused in 2010 because it had never been published and was therefore not strictly legal for the new season according to the manual, but it was only a matter of minutes to recreate it from the basic concept. If we need it again next year, we know how to do it, and we'll probably put it out for public enjoyment this time. |
Re: Off season Questions **Need Help Asap/Code Check**
Quote:
![]() |
| All times are GMT -5. The time now is 10:07. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi