Maker Pro

24v stepper controlled by aruduino

bigone5500 submitted a new Showcase Item:

24v stepper controlled by aruduino

I finally have a 24v power supply and want to control a stepper with an arduino. Never done this before and think it should be easy. I will be using an UNO and two P-channel MOSFETS and two N-channel MOSFETS. My theory is that I can connect digital pins to the gates of the four MOSFETS, 24v to the source pins, and ground the drains. The UNO will be powered by the 24v through a 5v regulator.

Any suggestions are welcome.

Read more about this showcase item here...
 
Where do the stepper motor wires go? Is there a schematic yet?

@hevans1944 , I am currently working on the schematic. I have it somewhat figured out but don't want to post it as of yet due to the possibility of looking very dumb. What I have is the arduino powered by the 24v source through the 7805. I'm pretty sure I can use the same ground as the MOSFETS. I will do my best to get a schematic posted by the end of the day. It may be tomorrow as I will be the only one home all day. FREE DAY!!! Boss will be gone!!! :D
 
So I got a little time to work on the schematic. The MOSFETS in the schematic will not be the ones I use. I'm new to using eagle so if there is something you see that's not right let me know please.

So in the schematic there will be a 24vdc supply connected to the 7805 and the two H-bridges. The output of the v-reg will be connected to the 5v on the UNO as well as the GND. As per the labeling, one bridge will be connected to coil A (A, A') and the other to coil B (B, B'). The bridges will be controlled by the digital output pins on the UNO. The pin labels are just for reference and can be changed if needed.
 
Last edited:
From what I understand, I do not need protection diodes with these MOSFETs. Am I correct here? Does this only pertain to a regular motor?
 

Harald Kapp

Moderator
Moderator
You'll run into an issue with your simple circuit: The P-channel MOSFETs will never turn off, thus creating a short circuit when the N-channel MOSFET is on in the respective leg of the H-bridge!

Why, you ask?
The arduino's logic high level is max. 5 V. Connected to the gate of a PMOS with the source connected to 24 V, this results in Vgs = -19 V, enough to turn on the P-MOS.
You need to level-shift the arduino's output to 24 V before connecting it to the gates of the PMOS transistors. Here's a discussion on this topic.
A very simple circuit is this one:
upload_2016-7-26_12-43-49.png

Note that it is inverting: to turn on the PMOS you'll have to set the logic signal at "in" high (3.3 V...5 V). This turns on Q1 and the gate of the PMOS is at 0V, thus Vgs = -24 V and the PMOS is on.

With a logic low at "in" (~0 V), Q1 is off, thus R1 charges the gate of the PMOS to 24 V. Vgs is therefore 0 V and the PMOS is off.
 
You'll run into an issue with your simple circuit: The P-channel MOSFETs will never turn off, thus creating a short circuit when the N-channel MOSFET is on in the respective leg of the H-bridge!

Why, you ask?
The arduino's logic high level is max. 5 V. Connected to the gate of a PMOS with the source connected to 24 V, this results in Vgs = -19 V, enough to turn on the P-MOS.
You need to level-shift the arduino's output to 24 V before connecting it to the gates of the PMOS transistors. Here's a discussion on this topic.
A very simple circuit is this one:
View attachment 28085

Note that it is inverting: to turn on the PMOS you'll have to set the logic signal at "in" high (3.3 V...5 V). This turns on Q1 and the gate of the PMOS is at 0V, thus Vgs = -24 V and the PMOS is on.

With a logic low at "in" (~0 V), Q1 is off, thus R1 charges the gate of the PMOS to 24 V. Vgs is therefore 0 V and the PMOS is off.

I updated the schematic. Please review it and comment with your suggestions.

Thanks.
 

Harald Kapp

Moderator
Moderator
@bigone5500 : This looks much better. There's one (general) concern with H-bridges controlled this way, i.e. transient current spikes from 24 V to GND during switching of the transistors.

Consider Q1, Q3, Q9:
Let Q1 be off (base at 0 V, no collector current). Q1 will be off, too (Vgs=0 V), Q3 will be on (Vgs=24 V via R1, R5).
Now turn on Q9 (base ~0.7 V, Vce~ 0V). This will almost instantly turn on Q1 as the gate is connected to GND via the low impedance collector emitter circuit of Q9.
What happens to Q3? The gate is also connected to GND via Q9, not directly, however, but through R5. This means the charge stored on Q3's gate will be discharged comparatively slowly, keeping Q3 conducting for a while. The IRF3205 has an input capacitance (Ciss) of ~3nF. Together with 100 kΩ the time constant of the resulting RC term is tau=300 µs! To completely discharge Ciss you'll need t=3*tau ~ 1ms! much too long as during this time both Q1 and Q3 will be conducting (Q3 with diminishing conductance). A high current pulse and respective power dissipation are the consequence.

You'll have to introduce some dead-time or dead-band between turning one MOSFET on and the other MOSFET off. By a quick search I found this explanation which I think is pretty well written.

Please excuse my not mentioning this in the first place.
 
@bigone5500 : This looks much better. There's one (general) concern with H-bridges controlled this way, i.e. transient current spikes from 24 V to GND during switching of the transistors.

Consider Q1, Q3, Q9:
Let Q1 be off (base at 0 V, no collector current). Q1 will be off, too (Vgs=0 V), Q3 will be on (Vgs=24 V via R1, R5).
Now turn on Q9 (base ~0.7 V, Vce~ 0V). This will almost instantly turn on Q1 as the gate is connected to GND via the low impedance collector emitter circuit of Q9.
What happens to Q3? The gate is also connected to GND via Q9, not directly, however, but through R5. This means the charge stored on Q3's gate will be discharged comparatively slowly, keeping Q3 conducting for a while. The IRF3205 has an input capacitance (Ciss) of ~3nF. Together with 100 kΩ the time constant of the resulting RC term is tau=300 µs! To completely discharge Ciss you'll need t=3*tau ~ 1ms! much too long as during this time both Q1 and Q3 will be conducting (Q3 with diminishing conductance). A high current pulse and respective power dissipation are the consequence.

You'll have to introduce some dead-time or dead-band between turning one MOSFET on and the other MOSFET off. By a quick search I found this explanation which I think is pretty well written.

Please excuse my not mentioning this in the first place.

Thanks for your help and input Harald. I will visit the link and study it before going any further.

I could probably simply copy what someone else has done similar to this but I want to do it the 'hard' way. I'm sure I will learn more in the long run.
 

Harald Kapp

Moderator
Moderator
I could probably simply copy what someone else has done similar to this but I want to do it the 'hard' way. I'm sure I will learn more in the long run.
Good. You sure will. However, if we achieve this without too high a bill, that's preferable.
 
Top