Shop OBEX P1 Docs P2 Docs Learn Events
Flexiforce/motor control — Parallax Forums

Flexiforce/motor control

stratocasterstratocaster Posts: 3
edited 2007-12-01 12:47 in BASIC Stamp
Hi,

I am a new basic stamp user and I am trying to write a program·to control a motor using a flexiforce sensor.·Here is what I am trying to program with my BASIC Stamp 2.
·
I am using a Flexiforce sensor to read the force (say 10lbs) on a cable that is tightened or loosened by a geared 9VDC motor. The goal is to read the sensor with the microprocessor and if
the force changes either plus or minus from 10lbs have the microprocessor (program) tell the motor to either tighten or loosen to bring the force back to 10lbs.
·
The action to read the sensor and command the motor plus or minus as required will only be done when a mechanical button is pushed so it does not have to run constantly.
·
The only other thing that is necessary is that I will need to “set” the target force (10lbs in this example). That is, mechanically bring the cable to 10lbs then press a button to “set” that as the desired force. This required force may change from time to time so it is necessary to be able to “set” a new force.
·
·
What ever help you can give me would be appreciated. An example of a program that uses the proper commands would really help.

Thankssmhair.gif

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-12-01 00:16
    The best thing to do is to break the problem into pieces and get each part working separately before combining them. For example, use the examples that are available for the Flexiforce sensor and make sure you can read the force exerted on it. Make sure you can control a motor, then add the Flexiforce read routine to see if you can stop the motor when a fixed force is reached. After that, it should be relatively easy to add the other functions you've listed.

    Make sure you've worked through something like the "What's a Microcontroller?" tutorial and perhaps the "Basic Analog and Digital" tutorial, all downloadable from the Parallax website.
  • stratocasterstratocaster Posts: 3
    edited 2007-12-01 00:55
    Thanks Mike,

    I tend to learn faster if I have an example to go by that's why I was looking for that. If you're new to a program it's more just knowing what command does what. I can search command by command but if I see a similar program laid out it makes it a lot easier for me.
  • Mike GreenMike Green Posts: 23,101
    edited 2007-12-01 01:14
    The problem you're trying to solve is not general enough for examples to be floating around. You may learn more by doing more of the work yourself and adapting pieces of other programs that do part of what you want.
  • steve_bsteve_b Posts: 1,563
    edited 2007-12-01 12:47
    stratocaster, it's highly recommended to go through the "FREE" downloadable documents that Parallax offers.
    I STILL haven't gotten through them all, but what I have gone through has helped a lot.

    My experiences with the flexiforce have not been great. Yes, it's a force sensor...it's resistive! As pressure is exerted on it, its resistance changes....however, I didn't find it repeatable.

    Go through the "prep" of the flexiforce from the datasheet. You have to "pre-load" the sensor (IMO its just putting an even force across it to distribute the gel)....I'm guessing if you are not able to preload it the same way each time, your readings won't be repeatable. Basically...your mileage may vary!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    <FONT>Steve



    What's the best thing to do in a lightning storm? "take a one iron out the bag and hold it straight up above your head, even God cant hit a one iron!"
    Lee Travino after the second time being hit by lightning!
Sign In or Register to comment.