Speed Up/Down with 3-bit output

ian329

Member
Join Date
May 2011
Location
s
Posts
8
I have a motor drive, which has 7 preset speed settings, selected via a 3-bit input (ie 001 = speed one, 010 = speed two etc etc).

The drive is connected to a Siemens S7-300 CPU312C.

Control of the drive is via a panel that includes "Speed Up" and "Speed Down" buttons and a 7 x LED bar that displays the current speed. (also connected to the PLC)

Can anyone advise the best way to tackle the handling of the speed changes please?

An example of the sequence would be:
* Drive is currently on Speed #1 (PLC Outputs are 0,0,1), First LED only is illumintated on the panel
* User presses "Speed UP".
* First & Second LEDs now illuminate.
* PLC Output to drive changes to 0,1,1 to reflect speed TWO

My guess is that I need a function that adds 1 to an integer in memory with each speed increase (and -1 for decrease).
What I don't know how to do is output that integer as binary to the PLC outputs.
Also Don't know how to output 1-7 +24v signals (to LEDs) based on what the number is (1-7).

Can anyone fill in the gaps in my knowledge please!! Thanks a lot
 
Haha I wish it was homework! my job wouldn't be on the line then!!

I've been given a project second hand from another colleague and whilst i've done simple PLC I/O stuff with coils and contacts before i've not had to go any more complex.

Have spent the last few days reading but can't seem to find any resource on the net that explains converting decimal number to a binary output on the PLC or a suitable method to light the 7 LEDs.

The drive is an ABB ACS550 if anyone is interested. I'm actually using two in tandem with double outputs from the PLC (not that that affects the question hence not including that!)
 
Button Inrease speed should add 1 to a memorybyte
Button Decrease speed should subtract 1 from a memorybyte

The value stored in that memorybyte will be the speed of the motor

0 decimal --> 000 -> Motor Off
1 decimal --> 001 -> Motor Level 1
2 decimal --> 010 -> Motor Level 2
.
.
7 decimal --> 111 -> Motor Level 7

To this you need only apply limit checks, as of

if value > 7, value = 7
if valye < 0, value = 0

Harder to say how you should do with the indication since i don't know what HMI you're using.
 
Sorry, missed it.

Ok lets say you store the speed in MB10 then you just ahve to do this to output as binary output.

L MB10
T QB128 //Say 128 is the address of your DO module

Now outputs 0,1,2 will follow your speed.
 
pethoek, what about the other bits in QB128 ?

surely some form of "masked move" is required to leave the state of bits 3-7 unchanged ?

I'm an A-B man, and I would use a counter for the increase/decrease functions, then I would use a "Masked Move" instruction, with a mask of 2#00000111, to transfer bits 0-2 of the counter accumulator to the output.

Surely you can do similar in S7 ?
 
Pethoek, Daba - That's great info, I can see now how to write a byte to the DO from what you've given and although I see what you mean about the masked move I am lucky enough to have lots of spare outputs so for this I will ignore bits 3-7.

Second part then is to light up LEDs 1 through 7 based on which speed is selected [e.g. 001 = 1 LED lit, 111 = 7 LEDs lit]. (think of a sound level meter, but for speed!)

Is there a built in function that can do this. The only alternative I can see is to use a lot of logic gates to work it out, but i can't believe there's not a simpler way!

Thanks loads for your help
Ian
 
Just a thought here but the ACS550 has a MOP macro which sets up the drive speed reference with two digital inputs, one is increase speed and the other is decrease speed. That's the same as the buttons on your plc so you wouldn't have to translate into seven preset speeds.

All that's left to do then is take the analog speed output from the drive back to the plc and set up your bar code display based upon actual speed rather than commanded speed. Of course, you could still do it with commanded speed if you don't have an analog card.

That kind of inc/dec speed control is called MOP (Motor Operated Pot), floating point, or incremental speed control and many drives offer it.
 
Of Course as stated, the output has to be masked.

Maybe something like this, i have not checked this, i need to go now. But i think it may work. Maybe not the nicest code.

Code:
      L     QB   128
      L     W#16#F8
      AW    
      L     MB    10
      OW    
      T     QB   128
 
Thanks DickDV,

I am not using the MOP option only because I have two drives and due to the (low, but nevertheless) potential for them to become out of sync if I only send inc/dec commands i'd rather send the 3-bit speed reference to both.

For the second part i'm looking at having 7 separate IF statements for the memorybyte that set the DO module to show the 7 LEDs, eg... [pseudo]

if memorybyte = 1dec output = 00000001
if memorybyte = 2dec output = 00000011
if memorybyte = 3dec output = 00000111
if memorybyte = 4dec output = 00001111
if memorybyte = 5dec output = 00011111
if memorybyte = 6dec output = 00111111
if memorybyte = 7dec output = 01111111

(obviously ignoring the last bit as I only need 7)

Does that seem a long winded way of doing it or is it going to be the best way.
cheers
 
The out-of-sync issue can be resolved by making one drive follow the MOP speed reference and making the other drive into a speed follower of the MOP drive. That way the second drive always matches the first drive.

Of course, if you only want seven speed steps, then using the fixed speed inputs is the way to go.
 
Thanks for amazing answers guys, This is all coming together now!

Daba - your [output = (2^memorybyte)-1] is perfect. Any ideas how best to represent that in Ladder Logic? There doesn't seem to be a X-to-power-of-Y function in Step 7.

Alternatively moggie's approach with a separate network for each scenario will work (thanks moggie).

Slightly off topic, but the S7-300 CPU312C has an RS485 socket on right? What's the quickest way to get it hooked up to my PC (either serial, ethernet or USB not fussed)? I had assumed naively that it was RS232 and I could just plug it straight in but nope! I assume you can't program it using the memory card??
 
Hi!
If you plan to use S7 more, I think you would like to have a USB-MPI adapter. I don't know your CPU type, but if it has an ethernet interface you can also use that. But it can be a bit fuzzy to assign a proper IP the first time. You can search the forum for S7 and adapter.

Daba - your [output = (2^memorybyte)-1] is perfect. Any ideas how best to represent that in Ladder Logic? There doesn't seem to be a X-to-power-of-Y function in Step 7.

You will find in the S5-S7 Converting folder the FC125 "Accu2 to power Accu1".


Or you can perhaps use this shift variant:

EDIT: OOOPs shifting wrong direction! Should be SHL_W

shift.JPG
 
Last edited:

Similar Topics

Hello everyone! So basically I have this PF 525 that no matter what I do won’t let me speed down. It always shows 66.66 Hz and the parameters to...
Replies
11
Views
1,186
Good Afternoon , I have a machine that has 7 - Kinetix 6000 servos on it . All the servos want to run high speed and cannot slow down...
Replies
1
Views
2,151
Dear All, We have two SLC 5/03 processors in two unit of our machine which have coupled with HMI (having RS View 32 Works & RS links) through...
Replies
1
Views
1,521
Does anyone know what the data transfer rate for this series of CompactLogix PLC's? 1769-L24ER-QB1B to be exact. Cheers.
Replies
1
Views
97
Hello, I am trying to setup on plc so If I enter 60 jph (job per hour) it will send the vfd hertz based on what jph is entered by...
Replies
2
Views
155
Back
Top Bottom