Is it possible to perform this using the libpruio in order to read 6 analog inputs? If yes? What is the best way to implement it if other operations were need, i.e. compute the division of 2 phasors.
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/a0e5a09a-0468-404d-9bf2-3436a62065ea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
TJF,so I only need a C-code file like io_inputs.c (from libpruio examples)?
I need a fixed sampling rate (960 Sps each channel), calculate the 6 phasors and save in a file.
On Jan 27, 2017, at 4:43 PM, Renzo Fabián <elrr...@gmail.com> wrote:john3909,there's no reason to use the PRUs. I only need read 6 analog inputs in real-time. I thought the only way would be using the PRUs. And the best way by means of lbpruio.
El viernes, 27 de enero de 2017, 2:10:27 (UTC-2), Renzo Fabián escribió:I have the following C code's parts that uses tables of sins and cosins to calculate a fundamental phasor of 60 Hz electrical system using 16 samples per cycle (960 Sps):float cosins[]={1, 0.92388, 0.70711, 0.38268, 0, -0.38268, -0.70711, -0.92388, -1,-0.92388, -0.70711, -0.38268, 0, 0.38268, 0.70711, 0.92388};float sins[]={0, 0.38268, 0.70711, 0.92388, 1, 0.92388, 0.70711, 0.38268, 0,-0.38268, -0.70711, -0.92388, -1, -0.92388, -0.70711, -0.38268};...for(i=0; i <16; i++){ret_r=x[15-i]*cosins[i]+ret_r;ret_i=x[15-i]*sins[i]+ret_i;}return 0.088388*ret_r -0.088388*ret_i*I;Is it possible to perform this using the libpruio in order to read 6 analog inputs? If yes? What is the best way to implement it if other operations were need, i.e. compute the division of 2 phasors.Thanks.
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/6b983516-e883-4f94-91c5-e57aedf214e4%40googlegroups.com.
The IIO driver is faster and can achieve higher sampling rates.
Also the IIO driver is easier to use because you just read from /dev/iio:deviceX.
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/c3607ea4-2f25-41c5-b885-54c920e7a7f2%40googlegroups.com.
On Jan 29, 2017, at 2:17 PM, Renzo Fabián <elrr...@gmail.com> wrote:I understand there are many ways to solve the problem.1. Using PRUs via libpruio suggested by TJF.2. Using DMA via iio driver suggested by John.
3. Using a external ADC suggested by Woody.I understand the solution 1.John, can you send a example of ADC sampling and DMA?For 3, I don't want to use a external ADC for this project. But, for others I'll have in mind this solution. This solution would be possible with RPi3?Thanks you.El viernes, 27 de enero de 2017, 2:10:27 (UTC-2), Renzo Fabián escribió:I have the following C code's parts that uses tables of sins and cosins to calculate a fundamental phasor of 60 Hz electrical system using 16 samples per cycle (960 Sps):float cosins[]={1, 0.92388, 0.70711, 0.38268, 0, -0.38268, -0.70711, -0.92388, -1,-0.92388, -0.70711, -0.38268, 0, 0.38268, 0.70711, 0.92388};float sins[]={0, 0.38268, 0.70711, 0.92388, 1, 0.92388, 0.70711, 0.38268, 0,-0.38268, -0.70711, -0.92388, -1, -0.92388, -0.70711, -0.38268};...for(i=0; i <16; i++){ret_r=x[15-i]*cosins[i]+ret_r;ret_i=x[15-i]*sins[i]+ret_i;}return 0.088388*ret_r -0.088388*ret_i*I;Is it possible to perform this using the libpruio in order to read 6 analog inputs? If yes? What is the best way to implement it if other operations were need, i.e. compute the division of 2 phasors.Thanks.
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/a37f290e-bff8-4456-be21-bd72825b1bf0%40googlegroups.com.
Hi TJF,The IIO ADC can sample at 800K samples per second [1].
You cannot achieve that sampling rate with with PRU and have it do something useful with those samples.
I don’t see the purpose of having PRU read from /dev/iio:deviceX.
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/5148db1c-9819-47fc-a3e3-2a0dc8e1d9f0%40googlegroups.com.
Well, again it depends on what you mean by realtime. To most developers, it means deterministic
and since the AM335x ADC uses a sequencer to do the sampling, it is deterministic,
and hence there is no difference between the PRU and ARM with DMA.
This shouldn’t be a pissing match as to how fast you can sample, but rather focus on what the OP application was. In this case, since the PRU doesn’t have the required math functions,
the PRU is only doing what the DMA is doing, moving samples from the FIFO to DDR memory. Hence, why waste the PRU on such a trivial function. Rather save it for something more useful.
On Jan 31, 2017, at 7:19 AM, TJF <jeli.f...@gmail.com> wrote:
Am Montag, 30. Januar 2017 18:36:37 UTC+1 schrieb john3909:Well, again it depends on what you mean by realtime. To most developers, it means deterministic
Yes, deterministic:
- steady latency
- the lowest possible steady latency
and since the AM335x ADC uses a sequencer to do the sampling, it is deterministic,
The sequencer garanties a deterministic process from analog line to the FiFo buffer. You know that you cannot compute inside the FiFo. The data has to get to a processor register first. And the complete process, from analog line up to the processor register, has to be deterministic.
and hence there is no difference between the PRU and ARM with DMA.
There is a big difference, since the ARM gets loaded by other kernel tasks. On Beaglebone hardware under LINUX, the PRU is the only system that can garanty deterministic sampling (when bus access is unlimited).
This shouldn’t be a pissing match as to how fast you can sample, but rather focus on what the OP application was. In this case, since the PRU doesn’t have the required math functions,
The math in the original post contains simple table lookups, additions and multiplications. It's easy to implement that on the PRU (, but not necessary for 6 kSps).
the PRU is only doing what the DMA is doing, moving samples from the FIFO to DDR memory. Hence, why waste the PRU on such a trivial function. Rather save it for something more useful.
Yes, don't waste the PRUSS! That's why I didn't propose any customized firmware, but libpruio. Even if Fabián doesn't need the digital features (GPIO, PWM, CAP, QEP), he might use the trigger features to start the measurement at the same phasing, in order to make results better comparable.
Regards
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/91f0dff0-4d11-460b-bec9-f3ffb785387f%40googlegroups.com.
It is only the period between the samples that is important to be deterministic. After that, it doesn’t matter if there is any latency unless he is using the calculations in a control loop. If he is just doing phasor measurements, then latency isn’t important. You need to understand the application before you make assumptions like this.
On Feb 2, 2017, at 11:43 AM, Renzo Fabián <elrr...@gmail.com> wrote:Thank you TJF and John for share your knowledge.
Actually, I have in mind two projects based on phasor calculation:
1. A low-cost PMU (Phasor measurement unit) that requires the phasors calculation and then send to a collector.
2. A low-cost protection relay that requieres the phasors calculations, operations between these phasors and responses (digital outputs) every each fixed time. 960 Sps por each analog input and 280 Sps for each digital output.
I have began code and then I hope share it with you.
Regards.
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/4c763bd9-3023-46ee-af28-c7f4cdae8411%40googlegroups.com.