Differentiation of an Analogue Value

erdemsvri

Member
Join Date
Jul 2009
Location
Germany
Posts
172
Hello

I want to calculate the differentiation of an analogue value in time. Simply the variable is x an I want to calculate d(x) / dt. What is the mathematics formula by itteration for y where y = d(x) / dt.

Thank you.
 
Thank you.

I didnt realize it is that easy. Also I was thinking of gather more than one samples and comparing them like a convolusion but this simple solution really gets it going so no need for complexity.
 
Kalle, do you compute rates like that?

erdemsvri said:
Also I was thinking of gather more than one samples and comparing them like a convolusion but this simple solution really gets it going so no need for complexity.
Try Kalle's simple method. If that doesn't work then come back.
A convolution works much better. It helps to know the requirements and the type of data you are filtering.
 
Hello

Thanks for the contribution. I always appriciate your help.

What I am trying to do here is to take the derivative of the analogue speed feedback from a DC drive to gather the acceleration of a pendulum driven by a motor so the customer wants to do a basic force analysis and show it on the hmi so we need to gather the acceleration of the pendulum. The speed feedback is a litlle noisy right now beacuse it comes directly from the armature voltage of the DC motor since drive runs a open loop motor control.

So I could really use some better ideas and looking forward to hear them from you. Thanks very much.
 
Does this mean that Kalle's method didn't work?
If this is for a HMI then you should be able to tolerate a fairly big phase delay. If you want to do a convolution the the Savitsky-Golay filter is what you need to use.
http://www.google.com/search?client=safari&rls=en&q=savitzky-golay&ie=UTF-8&oe=UTF-8
You can even try the Holoborodko filter which is similar.
http://www.holoborodko.com/pavel/?page_id=245
You can see I have posted on his forum.

Other options are using filters such as a 4 pole Butterworth filter.

If what is the frequency of the pendulum swinging? Can this be modeled? There are plenty of simulations of pendulums swinging. If you can derive a model then a steady state Kalman filter can be used but that is getting more complicated.

What programming language are you going to be using and CPU or PLC will you be using? Some algorithms take much more CPU clock cycles than others.
 
Does this mean that Kalle's method didn't work?
If this is for a HMI then you should be able to tolerate a fairly big phase delay. If you want to do a convolution the the Savitsky-Golay filter is what you need to use.
http://www.google.com/search?client=safari&rls=en&q=savitzky-golay&ie=UTF-8&oe=UTF-8
You can even try the Holoborodko filter which is similar.
http://www.holoborodko.com/pavel/?page_id=245
You can see I have posted on his forum.

Other options are using filters such as a 4 pole Butterworth filter.

If what is the frequency of the pendulum swinging? Can this be modeled? There are plenty of simulations of pendulums swinging. If you can derive a model then a steady state Kalman filter can be used but that is getting more complicated.

What programming language are you going to be using and CPU or PLC will you be using? Some algorithms take much more CPU clock cycles than others.

Thanks for your interest.

Kalle's method did work indeed but I have a curuosity about the practical information you can give about the filters because in theory I know them but when it comes to the practice I can not show my skills on these subject so I need a little guidance from the experienced people like you. I know principle of Butterworth filters but when I decided to write a PLC code for filtering I got little confused. Thanks for the answers.I will check the valuable info you give about the filters and also have read some previous threads. When I have a little time to think about this subject I will try to implenment these filters beggining from the Butterwoth to the complex ones you talked about.

By the way the platform is a Siemens PLC and I am writing code in SCL.

Thanks.
 
Hello Kalle

The noisy signal is measured from the analogue input integrated on 313C CPU which is connected to analogue speed output of the Control Techniques Mentor DC Drive. So I am derivativing the speed to gather acceleration.
 
It seems that the 313C integrated AI does not have the filtering possibility in the HW-Conf. Pity.

I just thought it would be easier to shape up the signal than to prog a complex filter and burn hours searching for the different poles and factors.

Btw; did you 'scope' the signal?

Kalle
 
Nope .

We didnt scope it but anyways the machine is working and this part is not about getting machine to work but to analyze how it works so they dont get it much important and I wanted to think how can I make it better but it works nice with the simple differentaitor you reminded me. Thanks.

And also the PLC is not the best platform to implement filters. Maybe I was thinking some other hardware to filter singal and maybe analogue filters? Anyways I will think more about filters when I have some free time. Thanks everyone.
 
I agree, clean up the signal first.

I just thought it would be easier to shape up the signal
That is the first place to start. I, my customers, have had little success reading the current directly. Usually a current or torque signal generated by the drives internal is required. The actual current is very noisy because it is a chopped of sine wave.

than to prog a complex filter and burn hours searching for the different poles and factors.
It doesn't take me that long. I have posted a Savitsky-Golay filter written in SCL on this forum before. No one seemed to care.

However, there is much more to making a good filter than "search for the different poles and factors". What are you searching for? Right now we have no clue. What is the sample interval, sample jitter, the frequency of the noise, the frequency that must be passed.

If you read the Holoborodko link you will see he has the coefficients for some simple filters worked out. It doesn't take much effort to copy them.
 
Exactly!
And who will pay for the spent hours?
Kalle
I can calculate filter coefficients easily. I have most of the work done, much is posted on my site. I just need to know what to do not how.

I have implemented filters of different type in ST. Doing the same in SCL should be easy. Simple convolution filters should even be easy to do in STL.
 

Similar Topics

Hi guys, As the title suggests, I'm wondering how you would implement differentiation and integration with respect to time. Basically, I want to...
Replies
20
Views
6,217
Hi I am looking for kind of sensors that can measure the distance of the open box (see the attachment for details). Is there anybody with...
Replies
4
Views
1,505
Hi, I have a ControlLogix system with 1756-IF16 analogue inputs. I can't scale the inputs at the card as there is a requirement to facilitate...
Replies
6
Views
113
Dear community, I am trying to find a tool for Allen-Bradley PLCs similar to SiVArch for Siemens PLCs to automatically generate faceplates and...
Replies
0
Views
70
I am using Mitsubishi PLC :FX3g and downloaded the program in it. When I connect Mitsubihi FX2N-4DA expansion module, it lost its communication...
Replies
3
Views
257
Back
Top Bottom