Jump to content

How can I steadily and automatically reduce analog output?

Recommended Posts

Hi, all!

I've put together a program to control tumbler rotation speed at my workplace (think giant cement mixer).

I've but some protection in there to prevent operators from going full anticlockwise to full clockwise at the drop of a hat and damaging the drive system. I've also included a stop button. The stop button however is only available to be pressed when the speed is set to less than 30% either way. Is there a way I can set it up that when the stop button is pressed at any speed, it will steadily reduce the output over, say, 10 seconds until 0 is reached? I tried comparing if MI != 0,  decrement MI -> cycle, but it through a wobbly and i couldn't understand why.

I'm not after someone to write the code for me, but just a text based pointer in the right direction would be really appreciated!



Link to comment
Share on other sites

  • MVP 2023

A quick reply before shuteye!  What you are wanting to do is "ramping".  You will likely find that your drive can do this for you....most variable speed drives can......so that all you need to do from the plc is tell it the most basic instructions like stop/ go /direction.  This method does make it easy.

However, if you want to do it all through the plc, an example would be to use a MI (linked to the drive output) that starts at 4000 (for example) and you subtract 1 from it every few scans to reduce it down to the 0 output that has the drive turned off.  You then ramp it up the same way for the other direction.  Depending on your scan rate you might achieve what you want doing this every scan, but you may also need to do the subtraction every 2nd, 3rd or however many counts the scan time/ramp time maths works out to arrive at your ideal ramping speed.

To adjust the speeds to other ones, you would have the same sort of thing in place....the current MI output is the start point, and another is the target which gets ramped to and then once reached becomes available for the next speed change input. 

Don't forget emergency stops in all of this!!



  • Upvote 1
Link to comment
Share on other sites

Thanks for a swift reply!

I still have to wait for my posts to be approved, and in the meantime I managed it. I've attached how I did it for some critiquing if anyone feels like it. It works, but it may not be best practice. I'm going to look into the method you described, however.

As for E-stops, the machine is fitted with them! This is purely for the speed signal, feeding into a driver card that is only enabled/disabled via the machine. The PLC is essentially a pretty but overpriced potentiometer. The business gets what the business wants though...

Thanks again.

When MB15 (my hmi stop button) is pressed, and the speed is anything but 0, the stop cycle latches on with MB20.
Once latched, a 1 second timer is started, and it checks whether we need to increment or decrement to reach zero, and starts the next process. If at zero, it removes the stop latch at MB20

1 stop.png

If decrement is required, after the 1 second timer is up, we decrement the speed setting by 1, and reset the 1 second timer. But because the stop cycle is latched, after another second we decrement again. When 0 is reached as above, we reset the stop cycle. Rinse repeat for Increment.

2 stop.png

Edited by Kieran
Added descriptions for ladder logic
Link to comment
Share on other sites

I have similar applications. Here is how I handle them. First off depending on the drive you are using, I program one of the outputs on the drive to  ZERO SPEED and not allow it to change until it is at zero, secondly you can add a TD and give it a few seconds before it starts . As for the ramp down, I would program the ramp down in the drive. It's much easier and you have more control that way.


As Ausman said E-Stops!! never forget

Link to comment
Share on other sites



You can use direct contact of SB15 (100mS pulse) as a condition to increment an MI from 0 to 100 (10 Sec).

Then use Linearization block with the following settings:

- Link this MI to the X value

- Link your analog output to the Y value.

- Set Y limits to the analog output range (0-4095 for 12-bit analog output)

-  Set X limits to 0-100


If you want to achieve ramp-down function,  simply use SB15 to decrement the MI from 100 to zero.


(PS) As Aus wrote, all frequency drives support ramping function.

Never saw a VFD not capable of doing this, it is the acc/dec parameter for most of the drives.


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...