07-25-2023 11:45 AM
Currently using CAN communication to communicate with supercapacitors and trying to collect voltage data. When attempting to display the voltage the graph isn't smooth, there are short jumps. Is there a way to smooth out the graph while running in real-time? Is there a way to make the data smoother or is it due to slow reading time? Can someone explain how to read the data faster if that is the issue?
07-25-2023 11:58 AM
It is usually related to the timing you use to read the data. Share your project and code, then we will be able to provide suggestions for improvement.
07-25-2023 01:08 PM
Hi Ryan,
@Ryan8542 wrote:
When attempting to display the voltage the graph isn't smooth, there are short jumps.
What is the resolution of the voltage signals of those supercaps?
Mind to share some information (like a DBC file or detailed manual)?
How do you read the CAN messages? How many messages do you receive from your supercap per second?
07-25-2023 01:15 PM
07-25-2023 01:40 PM - edited 07-25-2023 01:41 PM
Hi Ryan,
07-25-2023 01:46 PM - edited 07-25-2023 01:47 PM
Would changing the sample rate of my RT VI fix my issue and if changing it fixes it how do I change it?
The thing is when I read in it comes out as a cluster and FIFO doesn't seem to work with clusters.
07-25-2023 02:00 PM
Hi Ryan,
you can easily parse the CAN message(s) in the FPGA and use a FIFO to send "just" the voltage values (suggestion: pack 2/4 values into a U32/U64 packet) to your RT host. The RT host can then rather easily unpack the U32/U64 data to the resulting 2/4 U16 values and apply the scaling factor to receive the resulting DBL voltage values…
The nice thing about CAN messages is their known/pre-defined message formatting: this allows to offload parsing work into the FPGA "for free"!
07-25-2023 02:03 PM
Although personally, I don't like to see many wires lying around, I want to give a Kudo for the neat placement of the wires.
When it comes to CAN communication, you should bear in mind that it is non-deterministic by nature. What is the sending rate of the CAN frame? The manual states that it is 0 (polling) by default but can be configured for a specific rate.
Apart from the latency from the CAN communication, you are using shared variables (which is polling by nature) to send data from cRIO to host VI for displaying. Network communication is again non-deterministic as well. If you want the data to be sent at interval, you should use Network Streams instead.