Unable to manage desired output of PID controller - controls

I am trying to drive a BLDC motor using FOC algorithm. As shown in the figure, I have implemented an RPM controller on top of current control loop of FOC, where the output of RPM PI controller is directly fed to the Iqset of FOC block and Idset is kept at 0.
figure
Problem: I want Iqset to vary form 0 to 60A but this value is low, even at the stalling load Iqset reaches to only 4 to 5A. I have tried different values of Kp and Ki for tuning the RPM controller but unable to achieve the desired result.
I don't know where i am wrong, any help would highly be appreciated.
Further experimental Info: I have tried setting the Iqset at 0.25A just to eliminate the RPM controller, in that case motor runs at full speed with no problem. That brings my attention to the RPM controller but i don't know where i am wrong.
Thanks.

Related

In Veins does "RecievedBroadcasts" also consist of "SNIRLostPackets" and "RXTXLostPackets"?

I would just like to know if the value of "RecievedBroadcasts" for each of the node in Veins also consists of the packets lost or does it just give the number of successful packet receptions. That is if I want to calculate the packet loss ratio, then would it be TotalLostPackets/RecievedBroadcasts or TotalLostPackets/(RecievedBroadcasts + TotalLostPackets).
Thanks for your help
Your best bet to find out exactly how statistics are logged is to look into the source code of Mac1609_4.
You will find that the ReceivedBroadcasts scalar logs the value of variable statsReceivedBroadcasts which is increased via a method called from handleLowerMsg, so only when the Mac layer successfully decoded data.

ftrace: output through GPIO

I am doing some research and need to collect all the kernel function calls within a certain time span, e.g. 60 seconds. I am using Raspberry Pi 4B.
I've tried to use the function tracer ftrace and read the trace_pipe via
echo function > current_tracer
echo 1 > tracing_on
cat trace_pipe > /home/pi/trace/test.txt
This method seems to be too slow and too much data gets lost due to overfilled buffer: approx. 50-60M data points get lost and I only get about 3 M data points. So that's not a good statistics.
I also tried to use trace-cmd:
trace-cmd record -p function sleep 60
With trace-cmd about 20 M data points get lost, which is much better, but still not good enough to build a good statistics. Furthermore the file I get by doing
trace-cmd report > /home/pi/trace/test_trace-cmd.txt
is about 5-6 Gb and takes a few minutes to write. I don't have an intention to make this file smaller (I assume it is impossible). But I just can't wait for so long.
I also worry about producing too much overhead to the system by saving such big trace files. Is it the case?
I am wondering, if it would possible to direct the output of the trace_pipe (or maybe of some other tracing file) to some I/O pin, so that I can connect some logic analyser to this pin and read the data flow by some other device? There will be no need to save the tracing file on the raspberry itself then. I also hope I can reduce the amount of data getting lost.

How to process sensor data in LabVIEW? Every value is 255

I'm trying to read data from the Yost Labs 3-Space Sensor Nano into LabVIEW via an NI MyRIO (1900). I was able to set up a sequence that communicates with the sensor through SPI. However, every time I run the program, it just spits out a single value of 255.
I think understand that I need to include something that allows all the bytes to be read. I just don't know how to go about it.
As an example, I'm trying to read the gyros (0x26) which have a return length of 12 and is a vector (float x3).
Here is my labview code
and here is the manual for the sensor. The commands I'm using are on pages 29-33. In the image, 0x2B is 'read temperature'.
Any help would be greatly appreciated! Thanks :)
Edit: i had messed up the wiring so now the output jumps between ~35 to 255. I'm still having trouble getting all 3 gyro values from the SPI read.
Quoting from Joe Friedrichsen in his comment:
The express block that resets the sensor is not guaranteed to precede the loop because there is no data flow between them. The LabVIEW runtime can see two independent and parallel groups and may choose to execute them simultaneously (which on the wire might mean reset comes between loop commands) or in "reverse" order. Add a wire from reset block to create a terminal on the loop.
Here's a picture of the fix.
You may wish to consider stringing the error wire through your program and wiring it to the stop terminal of the While Loop. Currently, your loop will keep running even if there's a fault in your hardware. Using the error wire would eliminate the need for the flat sequence structure.

How to run a Lua script at a certain hour mark?

I've altered one of the popular clock skins for Rainmeter to be exactly how I want it. However, the only issue is that the '1' in the clock for hours 10, 11, and 12 gets cut off by the edge of the skin with the current margins.
I know exactly which value needs to be altered at the given times, so all I need to figure out now is how to run a Lua script to change it when the clock hits them. Problem is, after much searching I don't have the slightest clue how. It definitely seems like something that should be easily possible.
You need to run your lua script as a cron job.
In order to achieve this I'd suggest you use this cron.lua module which has the functionality you want. One example of what you can do is the following:
local clock = cron.every(time, callback, ...).
--Creates a clock that will execute callback every time, periodically. Additional parameters are passed to the callback too.
The callback variable is the code you want to be executed at every interval.

Different output when trying to grep and awk CPU % from xentop

I have set up an ssh connection from my mac to XenServer. I'm able to get the metrics for CPU and memory using xentop command as shown below
Further, I wanted to get the CPU utilization using a bash script so that I So that I can get the average values for this, as shown below.
.
As you can see in the above figure, The problem I'm facing is that the first value is coming out to be zero, followed by other values. For all the times the first value always comes as 0. Can someone please explain what I'm doing wrong.
PS: The -bi3 means that the command will be executed thrice.
Please let me know if you have any questions.
Thanks in advance.

Resources