Shop OBEX P1 Docs P2 Docs Learn Events
Robotic fish help BS1 servo trouble - Page 3 — Parallax Forums

Robotic fish help BS1 servo trouble

13»

Comments

  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-04-14 20:51
    Try changing the beginning of the program to this:
    ' {$STAMP BS1}
    ' {$PBASIC 1.0}
    SYMBOL ballastCounter = W0
    SYMBOL finPosition = B2
    SYMBOL rudderState = B3
    SYMBOL finState = B4
    SYMBOL ballastState = B5
    SYMBOL rudderPosition = B6
    

    I think W0 uses the same memory locations as B0 and B1 so the byte variables need to start at B2.
    If you ever need the pulse values to be larger than 255, the corresponding position variable will need to be changed to a word.

    I'm hoping to see some pictures and video of this thing.

    I'm really curious to know how well your CO2 tank blower works.
  • bryansc4bryansc4 Posts: 36
    edited 2012-04-14 21:30
    hahahaha my bad, still learning. I actually remembered reading about that earlier after reading the "duh". And don't worry man I'll post plenty of pics and vids. I'm hoping to waterproof everything tomorrow, fiberglass the body, and then finally toss it in the pool monday or tuesday. I'm really hoping the CO2 blower wont freeze up. I dont think it will with the small bursts we're using. I'll post my final report as well. Again, i can't thank you enough! here you go!
    fishprgm1.jpg
    1024 x 640 - 112K
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-04-14 21:44
    Thanks for the memory chart.
    bryansc4 wrote: »
    I'm really hoping the CO2 blower wont freeze up. I dont think it will with the small bursts we're using.

    The problem is, there's only one CO2 blast in the present program. It might be possible to squeeze some code in to trigger the CO2 several times as the robot surfaces.
  • bryansc4bryansc4 Posts: 36
    edited 2012-04-17 13:58
    Just wanted to give an update.. We are fiber glassing the body now and fabricating the tail and fins. We should be done sometime late tonight. We are pool testing it tomorrow afternoon. I will post videos ASAP. Thanks again for all of the help!
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-04-17 14:19
    You're welcome.

    I'm still hoping we could get another opinion from forum members with more experience with the BS1.

    Do any of you have experience driving multiple servos while monitoring multiple sensors with a BS1?

    Is there a better way of doing this than the current program? It still seems like an awfully awkward way of doing this.
  • bryansc4bryansc4 Posts: 36
    edited 2012-04-21 08:52
    Here's the video we showed the engineering department yesterday in our presentation. The fish broke. I don't know if it was a bug in the program, or what, but the rudder motor gears stripped out in testing before we got it in the water. if one of the buttons was pressed too long the motor shaft would flip 180, but the frame wouldn't allow it, so I think it is for sure the gears in the motor. I'm going to rebuild it with a little extra time and effort this summer after finals. This was sort of a rapid prototype to meet the deadline. The ballast cracked on our first test installing the CO2, which is why it's swimming nose up in first few shots. but you can see the ballast working in the last few seconds of the video taken from a second test after we did a "quick fix". After that the ballast cracked even more while trying to change out CO2 cartridges. But overall everyone seemed to dig it =]

    Enjoy!
    [video]http://www.facebook.com/photo.php?v=10151536092255704[/video]


    Future design improvements will include:
    • a flimsier tail and dorsal fin to reduce lateral body movement and give better propulsion
    • A micro-controller better suited for this application
    • compartmentalized ballast for better balance
    • Stronger CO2 regulator mount
    • better bump sensors
    • more attention to detail in component placing for better balance
    • different location for ballast vent
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-04-21 19:07
    That's a cool fish robot!

    It's fun to see it "swim" by moving its tail back and forth.

    Is the tail servo connected to the rudder servo?

    Besides the front button bump sensors, it looks like some sort of sensor to indicate it's next to the side of the pool would be helpful.

    I'm going to keep my eyes open for a suitable fish body. I think I might need to try to build one of these.

    Do you have any pictures of the CO2 valve? I don't think I'd know how to release CO2 in any controlled way. It would be great to see how you did it and what parts you used.

    Thanks for posting the video.
  • ercoerco Posts: 20,255
    edited 2012-04-21 19:49
    @bryansc4: Nice job! Thanks for linking to your video, that was fun to watch.

    @Duane: You're the most enthusiastic Forumista ever. You wanna build this, you wanna build my BS1 safe, you wanna build EVERYTHING.

    Cool beans!
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-04-21 19:56
    erco wrote: »
    @Duane: You're the most enthusiastic Forumista ever. You wanna build this, you wanna build my BS1 safe, you wanna build EVERYTHING.

    Does someone have a cure? Please!?!?
  • Spiral_72Spiral_72 Posts: 791
    edited 2012-04-23 11:57
    WHOA!!! That is really cool man :) congrads.... The audio was a perfect fit for the video too.

    bryansc4 didn't take the easy way out with a small boat prop, he used an honest to goodness FIN!


    If you're going to use a different micro, may I suggest the BS2px24?? It's FAST..... rumor has it it'll oscillate at least eight servos.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-04-23 12:31
    Spiral_72 wrote: »
    If you're going to use a different micro, may I suggest the BS2px24?? It's FAST..... rumor has it it'll oscillate at least eight servos.

    I doubt it will come as a surprise to anyone, but I think (and feel it in my bones) the Prop is the right micro for a project like this. Rumor has it a Prop can oscillate 32 servos. And it can do a bunch of other stuff at the same time it's driving the servos.

    The programming part of this project would have been a breeze with a Prop.

    I had wondered how all the Basic Stamp people drove servos and checked sensors. I learned from helping Bryan how it's done. It's done with great difficulty!

    I'd really like it if someone with more experience using the BS1 would look at the code in post #53 to see if I missed some way of simplifying the code. It sure seems like an awkward program to me.

    As an added bonus the Prop is less expensive than any of the Basic Stamps.
  • bryansc4bryansc4 Posts: 36
    edited 2012-04-23 12:35
    Hey thanks guys! haha it was a tough project given the lack of time and money I had to put into it. Couldn't have done it with out duane. you saved me man!

    @duane, I hinged the fin motor mount on the frame. and the rudder motor acuated the fin motor mount. I used a regulator made by genuine innovations. it steps down the pressure in one stage and is really small. if i had more money to burn, i would have used some home brewing co2 regulators. i controlled the ballast bursts with clippard mouse valves. I would definitely look into creating a ballast gate maybe actuated by another servo or linear actuator because the vent i made was controlled by a mouse valve and the orifice was only 0.06" so it took for ever to sink. I tried to attach my final project report, but the forum said it was too big. If you or anyone else is interested, let me know and i can email it. The different ideas including sensors and other types of drive methods are discussed in the report.

    My professor made me make it small, but now i want to make it bigger, I'm thinking a 3 foot shark! and two fin motors to really get that sinusoidal motion and a 3rd motor to help with turning, maybe a sonar for better object avoidance. We'll see later this summer!
Sign In or Register to comment.