Button conundrum

We are using joytick buttons to toggle our intake rollers. Our programming team has put together the VI attached, but only one set actually works. To the naked eye, they appear that they should work, but don’t. I’m hoping another set of eyes can find the problem. Thanks in advance.





Shouldn’t the bottom right Motor output be Motor C instead of Motor B?

The other issue is you appear to have lots of potential race conditions, because you set the same motor in multiple places.
Typically, you should have only one Motor Set Output for each motor and the Case statements just decide on the final value being sent to the motors.

Yiou need to enforce a precedence.

You can’t use multiple Motor Set Output functions for the same motor at the same time and expect consistent results. One of them will “win”, though predicting which one gets executed last is generally not possible.

What you need to do is find a way to choose among the possible motor output values and feed them to a single Set Output. You can use Case blocks in series, or use cascaded Select functions (my personal preference).

Thanks! Just made that change and deployed. Button B works like a champ (always has), but the rest produce at best, a sputter, as if they are working against each other.

May I ask the favor of assuming my programmers are neophytes and how (hopefully in pictures) you would program this? Programming is not my area of expertise and my kids like pictures! They do most of their work learning on the fly with examples.

Again, many thanks.

I know that I’m responding a request with a question, but is the button control the only way the kids can can control the intake direction? Do you have a joystick that could be utilized?

Yes, we have a fourth and I have suggested we run that in arcade mode, but they adamantly want to use the buttons to intake, expel and rotate the tubes.

If push comes to shove and we have to have something that works, we can go with joystick four.

Here’s one way.

P.S.
Double-check the values. I may have mistyped some of them…





Joystick 3 is an Xbox Controller. You should be able to reassign to your inputs.
Axis 5 is the Y component of a joystick. Moving foward or rearward on the joystick results in expelling or pulling-in the tube.
Throttle 3 (a trigger) which reverses one motor direction to roll the tube in either direction.
Also, better to use motor vi(s) than drive vi(s) for this.





Very interesting! From the best I can tell, your VI is a single pivot arm?

Not part of the subject matter, but for our Arm Control, yes, yes it is. We are using an elevator mechanism to manage the gross movement and the arm pivot for fine adjustment.

For your intake system, you should have enough options to choose from.

The only reason I asked is because we are utilizing a two-pivot arm with the X and Y controlling the shoulder and elbow joints. Don’t know if we can control the pivots and use the 360 buttons without seriously confusing a driver.

From my limited experience as a mentor, the kids are more adapatable than you think. Ask them! Xbox controllers are favored from our drive teams becasue of their familiarilty. Buttons are accessible as well as the dual joystick feature, but is food for another thread.

Mark,
I put together the button structure exactly as you indicated; however, now the only button to repsond is the last one on the list/cascade, button 5. I am at a loss. Any ideas?

Did you wire each input directly through to the associated output in every “false” case, as shown in the grayed out block?

Try something like this and tell me if it does the expected. (its functionally the same as Mark’s, but Mark’s does exactly what you want it to). I’m pretty sure if Mark’s didn’t work this won’t, but trying this is better than trying nothing.

Belay that last request; the false structures were not repaired. Works like a champ! Thanks Mark and everyone else!