12V stepup regulator

Started by snorp, March 25, 2016, 04:45:43 PM

snorp


TomWS

 
Quote from: snorp on March 28, 2016, 08:52:26 PM
Sigh...that makes sense.
:)
Like I said Mother Nature is a ....
The good news is that Mother Nature is very 'generous' and has many choices for you to consider (as long as you recognize that 'she' has you by the... uh, well, you know...).

Hey!  Your motors look like the cheapest, most effective actuators on the planet!  Use them wisely!  Of course, depending on your torque needs, the 5V version might be a better choice from a PS perspective.  I just ordered 5 of them!

Tom

TomWS

@snorp, Attached below is how I would set up the power for your stepper.  I would try to run the stepper from 6V and, if that's not enough power, then put the boost circuit in. 

In all cases, however, I'd run the Moteino from 2xAA without an internal VR to minimize unnecessary voltage conversion losses, then the other 2xAA provide the extra voltage for your motor.  You could rotate the batteries every six months if you wanted optimum wear, but it's probably not worth it if you're diligent about low power consumption on the Moteino SW.

Tom

perky

Worth looking into servos as well which have the DC motor, gears and electronics all in one handy package. You can get really cheap servos from places like HobbyKing, and ServoCity have app notes on how to drive them.
Mark.

snorp

Quote from: TomWS on March 29, 2016, 08:25:55 AM
@snorp, Attached below is how I would set up the power for your stepper.  I would try to run the stepper from 6V and, if that's not enough power, then put the boost circuit in. 

In all cases, however, I'd run the Moteino from 2xAA without an internal VR to minimize unnecessary voltage conversion losses, then the other 2xAA provide the extra voltage for your motor.  You could rotate the batteries every six months if you wanted optimum wear, but it's probably not worth it if you're diligent about low power consumption on the Moteino SW.

Hmm, how much loss will there be to regulate the 6V to 3.3V? Only a few uA, surely? I'm measuring 22uA right now during the idle phase of listen mode, where most of the time will be spent. I found I can set the RX time to 1ms (which uses 17ma) and still receive my commands, so the average consumption without running the motor is a respectable 39uA. I am not sure it's worth the effort to split the batteries up like you have, but I do appreciate the suggestion. I could get it lower by disabling the pullup for a push button switch I'm using, but not sure how I would do that reliably while still allowing the button to do its thing. Maybe an external pullup with a higher value resistor would be more conservative?

I had ordered a 5V motor but got a 12V one, and it doesn't have enough torque when run at 5V. Because I'm a moron, I assumed that meant the 5V models of the motor would perform similarly, but that's almost certainly false. Ordered some 5V ones from another place, so we'll see how they do. Splitting the batteries probably makes more sense if I end up needing the 12V. Thanks for the help!

perky

What's the normal state of the pushbutton switch? Is it normally sinking current? Is it used as a wakeup switch?

It's easy if you regularly poll it or poll it once (like a mode select switch). Basically during the polling routine you turn on the pull-up, read the status and if the input is high the swich is off and you can leave the pull-up on. if it's low the switch is pulling it to ground and sinking current, so turn off the pull-up and either ground or turn a pull-down on the pin. You don't want to leave the input floating, that'll cause excessive current by itself.

If you consider an MCU pull-up as being around 100k it would take 33uA at 3.3V.

Mark.

TomWS

Quote from: snorp on March 29, 2016, 03:37:13 PM
Hmm, how much loss will there be to regulate the 6V to 3.3V? Only a few uA, surely?
Hmmmm, good question.  Let's figure it out.  You say your Moteino draws 39uA average, we'll use that number. 
Case 1: Running directly off 2 batteries at 39uA consumes 341mAH per year.  Not bad, you'll get plenty of life with that.
Case 2: Running off 4 batteries at 39uA plus 2uA quiescent current for the VR.  359mAH, still not bad but you've consumed twice the number of batteries...

Tom
PS: Also perky's advice on the pullup unless you need it for wake on state change, in which case, you should make sure that the NORMAL, non-active state, is OPEN on the switch.

snorp

Quote from: WhiteHare on March 29, 2016, 11:02:08 AM
If torque is an issue, it's worth mentioning (in case you're not already aware) that you can get very high torques with low voltages (3v or less)  and surprisingly low currents (easily 30ma or less) with just ordinary, inexpensive, low-RPM DC motors.  Most projects don't need a stepper motor, which typically does require high current to get decent torque and/or holding power.  Also, stepper motors tend to be noisy compared to regular motors.  If you're just operating for 5 seconds twice a day (maybe to open and close some blinds for instance), most likely a highly geared regular motor will suffice, and your batteries will last much longer too.

I did briefly consider a gear motor, but I wasn't really able to find any that seem suitable. I want to turn fairly slowly (<= 5 RPM), and need to position it with a reasonable amount of precision (encoder? hall effect sensor?). I actually started with a hobby servo, but those are pretty noisy and there doesn't seem to be a good way to control the speed. The accuracy left something to be desired, too, but maybe I just had a crappy couple of servos. These 28BYJ steppers are dirt cheap (about 1/8th the cost of even a crappy servo!) and have pretty good precision.

snorp

#23
Quote from: perky on March 29, 2016, 03:55:11 PM
What's the normal state of the pushbutton switch? Is it normally sinking current? Is it used as a wakeup switch?

It's a normally-open (Omron B3F) tactile switch. I am using the internal pullup (INPUT_PULLUP) with the switch connected to pin 3 and DN, so it should normally (EDIT: not) be sinking current.

Quote
It's easy if you regularly poll it or poll it once (like a mode select switch). Basically during the polling routine you turn on the pull-up, read the status and if the input is high the swich is off and you can leave the pull-up on. if it's low the switch is pulling it to ground and sinking current, so turn off the pull-up and either ground or turn a pull-down on the pin. You don't want to leave the input floating, that'll cause excessive current by itself.

If you consider an MCU pull-up as being around 100k it would take 33uA at 3.3V.

I do use it to wake-up (via interrupt), because otherwise we're just waiting waiting for interrupts from the radio and the CPU is almost completely off. The button resets my stepper origin position, so it's useful for getting things set up properly.

I disabled the INPUT_PULLUP and my power consumption did not measurably change (still 22uA), so I suppose the pin itself has a lot more impedance. The doc here[0] says that input mode puts something like 100MOhm in front of the pin, so I guess that makes sense. I guess I can stop worrying about the pullup.

(0) https://www.arduino.cc/en/Reference/Constants

TomWS

#24
I should move this to a new topic, but FWIW, I received my 28byj-48 steppers yesterday and played around with one today.  The motors were claimed to be 5V (see below) and I ran them off a 6V SLA battery and the supplied ULN2003 driver board.

Interesting results:

1. Current drawn when stepping at 1000 steps per second (8 step sequence) averages about 234mA in one direction, about 217mA in the reverse direction.  Not sure why there's a difference, but the 'specs' do cite different 'pullin' & 'pullout' torques (whatever that is in a stepper!).  And that includes the silly LEDs on the driver board.
2. At this speed there is plenty of power for my needs.  Speed at this pulse rate is slightly less than 15RPM.
3. Most significantly (and I totally missed this detail looking at the ULN2003 datasheet) is that, with all the windings off (ie, the four control lines driven to ground) there is NO power drawn by the motor or ULN2003.  You don't need no stinkin' load switch.  This makes sense when you think that the ULN2003 is nothing but a bunch of NPN darlington transistors.  Don't bias the base, there is no current.  There may be some leakage, but it's below 1uA...

Re motor 'voltage'.  I'll wager that there is no difference between a 12V motor and a 5V motor other than the max torque and max speed you can get out of it.  Run these babies at 6V and you've got a nice little actuator...

BTW, for some reason the Arduino stepper library in my 1.6.0 IDE setup did nothing useful.  I'll have to chase it down, but it was simple enough to spin a bidirectional step function (the IDE only does 4 step sequence anyway) so I'm using my own.
UPDATE: I did get the library working (sort of). I didn't realize it was 4 stepping instead of 8 so my speed setting was twice what I expected, but, also, this motor does not like 4 stepping very much.  8 stepping is much smoother, higher torque and, as a consequence, you can get it to rotate at a faster speed.

Tom

snorp

Quote from: TomWS on March 31, 2016, 01:09:32 PM
I should move this to a new topic, but FWIW, I received my 28byj-48 steppers yesterday and played around with one today.  The motors were claimed to be 5V (see below) and I ran them off a 6V SLA battery and the supplied ULN2003 driver board.

I got my 5V motor today as well, and powering with 4xAA seems to give similar torque as the 12V. Woo! I was going to turn it into a bipolar motor to get more torque if I had to (which is apparently pretty easy on these), but it's nice that I won't need to.

Quote
<snip>
3. Most significantly (and I totally missed this detail looking at the ULN2003 datasheet) is that, with all the windings off (ie, the four control lines driven to ground) there is NO power drawn by the motor or ULN2003.  You don't need no stinkin' load switch.  This makes sense when you think that the ULN2003 is nothing but a bunch of NPN darlington transistors.  Don't bias the base, there is no current.  There may be some leakage, but it's below 1uA...

I thought I checked this before and saw some power consumption, but I checked again and you're right. Guess I don't need the FET anymore either. This is going to be a pretty boring PCB.

Quote
BTW, for some reason the Arduino stepper library in my 1.6.0 IDE setup did nothing useful.  I'll have to chase it down, but it was simple enough to spin a bidirectional step function (the IDE only does 4 step sequence anyway) so I'm using my own.
UPDATE: I did get the library working (sort of). I didn't realize it was 4 stepping instead of 8 so my speed setting was twice what I expected, but, also, this motor does not like 4 stepping very much.  8 stepping is much smoother, higher torque and, as a consequence, you can get it to rotate at a faster speed.

Yeah, also the correct sequence seems to be 1-3-2-4, which I don't believe is standard. I'm using AccelStepper with the HALF4WIRE mode instead of the built-in stepper library. Works well and provides nice smooth accel/decel.

TomWS

Quote from: snorp on March 31, 2016, 04:44:31 PM
I got my 5V motor today as well, and powering with 4xAA seems to give similar torque as the 12V. Woo! I was going to turn it into a bipolar motor to get more torque if I had to (which is apparently pretty easy on these), but it's nice that I won't need to.
Since you have both motors in hand, can you measure the respective winding resistances and see if they are truly different motors?
Quote
I thought I checked this before and saw some power consumption, but I checked again and you're right. Guess I don't need the FET anymore either. This is going to be a pretty boring PCB.
<g> They're the best kind!  Very reliable...

Quote
Yeah, also the correct sequence seems to be 1-3-2-4, which I don't believe is standard. I'm using AccelStepper with the HALF4WIRE mode instead of the built-in stepper library. Works well and provides nice smooth accel/decel.
Thanks for the lead on the AccelStepper library.  I don't need it for the immediate project but could be useful if I ever try to do something more sophisticated.  I didn't have an issue with the 1-2-3-4 sequence, but maybe that's why the Arduino library didn't work well.  Since mine is operating smoothly and meets AQL, I'm goin' with it!

Tom


perky

If it was purely down to power being the same for both and with 250mA at 12V I'd expect the 5V version to have a resistance of (5*5)/(12*0.250), or 8.33R.
Mark.

jra

Just ordered five of these on Amazon for $15 http://www.amazon.com/Elego-28BYJ-48-ULN2003-Stepper-Arduino/dp/B01CP18J4A.  No idea what I'm going to use them for but the price was right :)

snorp

Quote from: TomWS on March 31, 2016, 06:53:12 PM
Since you have both motors in hand, can you measure the respective winding resistances and see if they are truly different motors?

Looks like 80 ohms for the 12V and 28 for the 5V.