Go Down

Topic: Stepping up the 5V output to 28V to control a stepper driver (Read 3641 times) previous topic - next topic

_DickyBoy

Not sure if this is the right place for this question or if it should be in general electronics, if anyone thinks I should move it I'll be more than happy to oblige.

I have a number of stepper motors and drivers which I'll be controlling using an Arduino Mega, which obviously outputs a 5V signal from its PWM pins. My drivers, however, require a 28V signal to their inputs (i.e. pulse and direction control inputs, the actual power comes from a 48V power supply plugged into the mains).

My question is, is there a simple circuit to step up the 5V signal from the Arduino into a 28V signal that the drivers will recognise?

Thanks in advance for your help

MAS3

Yes.
Look into using transistors with your Arduino.
There's really lots and lost of info available already, throughout this forum.

Step up is the wrong term in this case, you shouldn't try to create 28 volts out of a 5 volt output from your Arduino, it'll take too much power from the output pin to get that done, and too much hassle too.
Instead use some transistors and a 28 volts power supply to build an intermediate stage.
Have a look at "blink without delay".
Did you connect the grounds ?
Je kunt hier ook in het Nederlands terecht: http://arduino.cc/forum/index.php/board,77.0.html

_DickyBoy

Thanks for the prompt reply.

I was really hoping to avoid buying an extra power supply as cost is a big factor (budget for this project is already fairly depleted and I can get most standard electrical components such as resistors, capacitors, transistors etc. free of charge) and I'll be controlling both steps and direction for 6 motors in this way (not entirely sure how much current would be needed for each driver i.e. whether I'd get enough current from one 28V power supply to do all 6 motors or if more than one supply will be necessary which obviously pushes the cost up even further). If you think that what I had suggested is a bad route to follow, might it be a better option to use transistors and the 48V supplies I already have to step down to 28V? They don't have a lot of current going spare as the motors themselves will be eating most of it, so I'd have to figure out how much current would be needed for controlling the drivers first, but it'd give me something else to think about and explore.

MAS3

You're not giving all info needed to answer your questions prefectly.

A step up converter needs power (measured in Watts).
It needs to multiply the voltage by 5.6, and do not mistake and think that it a process with 100 % efficiency.
That power would be drawn from the Arduino port, which really isn't the way to go.
Also, most step up methods nowadays use an inductance, not suitable for an Arduino output either.

Are you sure the inputs of your drivers require you to input a voltage to drive it ?
Or do you have to switch a 28 volts signal (already available at that input), and drive it low to activate ?
In the latter case you would not need to create the intermediate power supply and can do with just the transistor and its current reducing resistor(s).

Can you show us some datasheet, link or any more info to those drivers ?
Have a look at "blink without delay".
Did you connect the grounds ?
Je kunt hier ook in het Nederlands terecht: http://arduino.cc/forum/index.php/board,77.0.html

Robin2

Arduino Mega, which obviously outputs a 5V signal from its PWM pins. My drivers, however, require a 28V signal to their inputs (i.e. pulse and direction control inputs, the actual power comes from a 48V power supply plugged into the mains).
First, why do you need to use PWM pins to control a stepper driver - won't any of the I/O pins be suitable.

Second, post a link to the datasheet for your stepper driver. 28v seems a strange requirement.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

_DickyBoy

I only have a hard copy of the data sheet, but all the information is present on the site from which I bought them. Here is the link to the drivers and motors:

http://www.aliexpress.com/item/2-Axis-NEMA-34-stepper-motor-J86HB118-06-1215oz-in-and-Driver-JB860M-AC18-80V-DC24/2045649528.html

About 2/3 down the page there is a subsection headed 'Terminal function', here you can see that it states that 5V can connect to the inputs but extra circuitry is required if it is not 28V, I took this to mean the signal entering the input had to be 28V, is this not correct?

As for the PWMs, I had been told earlier in the project by someone who knows far more about electronics than me (it's not hard, I know) that it would be necessary to use the PWM pins for this, and in the same section of that web page as mentioned above there is something about pulse widths having to be over a certain value. Is this also not correct?

In case you hadn't figured out, I'm a bit of a noob when it comes to the electronics, I'm more of a programmer myself. But until I figure out how to properly connect this to the Arduino I certainly can't get any programming done, so all your help is very gratefully received.

MarkT

These are standard opto isolated inputs, just use 5V and no external resistance is needed,
forget the 28V its not relevant (or even correct).  You would need extra resistance if
the voltage were greater than 5V to limit the current to 15mA or so. Internal 220 ohm
resistors mean 5V can be connected directly.

You can double check this by connecting 5V across say PU+/PU- via an external 220 ohm
resistance - if a current of about 8mA flows then there is an internal 220 ohm, if 16mA
then there isn't and you'll need external ones.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Robin2

Quote from the web page you linked to

Quote
can connect +5V or +28V
As @MarkT says, just connect it up.

There is no need to use PWM pins. Any PWM that happens takes place in the driver board where you can't see it, and don't need to.

See stepper motor basics for more background info and some sinple code for testing.


...R
Two or three hours spent thinking and reading documentation solves most programming problems.

_DickyBoy

Well the full quote is actually

Quote
can connect +5V or +28V, and an extra resistor is not needed if it connect +28V
To me this implied that I would need some extra circuitry, but I'm very pleased to hear that I won't. I'll be plugging it in and having a play around first thing tomorrow.

I had thought that maybe PWM would be necessary so that I could control the pulse frequency on start up and thus ramp up the speed gradually so that no steps are skipped, have I misunderstood how this works?

Thanks to everyone for helping me figure this out, it really is appreciated.

MAS3

You have to generate pulses.
Each pulse will result in another step.
The width of that pulse doesn't matter.
So PWMing is useless.

PWM doesn't change pulse frequency, that stays the same.
The pulse width is changed, hence the name.
This driver of yours is likely just looking for a change, so a raising or falling edge.
Have a look at "blink without delay".
Did you connect the grounds ?
Je kunt hier ook in het Nederlands terecht: http://arduino.cc/forum/index.php/board,77.0.html

_DickyBoy

Okay I think that makes sense, by rising edge do you just mean change from low to high i.e the speed can be ramped up by pulsing the pin between low and high?

MAS3

That's what rising edge means.
Speed up the pulse rate, and more steps will be made per second.
So that will increase your speed.
Of course there are some boundaries here.
Have a look at "blink without delay".
Did you connect the grounds ?
Je kunt hier ook in het Nederlands terecht: http://arduino.cc/forum/index.php/board,77.0.html

_DickyBoy


MarkT

Easy to drive step/direction interface, something like:

Code: [Select]

void do_step (boolean direction)
{
  digitalWrite (dirPin, direction) ;
  digitalWrite (stepPin, HIGH) ;
  delayMicroseconds (3) ;
  digitalWrite (stepPin, LOW) ;
}


Wire PU- and DR- to GND, PU+ to stepPin, DR+ to dirPin...

[ incidentally that delay of 3us is appropriate to this driver, but a value of 10 is industry standard ]
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Robin2

I had thought that maybe PWM would be necessary so that I could control the pulse frequency on start up and thus ramp up the speed gradually so that no steps are skipped, have I misunderstood how this works?
All you need to do is change the gap between subsequent pulses.

You have said you have several stepper motors but you have not told us what sort of project they will be used in. That may affect the most suitable way to control them.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

Go Up