Sign in to follow this  
Followers 0
tingxing

Generate wave forms using LCPU

5 posts in this topic

Hello, 

I am trying to generate a wave form, such as sin, using mitsubishi's LCPU.

The problem I met is that time precision of the wave form generated is only about 30ms.

I checked my cpu scan time is about 2-3ms. my DA conversion specification is 1ms/channel.

I am afraid CC-Link communication delay is the cause, but not sure.

From the wave form, it seems some where time division is limited to about 30ms. I have expected at least for example 10ms can be obtained,

i.e. if the period of my wave form is 100ms, I can output and get at least 10 data points.

Would anyone give me some advice.

Many thanks in advance.

Ting Xing

 

Share this post


Link to post
Share on other sites

Have you read the topic ?
With 3ms scan time you should get 10 points per 30ms...
 

Share this post


Link to post
Share on other sites

Thank you very much for your reference link.

I am not sure, but what I got is not so quick: 10 points per 30ms.

what I got seemed to be limited to an interval of 30ms.  The attached file is what I took from oscilloscope, which I output interpolated value from table by using SCL instruction.

Though the table has about 10 points to describe Sin curve, it should not have been so coarse as what is shown in the picture. The picture apparently shows the limit of 30ms.

 

I  have checked scan time, which is 2-3 ms, and D/A's specification is 1ms/channel,

so the limit might be bottle-necked at somewhere else ...

Ting Xing

 

IMG_20190528_091724_40rpm#3.jpg

Edited by tingxing

Share this post


Link to post
Share on other sites

Hi,

I doubt that the speed of internal (interblock) bus affect to the speed of DAC. What may affect I can not say without studying your program.

BTW:
I've tested the algorithm, proposed by me, using a chinese replication of FX2N. In fact the chinese PLC has a better performance, than the original FX2N: the actual scantime, measured by a counter/timer routine, is equal to 225us and each scan of program I got a new data point of sine wave, i.e. it allows to output a sine wave with frequency up to 500Hz (resolution is 20 data points per sine wave period). The sample is attached. May be it will help you to localize a problem.

FX2N_Sine_Wave.zip

Share this post


Link to post
Share on other sites

P.S. The PLC, on which I made test, has a pair of AIs/AOs onboard.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0