Programming Power Buttons Help?

I would like to know how to program my arm so it will have power when the arm goes up and downwards in EasyC, as the program I have now will most likely burn out the motors because it always has power… :frowning:
I also would want power on the drive train too if you could help me with that too?

Let me know if you need to take a look at my EasyC programming file! :stuck_out_tongue:

He means that he want to turn on and off the motors being constantly at user value 10, to keep the arm up

Yes could you please show us your code so that we may help? :smiley:

variables… :stuck_out_tongue:

I’m a little bit confused by what you are asking. So you want to have power sent to the motors to keep it at a certain height at certain time, but not another? Correct?

Unless you have a mechanical way of holding the arm up, you will need a power sent to the motors to keep the arm up.

On the other hand, if you are saying that you want to have no power sent to the motors only while the arm is down, then you would need a potentiometer to read the height, and then if the potentiometer on the arm is below x value, set the motors to 0.

Hopefully this helps.

Perhaps what he means is that he only wants the “arm hold code” to be activated when the arm is off the ground? I’m a tad confused as well.

I want it to pause at the top at its max height, and when being pushed down it will be harder to be pushed down upon, I want two certain buttons to control the upwards and downwards power in EasyC. :slight_smile:

So in addition to the two buttons for raising and lowering the arm, you want two buttons which increase or decrease the strength of the hold code?

That is what it sounds like he wants to do.

iExpo - have you investigated using a PID control loop on your lift? A P loop would work well too for what you want I think.

Yes, I want the arm to have power when going downwards so it won’t be pushed down easily. How do I program the potentiometer? I want the arm to stop at the top and want two certain buttons for upwards power and downwards power.

Well I want it to have power, setting it at a value of 10 for the motors but I don’t want it to always have power and just to have power when I press two buttons. :slight_smile:

Could you explain more of what is a PID control loop and how to program it?

Good explanation of PID line following for the NXT (the idea is the same)
PID for Lego NXT
Change light sensor to potentiometer/encoder.

Or use the forum search feature. There are PID tutorials out there.

In summary, PID is calculating a number and it will then send the number to the motors as an output. It bases its numbers off of the current error (distance from the target, like the height you want to go to versus the height you are currently at), the previous error, and the estimated future error - correct me if I’m wrong anybody.

This sounds like it is what you want to do correct?

George Gillard from free range put together this excellent guide to PID loops that I have been using.