Help for 2012 Science Olympiad Competition!

Okay, so I gave both changes a try, but no luck. :frowning:
Any other ideas?

Dude, you must take more initiative. You must use more words. Illustrate the changes you made and document the results in a more specific way. Basically Kurt’s doing your homework. He would much rather help you learn than do it for you. If he’s doing more typing than you are something’s wrong. I’m sorry but it had to be said.

Initiative, huh?
Okay well, Kurt I apologize for making you do a lot to help me. If I knew anyone else who had any idea about programing, Id be asking them. I have no knowledge of programing at all, so I’m sorry for inexpirience. Anything I do know is either because of things you explained to me, or things that are obvious.

Anyways, heres what I did:

I went to the portion of the program for the L1 and L2 buttons

IF (DualShock(2).bit2 = 0) AND (GripperPressure>GripperHoldPressure) THEN ;L1 Button test TargetGripper1 = (TargetGripper1-40) min Gripper_MIN ;Gripper Close ENDIF
I did what you suggested and changed that 40 to a 60. No luck…but is that all you need to do? I feel like something else needs to be changed along with that. I even took the number higher than 60… like 90 and 100, but no change.

I also attempted the bytetable addition:

abGOModifier bytetable 20, 40, 60, 80 ; Gripper Opening/Closing Speed (L1/L2)
Why is this a ā€œModifierā€ instead of a ā€œSpeedDivisorā€? What do these numbers represent? I put this below the other changes you made in the Bytetable, and kept those numbers the same.
I also did the thing after that, which was to change the number in the L1 and L2 button tests like above^^ with abGOModifier(ArmSpeedSelect) there to replace it. No luck either…I even tried changing the numbers in the Bytetable that you originally set:

abWXSpeedDivisor bytetable 18, 12, 8, 4 ; Wrist Pos X Speed divisor (Left joy stick Left/right) abWYSpeedDivisor bytetable 18, 12, 8, 4 ; Wrist pos Y (Left Joy stick up/down abBSpeedDivisor bytetable 8, 4, 3, 2 ; Base rotate speed (Right Joystick Left/Right) abGSpeedDivisor bytetable 4, 3, 2, 1 ; Gripper Angle speed (Right Joystick Up/Down) abGOModifier bytetable 20, 40, 60, 80 ; Gripper Opening/Closing Speed (L1/L2)
I wanted the speed of the base and wrist to be sped up while keeping the rest of the arm at a contolable speed, but when I tried changing the numbers next to bytetable, nothing seemed to change. None of these numbers above are changed to what I thought would work because I dont think changing them is enough.

From Teacher Mr Black
To :Boss
Please be patient with my students. As I said on the phone before… We are just learning all this. We had many problems with your program from the tutorial. Honestly my student was very upset with your comments. I know it is hard to read tone from text, but it was a little rough for you to say to a high school kid, who is trying really hard to learn all of this robotics programming. We appreciate all of the forums help in our endeavor to learn robotics programming, but again we are new to this and side on the expertise of the forum to help. By no means do we want someone to do our work, we are looking for guidance and assistance. We have purchased a good amount of equipment’s from you. Two arms, Johnny 5, track system, batteries, arms, cords, servos etc. And in the future with PLTW at our school we plan on more. So please do understand that we are working very hard to understand this process, not just for Science Olympiad but for future plans in robotics at our school.

Kurt
Thank you for all the time you have given to my students. Your help and guidance is truly appreciated.

Hi Mr Black,

I think all that Jim was simply trying to say, is that it can be difficult and at times frustrating to help when we don’t have enough feedback on what you have tried or not tried… Also in the past have run into many instances when students were simply trying to get someone else to do the work for their homework or class assignment, so it also helps to know that the instructor is on board…

My current program is currently in a state of being torn apart to try out some other end point conditions and is not working at this point…

But for the wrist rotate and close functions, it would help to see what you are doing. For example did you change the code for both L1 and L2, likewise for R1 and R2… My current stuff looked like:

abGOModifier bytetable 20, 40, 60, 80 ; Gripper Opening/Closing Speed (L1/L2) abWAModifier bytetable 20, 40, 60, 80 ; Wrist Angle (R1/R2)

[code] IF (DualShock(2).bit2 = 0) AND (GripperPressure>GripperHoldPressure) THEN ;L1 Button test
TargetGripper1 = (TargetGripper1-abGOModifier(ArmSpeedSelect)) min Gripper_MIN ;Gripper Close
ENDIF

IF (DualShock(2).bit0 = 0)THEN ;L2 Button test
    TargetGripper1 = (TargetGripper1+abGOModifier(ArmSpeedSelect)) max Gripper_MAX ;Gripper Open
ENDIF		

IF (DualShock(2).bit3 = 0) THEN	;R1 Button test
    TargetWristAngle1 = (TargetWristAngle1-abWAModifier(ArmSpeedSelect)) min WristRotate_MIN ;Wrist Rotate CW
ENDIF

IF (DualShock(2).bit1 = 0) THEN ;R2 Button test
    TargetWristAngle1 = (TargetWristAngle1+abWAModifier(ArmSpeedSelect)) max WristRotate_MAX ;Wrist Rotate CCW
ENDIF	

[/code]

But as you mentioned this is not helping… So then you start to debug. If you for example search for TargetWristAngle1… You will soon see:

;Limit wristrotate max speed IF (ABS(WristRotateAngle1-TargetWristAngle1) > MaxStepWristAngle) THEN IF ((WristRotateAngle1-TargetWristAngle1) >= 0) THEN WristRotateAngle1 = WristRotateAngle1 - MaxStepWristAngle ELSE WristRotateAngle1 = WristRotateAngle1 + MaxStepWristAngle ENDIF ELSE WristRotateAngle1 = TargetWristAngle1 ENDIF
So then you see that the code wont allow it to move any quicker than some value: MaxStepWristAngle, so then you look this up and see:

MaxStepWristAngle	con 40

So while are code allows it to go faster it gets limited back to 40. So try changing this 40 to 60 or 80 and see what that does.

Hope that helps.

Kurt

Back on a more positive side. I have been playing around some more with the code. I am trying to add in additional stuff to keep the arm from some of the radical arm movements. Found an issue with the basic function SQR was failing when the value that you were trying to get the square root from would return a value greater than 32767. So added a workaround.

Also in the previous post mentioned debugging some more time debugging the speed of the gripper close and wrist rotate and made some additional changes to allow them to also be controlled by the ā€œGearā€ value that I added in for the other arm speed movements…

There may still be some additional things that can/should be done to better handle the end cases of when the arm is at or near it’s maximum extent, but I do think it is better!

Hope you enjoy.

Kurt
ps2arm2.bas (41.3 KB)

Thanks again Kurt, the Gripper and Wrist rotate are moving fine. One paticular thing I did notice is that the left joystick contols have been reversed… now the Up/Down stick motion has the shoulder moving forward and backwards and the Left/Right stick motion has the Elbow moving up and down instead of vice versa. The servos are plugged into the correct spots on the SSC-32 if that would affect it otherwise. How could what you changed change the controls of the Arm?
Also I’m still confused on how to change the speeds of the Gripper and Wrist, I would like them to be going faster than the arm while the arm remains controlable, so they stay faster than the arm no matter what. Heres what I tried:

I took the bytable Modifier values for the Gripper and Wrist and tried to make them all 80…if 80 is being the top speed of the update you added for the Gripper and wrist.

abGOModifier bytetable 80, 80, 80, 80 ; Gripper Opening/Closing Speed (L1/L2) abWAModifier bytetable 80, 80, 80, 80 ; Wrist Angle (R1/R2)

Nothing changed as a result of this… Is it because there cant be more than one of the same values in that section of the table?
I checked down here to see what I could change, but everything seems like its set to work with the values in the table. What else needs to be changed?

[code]IF (DualShock(2).bit2 = 0) AND (GripperPressure>GripperHoldPressure) THEN ;L1 Button test
TargetGripper1 = (TargetGripper1-abGOModifier(ArmSpeedSelect)) min Gripper_MIN ;Gripper Close
ENDIF

IF (DualShock(2).bit0 = 0)THEN ;L2 Button test
    TargetGripper1 = (TargetGripper1+abGOModifier(ArmSpeedSelect)) max Gripper_MAX ;Gripper Open
ENDIF		

IF (DualShock(2).bit3 = 0) THEN	;R1 Button test
    TargetWristAngle1 = (TargetWristAngle1-abWAModifier(ArmSpeedSelect)) min WristRotate_MIN ;Wrist Rotate CW
ENDIF

IF (DualShock(2).bit1 = 0) THEN ;R2 Button test
    TargetWristAngle1 = (TargetWristAngle1+abWAModifier(ArmSpeedSelect)) max WristRotate_MAX ;Wrist Rotate CCW
ENDIF	[/code]

Not sure about Shoulder versus elbow here, would probably have to investigate…

As for wrist speed… Did you also check the code, that used to look like:

;Limit wristrotate max speed IF (ABS(WristRotateAngle1-TargetWristAngle1) > MaxStepWristAngle) THEN IF ((WristRotateAngle1-TargetWristAngle1) >= 0) THEN WristRotateAngle1 = WristRotateAngle1 - MaxStepWristAngle ELSE WristRotateAngle1 = WristRotateAngle1 + MaxStepWristAngle ENDIF ELSE WristRotateAngle1 = TargetWristAngle1 ENDIF

Where the code use to have:

MaxStepWristAngle   con 40

On my version I changed that section, to look more like:

;Limit wristrotate max speed IF (ABS(WristRotateAngle1-TargetWristAngle1) > abWAModifier(ArmSpeedSelect)) THEN IF ((WristRotateAngle1-TargetWristAngle1) >= 0) THEN WristRotateAngle1 = WristRotateAngle1 - abWAModifier(ArmSpeedSelect) ELSE WristRotateAngle1 = WristRotateAngle1 + abWAModifier(ArmSpeedSelect) ENDIF ELSE WristRotateAngle1 = TargetWristAngle1 ENDIF
As I mentioned not sure about the other change in behavior you mentioned. Will have to investigate when everything is back in one piece.

Kurt

I have changed that and it has had been working good… right here:

;Limit wristrotate max speed IF (ABS(WristRotateAngle1-TargetWristAngle1) > abWAModifier(ArmSpeedSelect)) THEN IF ((WristRotateAngle1-TargetWristAngle1) >= 0) THEN WristRotateAngle1 = WristRotateAngle1 - abWAModifier(ArmSpeedSelect) ELSE WristRotateAngle1 = WristRotateAngle1 + abWAModifier(ArmSpeedSelect) ENDIF ELSE WristRotateAngle1 = TargetWristAngle1 ENDIF

So thats right. But I think Ive found a bug in the program…Im just not sure when or whats making it do this. Its similar to how the older, original program had the arm face-planting on to the table. It seems that when the arm movement goes down to pick up things that are closer to it, it just smacks the ground. If this help you make any diagnosis, here:


Sorry about the camera angle change…it was with an ipad, and a questionable camera man.
Any clearifications of this are welcome^^

I know you said your programs in pieces and things arent set up, so if you can tell me anything to do just by looking at this video, Id apreciate it. We need this thing for Saturday! :astonished:

I now have my new system limping along and the Arm more or less back in one piece. Hard to tell what is going on in your video. Would help to compare versions of the code. So it might help if you uploaded your current stuff here…

I have been doing a little hacking around. I have tried to put some limits in to keep the arm from moving too far out of range and the like. The code is now using the same ArcTan code and tables that the phoenix code uses. I also know that there were issues with the SQR function, with large numbers. I have heard from AcidTech(Nathan at Basic Micro) that he has a fix for that and it should be in the next released build that may happen sometime in the next few weeks.

The experimental version I have in this posting, I converted to using the floating point square root function. Yes it is slower and the like, but not sure in this case it matters. You might try it out.

As to see what has changed in different files. I use the program WinMerge, which you can download from: winmerge.org/
You can choose two different files and it will show you the differences between the files. Also you can point it to two different directories and it will show the differences in the files of those directories… Very helpful when you need to figure out what changed.

Kurt
ps2arm2.bas (38.8 KB)

Okay Kurt, I will give your expiremental program a try, but as of now, here is what I’m using on my arm, with some changes to arm length, due to us using self made 7" aluminum tube instead of a pre-cut one thats 4.5".
We are going to roll with the program as is, and see if we can medal with it. I can work around the bug by setting some mechanical offsets, just by taking out the servo horn and adjusting the arm as I please. Ill post and let you know how we did after tomorrow.
dte4ps2arm3.bas (41.3 KB)

I hope you have good luck with the competition! I did a quick winmerge of your sources versus my later ones and it looks like you have everything in there. Like using the FSQRT function. The only exception was where I did the earlier hack and tried to check for it going out of range and hacking it. My later version here also simply used the FSQRT function.

Again I hope you have a great time today and that you are having a lot of fun and keep with it.

Kurt

Thanks so much Kurt! I got 4th place with my friend in Robot Arm, and I got a medal for it too…I’m more happy b/c it was my first year doing robotics ever. Not only that but we got 1st and 2nd in our other couple events, and our whole team is going to States for the first time ever! So right now, I need to get even more prepared for this event. So like you said:

If that change or any other changes need to be made, can you send them to me, or tell me so I understand what to do? I would like the arm in tip top shape for states!

Congrats to you and your team! Will let you know if I see anything else. Right now I am busy on other projects, but can answer questions as they come up.

Again congrats!
Kurt

Congratulations to you and your friend for your entry and to your team.

Do you have a short video you could post of your entry at the competition? If not, could you make a short video now to show us what you did? I am sure many of us would be interested, and Kurt might like to see the results of all his help.

Again, congratulations, I’m glad to see you intend to continue on to higher levels. :smiley:

Thanks Roboted, although I’m not quite sure what exactly you want to see.

If you just want to see the arm, there are a couple videos of it above…just doing bad things. I’m sure I can post more videos of it actually working on a mock course at some point later.

No, I wouldn’t want you to go to the trouble of creating a mock course just for this. If you guys set up a mock course while prepping for the next event, that would be a good time. We’d like to see it doing good things the way you wanted it instead of ā€œdoing bad thingsā€ like before you solved it.

If you need to save your time to spend working toward your next competition, don’t worry about a current video. Maybe you can make one as you reach your next goal.

The main thing is keep striving and good luck to you and your teammates. We are behind you.

Teacher here ( Mr. Black
I am sending it to you tube and will show you what David did. I am so proud of him. He took this project on with little to no knowledge of robots or the work needed to understand it. He has really risen to the challenge of this and is excelling. Truly a GREAT student. Thanks to those that have helped him along the way


Ehhh…not my best… :astonished:

David,

Please thank Mr. Black for that great video. I do not have a Lynxmotion arm (yet). I watch all the videos here. Most show an arm merely demonstrating its range of motion. Yours is among the few showing the arm actually performing useful work. Two areas impressed me:

  • The ability of the gripper to deal with low profile objects as long and ungainly as the pencils and then others as heavy and dense as the batteries.

  • The amount of brain power and move planning you had to contribute to make that ā€œdumbā€ machine perform tasks which a human infant can do almost without thinking. When you watch the video, notice that you were really working hard there

Of course, you were constrained by hobby level materials and a hobby level budget and had to devote time to other things. But you accomplished a great deal. You are probably already planning improvements to the mechanisms and thinking of ways to substitute sensors and programmed control for some of your own senses and brains.

I demonstrate my robots at our senior center computer club. For awhile, I have been trying to devise an interactive demo using arms which they could ā€œplayā€ hands on. Your video showing that the arm can actually do something has convinced me that my next big robot purchase will be an arm.

Thank you and good luck in your next competition! :smiley: