Power Expander Problems URGENT


The two motors on my pivot weren’t able to lift up the bar. So I believed my robot had problems with power because I had 8/10 motors programmed and powered.

When I removed all the programming of the motors except for the two motors on the pivot, it worked flawlessly, but it just doesn’t lift even when all the motors are unplugged (but all motors are programmed).

I thought that the power expander could be a solution to the problem, so I specifically wired the two motors on the pivot to the power expander and tried it again, to no avail.

I don’t really understand the problem, because my programming seems fine and wiring is all done well. I thought the power expander could harness one whole battery’s power to just those two motors, but apparently not.

My robot has a competition this weekend, so I’m in a rush to try and figure this out.



Post the code, it sounds more like a programming problem.

The buttonValue variable is assigned as “unsigned long, value=1”

So you are controlling motors 8 & 9 in several places, that won’t work. Are 8 & 9 the motors with problems ?

You are also assigning a value to buttonValue but never use that, what are you trying to achieve with the code?

Yes, I am trying to program a lock for motors 8 & 9 so that the lift won’t fall down.

I asked how to program individual buttons (digital joystick), and I believed I assigned the values correctly, but apparently not.

You are going to need some if…then…else type statements in there somewhere.

Explain what you want to happen, which buttons you want to do what etc. and I will try and put something together for you.

Thank you.

So first off, my HoloDrive is working flawlessly.

Motors 8 and 9 work together as the pivot for my lift. Channel 6 is what I would like to use for motors 8 and 9.

Motor 7 is my forklift, which sits on the lift bar. It is the same function as a pivot. Channel 5 is what I would like to use for motor 7.

Motor 10 is my claw. Channel 7 UP and DOWN is what I would like to use for motor 10.

Now, since the lift and forklift themselves are both quite heavy, I tried to program the individual buttons on channel 8 of the digital joystick (U8, D8, R8) with motor rotations against the falling speed, “locking” the lift/forklift in place.

For U8 I would like to “lock” motors 8 and 9 (the pivot).
For D8 I would like to “lock” motor 7 (the forklift).
For R8 I would like a combination of both the functions of U8 and D8, “locking” all motors 7, 8, and 9.

Thank you, jpearman, for all the help!

No problem, let me put something together for you later when I’m home.

Just one last thing. The way you are locking the motors is not great. Currently you send them -30 and 30 or -40 and 40 at the same time which is very bad for the motors. To make the motors not move you just send them 0 power. Jpearman will come rewrite most of your code from scratch using this format
stuff to do
}else if(other criteria){
other stuff to do

I just wanted to clarify what some of the problems were for when you try to write some more of your own code.

So I assume that what you mean by “locking” the motors is that you do not want them to move in response to gravity or perhaps holding some weight. We can do this by sending a small amount of power to them, usually you want this to be as small as possible and in any event no larger than perhaps a value of 25, otherwise you will trip the internal PTC current and overheat protection circuit very quickly.

Here is some code that shows the general approach.

When no button is held down then you control the motors with the joystick, when holding the lock button then a fixed value is sent.

Btn8U etc. are variables defined in the variables dialog as type int.

I didn’t add any of the holo drive code, I may have the motor directions reversed, you need to check and experiment with that if necessary.

click on the image for a full size version.


I cannot thank you enough. You have also taught me a valuable lesson on using “if… else”. Everything is now working just fine!

I am curious to ask: why wasn’t my previous coding sufficient for everything to function?

It had a similar issue to the code in this post (although this one is about ROBOTC code).
Stop your motors jittering

for example,
you call the function
JoystickDigitalToMotor( 1, 6, 1, 100, 2, -100, 8 )

this uses button 6 up and down to control motor 8.

then later in the code you call this function.
JoystickDigitalToMotor( 1, 8, 2, -30, 2, 30, 8 )

this uses button 8 up to also control motor 8, unfortunately it tries to send both -30 and 30 at the same time to the motor, not sure why EasyC even allowed this statement as it doesn’t make much sense.

You also have a third place trying to send more control values to motor 8 based on button 8 right.

You were thinking along the right lines by using “ButtonValue” to read the state of the button to lock the motors, however, you needed to make a decision based on this value after setting it.