AB ML1000 percentage calculation without floating point numbers

grnick50

Lifetime Supporting Member
Join Date
Nov 2010
Location
Ptolemaida
Posts
332
Dear All,

Happy new year. I wish you all the best for 2012.

I am writing an application using an AB ML1000 to apply positioning using an encoder on a dough folding machine. I am forced to use ML1000 as it was surplus at my client's stock.

In the program I need to calculate the actual position in percent of the travel of the folder arm. I was thinking to calculate:
(actual_pulses / max_possible_pulses)*100.

But then I realize that ML1000 does not use floating point maths. So plan B was to calculate:
(actual_pulses * 100) / max_possible_pulses
But then I realize that the maximum value of the actual pulses can be only 327 which is unexeptably low.

If actual_pulses exceed 327 e.g actual_pulses = 328, then 328*100=32800 which overflows the controler and gives a fault.

Is there a work around to calculate this percentage?

BR

Nik
 
Well the maximum value is not clearly stated and it will be determined during the commissioning process.
To get a decent resolution I will use at least a 1000 pls/rev encoder. So at the point I intend to install the encoder I would expect a max_pulse value of 750.

I already looked at the SCL function tried it and it works. However it looks like there is no Unscale function to do the reverse. Convert percentages to pulse setpoints.
 
There is no Floating point File but I believe it does do internally floating point maths so maybe this would work.

100 Div 725 Then multiply the result by 328 to get a 45% answer.

I don't have a Micrologix with me to prove this though
 
It doesn't do floating point math internally, however it does do 32 bit math. You must however use the DDV (double divide)instruction to get your final result. After multiplying actual pulses by 100 ignore the value in the destination register. The answer you want to use will be in the math register. DDV by the max possible pulses to get your percentage. Make sure you unlatch any overflow bits as well.

Look at the instruction help and the manual for more info on using the DDV instruction.
 
Last edited:
Dear Peter,

It is a simple application where the client already had some equipment. There was no intention to use inadequate hardware to save money.
Moreover, the positioning accuracy is not very critical. The operator only needs to set a percentage and not counts.

Regards
 
So how many meters does this positioned have to move?
At what speed or in what time?
What is the position tolerance?
When you change the position to go to will you simply change the position set point or will you ramp it smoothly from the current position to the set point position?
 
Think of it as a half meter long section of a conveyor that pivots around a fixed point. At rest it sits vertically and that is my zero point. When it starts it has to move an amount of pulses left of the vertical posistion (zero) and an amount of pulses right of the vertical posistion. The maximum travel from left to right I would say is no more than a meter long.
The speed is not great as the travel from left to right takes around 4-5 secs.
The position tolorance is 1cm.
When I change the position to go to I will simply change the position set point.

BR
Nik
 
Dear Tcollony,

Your suggestion seems the answer to my problem.
I tried using DDV but in the previus step of multiplication when I multiply Act_pulses * 100 as soon as I hit 328 pulses the PLC overflows and stops.

In the processor status I set Math overflow selected S:2/14 to one.
And in a rund before the MUL instruction I uncoditionaly unlatch
S:0/0 & S:5/0.

It still does not work though as S:5/0 goes true when the PLC overflows, regardless the fact that I keep it unlatched.

Regards
 
Dear All,

Thanx for your support. My problem is sorted now using DDV.
It is easier than SCL without as much limitations.
The trick was to unlatch S:5/0 at the last rung after the DDV instructions.

Regards
 

Similar Topics

Hi all, after much aggravation trying to get my SLC5/04 to talk half duplex to RSlogix so l then would be able to communicate with both RSlogix...
Replies
0
Views
2,237
I have a customer with an existing ML1000 that we installed quite a few years ago. It's function was rather limited but did what we wanted. New...
Replies
5
Views
2,682
I feel really, really dumb asking this, but I shall. I am using a Micrologix 1000 to toggle two outputs. I am using a timer to time and it...
Replies
3
Views
1,496
I have set up two 1761-net-eni modules and have them working on our network. One module will communicate with the ML1000. The other gives 2-3...
Replies
3
Views
1,765
I have a customer that has a ML 1000 we installed years ago. It is limited to the function of Stopping a series of motors when bin limits go HI...
Replies
1
Views
1,703
Back
Top Bottom