For starters, can you tell the dimensions of each matrix ? It will make it easier to think further.
Assuming that u(t) and c are both of same dimensions. If they are, you can just make it :
der(x) = F*x(t)+G*[u(t) + c] , because u(t) is an input ( usually the one we control ) and c is also an input, only it's an external one. u(t) suggests it's time varying input, but that's just a general case, it doesn't have to be.
Edit after your comment:
Now that you have explained that u(t) is a 1x1 scalar, I see a solution, that may be too simple to work. You said you are using lsim command in Matlab, so I suppose you pass state space (ss) system model to it. In that case, since according to your comment u(t) is a scalar, G*u(t) is a constant 6x1 vector. Therefore, you can make a substition and say [G*u + c] is your new G matrix. For now I assume you are familiar with this part of using Matlab, but just in case you need a kickstart:
Matlab documentation on this website:
LINK
Says you can pass systems to lsim in this fashion :
[y,t] = lsim(sys,u,t)
[y,t,x] = lsim(sys,u,t) % for state-space models only
[y,t,x] = lsim(sys,u,t,x0) % with initial state
You shouldn't be using the PID output as a velocity command in your system, as it will simply become unstable and eventually oscillate between one end limit and the other, or have no response.
Using a linear actuator as you are, you should use the output of the PID as a position command, and have the actuator follow the output that way. By setting the PID min and max limits, the end of travel switches are only safeties if something goes horribly wrong.
Also, if you detect that your PID is at either limit (which it might have to be if the response is very slow), you want to inhibit the integral term for as long as it is at a limit so that you don't suffer from integrator wind-up.
PID's work fine on motor controls, true, but I use them industrially to control temperatures easily on systems with several minutes of lag. Tuning is everything... Remember the basics, Proportional gain will only get you (approximately) half to three quarters way to the setpoint, Integral gain will take you the rest of the way. Derivative tempers the change.
For temperature control loops with a long lag, I find it much easier to ramp the setpoint up slowly to the final setpoint rather than jump it immediately, it allows a tighter tuning of the PID without having it go into oscillation.
Best Answer
Unfortunately the answer is not as straightforward as you might like.
Let's define to Open Loop Bandwidth as the frequency at which the loop gain is 1 (standard definition). Above this frequency the loop can not respond effectively to commands or feedback.
In an ideal system Sampling Rate compared to Open Loop bandwidth does not really matter so long as the Nyquist criterion is satisfied, but in any real system delay is usually associated with the sample rate clock (e.g. digital controller calculation time), then the relationship between Sampling Rate and Open Loop bandwidth really does matter. As a guideline the crossover frequency must be less than the reciprocal of the time delay in the loop : Wc < 1/Td .
There are several factors involved in loop delay: Time to measure the sensed value, Time to calculate the response, time to Activate the response.
The time to activate the response may be misleading. It's not just the response of the actuator. It's also the delay involved in converting from Discrete time to Continuous time (e.g. a DAC). The delay here is due to the Zero-Order-Hold effect of the conversion. All Linear Discrete Time control systems have this delay. The delay = T/2 where T is the sample period. So, assuming (as you have stated) all delays in the loop are negligible, then we only have to account for the ZOH delay (T/2) and therefore the max achievable bandwidth is Wc < 2fs (where fs is the sample rate) which gives the max achievable bandwidth in Hertz as fc < fs/pi .
Keeping the open loop bandwidth less that 1/10 sample rate is a good idea for a discrete time controller, controlling a continuous time plant. That's because you can reduce the effect of frequency warping in the model conversions from continuous to discrete.
However, despite all that, the most important aspects are not covered by any of the above discussion. You really do need to know what you are controlling because several factors may influence the bandwidth of the controller as well as the type and structure. Is it a stable open-loop system? If not then this open loop bandwidth must be significantly greater than the frequency of the unstable mode. Is it linear? If not then a linear controller may be unsuitable. You may need something like Receding Horizon Control (which does not have a bandwidth as such). Is it minimum phase? If it is not the open loop bandwidth is usually required to be less than the RHP zero frequencies.