|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: Motor in Autonomous?
I just had a quick question about that my team is doing the same code but with different motors. But we want that the sequence repeats itself 3 times(For each frisbee) and then it sets the output of those motors to 0, how would I do that?
|
|
#2
|
||||
|
||||
|
Re: Motor in Autonomous?
Quote:
Separate out the last frame (the set all to zero) and place the three Motor Set output out off to the right. (remove the last empty frame). Wire up the 3 MotorControlDevRef to each of the three. Then put a For Loop around JUST the "Flat Sequence Structure". Do not include the three (3) "MotorContolRefNum Registry Get" keep them off to the left or the last three Motor Sett Output keep them off to the right. Right click on the Auto Indexing terminals on the right side of the For Loop where the wires are now broken and select "Tunnel Mode > Last Value" Create a constant from the For Loop Count Terminal [N] and set it to '3' Last edited by Omar : 19-02-2013 at 11:28. |
|
#3
|
|||
|
|||
|
Re: Motor in Autonomous?
I am still confused on implementing what you just described me. Can you possibly show me an code that explains what you mean. Is it suppose to look like this?
|
|
#4
|
||||
|
||||
|
Re: Motor in Autonomous?
That look pretty good.
Does it work? 3 sec seems a little long for some of the shooter that I have seen. One team that I work with has a rotating cam action and they fire very close to 1 per sec. I have one team that used a while loop instead of a for loop to run for the whole 15 secs. It just kept shooting even when there were no disc to shoot. It helped with a retry when one disc failed to drop into position at first. Last edited by Omar : 19-02-2013 at 13:36. |
|
#5
|
|||
|
|||
|
Re: Motor in Autonomous?
"Right click on the Auto Indexing terminals on the right side of the For Loop where the wires are now broken and select "Tunnel Mode > Last Value"
This is the part I don't quiet understand I can't find those broken wires. I right click on the FOR Loop but I don't get one of those options. How would you do it using a While Loop? An No we hadn't tested it yet. |
|
#6
|
||||
|
||||
|
Re: Motor in Autonomous?
The pic posted by Ben (BPtigers) had four sections with the last sections where he stops all the motors at the end (writes zeros).
To keep the shooter motors spinning in between disc you don't want to stop them until all 3 disc are shot. So I instructed you to keep those outside of the for loop. But you only used 3 sets of controls (which is perfectly OK) and did not use the last set after the For Loop (again no problem). If you had done as I had suggested and wired up the thick pink Ref wire to VIs to right of the For Loop, the For Loop defaults to "Auto Indexing" and you would have gotten an Array of pink Ref. The "Motor Set Output" VI to right do not accept Arrays as input. So you need to tell the For Loop not to Auto Index. Try it! Put a "Motor Set Output" outside to the right of the For Loop and wire one of the pink Ref wires from inside the for loop to it. You should get a broken wire. Then fix the broken wire by Quote:
Smart autocorrecting autoindexing |
|
#7
|
|||
|
|||
|
Re: Motor in Autonomous?
I think I got it! Is it suppose to look like this?
So I want the shooters(1+2) to be on all 15 seconds. An then we shoot a frisbee, load again, and then shoot again two times. |
|
#8
|
||||
|
||||
|
Re: Motor in Autonomous?
Yes that looks correct as far as the LabVIEW programming.
But I do not know the finer details of YOUR system so you have to fine tune it. Do you need to move 3 disc or only 2 disc into the Shooter? From your delays, the For Loop will take more than 20 sec to cycle two times. The 15 sec Autonomous will abort this code before it has time to finish. Also I see some code above this that seems to move your robot. Do you need to wait until the robot is at "stand still" before firing disc? Then you will need to work on that in a similar way. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|