Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PLC based stepper motor control

Status
Not open for further replies.

Bishop_v7.62

New Member
Hi!

I'm new to this forum so hi to all in advance.
I'm working on a little project, not of my choosing, because i have little knowledge about this. I need to run bipolar stepper motor with Siemens s200 plc, and i don't know what components do i need. It's a small motor, i assume i need l298 as driver but how do i connect plc to it. If you need more information, i will try to give them, but if you can assist me in this i would be much obliged
 
Hi,

Interesting. I'm just thinking about driving a stepper from an S7-315 PLC. I've built a PIC controlled stepper circuit that uses an L297 and L298. I have access to PLCs at work so for fun thought I'd try to do the same with a PLC. This time a MOSFET H-bridge will be used rather than an L298.

One of the main obstacles to interfacing either a discrete H-bridge or an L298 is the logic levels. A PLC will typically have 24V dc outputs so you will not be able to drive the L298 control inputs directly because that maximum voltage for the logic inputs is 7V.

You can obtain specially designed PLC modules for driving stepper motors; the FM353 for the S7-300 range and the EM253 for the S7-200. Do you have to use an L298?
 
Not that i have to but i thought it is easiest solution, i do however know that i will have to bring voltage output of plc to input level of l298. Speaking of, if i put some intermediate circuit to reduce voltage, i guess it is simple, will that effect noise? I mean, i plan to drive stepper in microstep mode using pwm created by plc, will my signal be to distorted? Oh, and tnx for reply :)
 
Hi,

Driving a stepper in microstep mode using PWM from a little S7-200 sounds like quite a challenge. I suppose it depends on how profficient you are at PLC programming. Is this an educational or industrial / commercial project? I occasionally do a bit of ladder programming for S7-300/400 plcs' but I'm no expert.

Interfacing the L298 should be easy enough using simple votage dividers I suppose. Can't comment on the noise issue, don't see why it should be a problem.

Althought it's easy to use and quite robust the L298 isn't the most efficient stepper driver chip. It's internal H-bridge uses bipolar transistors that can drop a significant voltage depending upon the stepper voltage and current. This can result in much heat generation / wasted power. There are more modern and efficient chips although I have not used these myself so cannot recommend a particular part. I think Toshiba make a good one.

Regards,

SG
 
Last edited:
It's not for commercial useage, it's my school project. I did some ladder programing, and i will try to utilize pwm wizard somehow for microstep, but for now i just have to get stepper working. I will use l298 becouse i have limited budget and i allready have that ic, as for power dissipation, cooler will have to do for now. Do you have any tips on how to program ladder so i can have dir, cw/ccw, #of pulses and time as input? Just link to some good manual, i'm reading siemens help but it's a bit obscure. Tnx
 
Hi,

Have you been told that you must use PWM and microstepping? That sounds like a project for someone with more experience of both stepper motors and in this case, PLCs'. I have to be honest and say that it is more difficult an undertaking than I think I could manage with my very basic PLC programming ability.

To make less work for yourself it would be easier to use an L297 between the PLC and the L298. It would simplify the programming a whole lot for sure because then you would only have to provide six simple digital commands and perhaps one analog (for stepper current limiting).

If you really need to utilise PWM / microstepping using a PLC perhaps you could get more specialist help here https://forums.mrplc.com/.

SG
 
i registered on that forum but i'm unable to post new threads, and i still haven't found my solution. To summarize, i need to generate full step and half step (no micro step for now) pulses with plc that l298 will interpret and make motor spin. What i need to know is, how to make ladder diagram, with cw/ccw, hs/fs, speed and #of pulses as inputs and correct pulse train as output for l298. Angry badger, thank you for your help so far, but i do hope there is more than one person on this forum willing to share knowledge.
 
Hello,

I'm downloading the evaluation version of S7 Microwin from the Siemens website........unfortunately I don't have access to an S7-200 though.

You say you've done a little ladder programming so just getting a motor turning slowly in full-step mode shouldn't be too taxing. If you look at the data sheet for the L297 it shows you (on page 5/11) what order to drive the four inputs, A, B, C, D on the L298. You just need to set up a couple of timers in the PLC to use as your clock source. Not sure about the S7-200 but 300 series CPUs' enable you to use a clock / pulse derived from the CPU system clock which would do to get you started with a fixed frequency output.

The download has finished now so I'll go have a look......
 
Last edited:
OK, so that hasn't worked out very well. Can't get S7 Microwin to work on W7 even in compatability mode. Ho hum. Going for a coffee.
 
i got it working but than again, i have v4 sp3. i'm trying to figure out pwm wizard, manual is very obscure, i managed to create subroutine but have no clue what now. To bad i don't have plc next to me either, there should be some way to simulate program without downloading it on plc...
 
Ok, i managed to drive my step motor using pwm and fast outputs, i even tried using timers, it worked, but pwm subroutine is more elegant in my opinion. Now i wonder, there are two inputs for that subroutine, cycle and pulse. I locked my pulse to 1 ms but i would like my motor to gradually ramp up speed, and after some time, gradually stop. Is there a way to program cycle input of my pwm so it changes values from, let say 200, in increment of 5 every 1 s to 2, stay like that for 10 s and thay goes back, in increment of 5s form 2 to 200?
 
Status
Not open for further replies.

Latest threads

Back
Top