|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: Check My Autonomous Code
I didn't really edit any of your code. You had a floating number and boolean that I deleted, and I move a few elements around to better document it.
|
|
#2
|
|||
|
|||
|
Re: Check My Autonomous Code
You think the bottom code will work now? How about the virtual digital inputs?
|
|
#3
|
||||
|
||||
|
Re: Check My Autonomous Code
No, the bottom code won't work. Check out the comments I left in the code.
|
|
#4
|
|||
|
|||
|
Re: Check My Autonomous Code
Quote:
To give you more insight of how the arm works, I'll describe it to the best of my ability. It starts straight up, then rotates down to I guess to be something like a 115 degree angle or whatever needed to tilt the bridge on our robot. At that lowest point, there is a limit switch to make the output 0. I am trying to make this autonomous work where when it moves to that sequence, the arm will rotate down at 1, then hit 0 when limit switch is hit. I'm definite the logic is correct as it is also used in my teleop. |
|
#5
|
||||
|
||||
|
Re: Check My Autonomous Code
Quote:
Let me step you through your own logic. We're looking at this code right here: Let's clean it up to view everything a little better: Now let's minimize the code, removing code that does nothing. Step 1: Step 2: Step 3: Please let me know if you do or do not understand this. The reason it all cancels out to a False is because you're using an AND gate, meaning both input X AND input Y must be True in order for the Output to be True. |
|
#6
|
|||
|
|||
|
Re: Check My Autonomous Code
Quote:
|
|
#7
|
||||
|
||||
|
Re: Check My Autonomous Code
Keep me informed. I'm wanting to get it working for you.
|
|
#8
|
|||
|
|||
|
Re: Check My Autonomous Code
I just looked over the code again. I left the logic you were talking about the same as I feel safer keeping it the way I've always done limit switches since I know it works. I'm not doubting your suggestions, I would just like to keep it the way it is.
The new code is in my previous response in the zip attachment. |
|
#9
|
||||
|
||||
|
Re: Check My Autonomous Code
Well, I'm going to tell you right now, it's will not work. I cannot explain it any further. Maybe someone else can look at your code and help you. I've done all I can do.
|
|
#10
|
|||
|
|||
|
Re: Check My Autonomous Code
Quote:
I highly recommend looking through Ryan's images above, step by step to see why your logic doesn't work the way you want it to (in addition to the fact that the code for the bottom mode isn't in a loop). |
|
#11
|
|||
|
|||
|
Re: Check My Autonomous Code
Quote:
Look for limit switch example. It works. All I'm trying to do is get the robot to move the distance to the bridge using the encoders. Stop when the distance has been met, then lower the bridge arm down until the limit switch is hit. I'm a second year programmer who has never had experience with autonomous. Last year I never even got to it as I started programming in week 4(Conversation for a different thread). I will easily admit I'm not too confident in writing the bottom code, and that is why I came here. All I'm asking for is some help. My competition begins tomorrow, and I would love if I could get this to work. Come on and help me out |
|
#12
|
|||
|
|||
|
Re: Check My Autonomous Code
Quote:
I highly recommend you be ready to disable the robot when testing that code to avoid breaking the arm and that you seek out an experienced LabVIEW team and/or the CSA at your event to help you out. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|