LabVIEW PID Controller - Convert gain constants between PID algorithms - labview

How can I convert the PID gain constants Kc, Ti and Td to the alternate form Kp, Ki and Td in LabVIEW?
Alternatively, how can i use Kc, Ti and Td in LabVIEW PID control?

To address your first question, this VI does exactly that.
For your second question, the LabVIEW PID VIs all use the "academic" forms (Kc, Ti, Td). So, you can just wire those values in to the "PID gains" terminal in the PID VI.

Related

Is there a way to turn off a vehicle signal in SUMO?

I know that you can turn on a vehicle signal (for example, the left indicator) in traci using:
traci.vehicle.setSignals(vehID, int)
where the integer related to the specific signal can be found using the following link (https://sumo.dlr.de/docs/TraCI/Vehicle_Signalling.html#signaling), but is there a way of turning off a specific signal that would be otherwise turned on by the program (i.e., a setSignalOff)?
I think that there is a function in the underlying C++ code (switchOffSignal() in MSVehicle.h) but there doesn't appear to be a traci command that turns off a specific signal.
I appreciate that it is (generally) a pleasant visual aesthetic and has no impact on vehicle behaviour, but it would be very useful for what I am trying to do!
Switching off signals should work from traci. By using sometihng like traci.vehicle.setSignals("ego", 0), I can switch them off. Be aware that this will be reset after the step, so you may have to do that in every timestep.
So, Michael is right in that:
traci.vehicle.setSignals("ego", 0)
should turn off all signals (although the signals still appeared on for me visually, which confused me initially).
To turn off individual signals but keep the others on you need to:
For all the "on" signals find the value of 2^n, where n is the bit integer (which can be found using the following link: https://sumo.dlr.de/docs/TraCI/Vehicle_Signalling.html)
Sum all these 2^n values (let's call this variable x) and use this value in the setSignals function: traci.vehicle.setSignals("ego", x).
So for example, if we want the brake light, the right indicator and the high beam on (but all the other signals off) we would do:
RightIndicatorValue = pow(2,0)
BrakeLightValue = pow(2,3)
HighBeamValue = (2,6)
SignalValue = RightIndicatorValue + BrakeLightValue + HighBeamValue
traci.vehicle.setSignals(("ego", SignalValue)

how to drive a dotstar strip from C on a raspberry pi

I am trying to figure out how to drive a dotstart strip by calling write(handle, datap, len) to an SPI handle, from C, on a raspberry pi. I'm not quite clear on how to lay out the data.
Looking at https://cdn-shop.adafruit.com/datasheets/APA102.pdf#page=3 makes me think you start with 4 bytes of 0, a string of coded LED values (4 bytes per LED) and then 4 bytes of 1's. But that cannot be right; the final 4 bytes of 1's would be indistinguishable from a request to set an LED to full brightness white. So how could that terminate the data?
Insight welcome. Yes, I know there's a python library out there for this, but I'm coding in C++ or C.
After much digging, I found the answer here:
https://cpldcpu.wordpress.com/2014/11/30/understanding-the-apa102-superled/
The end frame is more complex than the spec suggests, but the spec is correct if your string has 32 LEDS, and you must always specify values for all LEDS in your string.

Data transfer from PC to FPGA

I Have a simple function in FPGA ( like an adder ) but I want to this adder get the inputs from PC from ( Quartus II )
for example I want to add two 12 bit number but I haven't enough switches .
How get input from pc and send them to FPGA and How get them in FPGA ?
(I just have USB Blaster Cable )
Since you are already using the USB Blaster, you could use the in-system sources and probes feature. That will allow communication to and from the FPGA through the USB Blaster.
ISSP

tie two inout together vhdl

I want to drive a birectionnal logic signal through the FPGA.
PGD_ICD <--> PGD_TARGET
for those who have recognized the Microchip ICD3 you know that PGD line is bidirectional.
I've read that we can't do something like that but have you any idea ?
many thanks
Passing a bidirectional bus through an FPGA without knowing the bus protocol won't work.
While FPGA I/O pins do support tristate logic signals (floating output state), you will need to know when to drive a value onto the output, and when to tristate the output (high impedence, or 'Z').
Once you have a signal (for example out_enable) that is '1' when you want to drive a value and '0' when the output should be floating, you can use a tri-state buffer to drive the output:
out_pin <= out_signal when(out_enable='1') else 'Z';

I need to request an interrupt...but which one?

Debian 2.6.30 on a glomation gesbc-9260
with an atmel arm cored chip at91sam9260 - datasheet
I want an interrupt on a GPIO pin
i need to use request_irq(interrupt number, *handler, conditions, name, id)
but god only knows what interrupt number i use ... if it were ttys0 i'd be fine...
any help would be a godsend
It depends on which GPIO you want.
The file arch/arm/mach-at91/include/mach/gpio.h lists the #defines for requesting GPIOs as IRQs.