mouse86
Newbie level 3
I have a small steering poke that outputs 4/20mA and a small engine that uses 4/20mA to determine what position it should be.
Now the signal transition from the poke is going too fast. E.g. when a full turn is done by a user (say from 4->20mA) the engine goes way to fast to his endpoint@20mA and damages mechanics since the power of the engine.
So I created some hardware that inputs 4/20mA (ADC) from the poke and outputs 4/20mA (DAC) to the engine.
Now, when there is a full turn done by the user with the Poke I want to reach the endpoint in about 6 seconds. In this time there should be a soft start and a slow-shutdown. This is mostly to prevent all the mechanics for a major blast.
So the signal should increase slowly (soft-start) like a x^2 and end slowly like a Square root.
I tried different thinks in MathLab, but it isn't going very well since I do not know what the best is what I can do. Can anyone supply me some kind of formula? Or give me some tips?
This is what I've now:
calculation = ((lastSample)*0.90+ (newSample) *0.1)
// above draws a nice slow-stop, it is actually some kind of low-pass
// with this below I was trying some things to built a soft-start, but it failed
if (calculation > lastSample + maxIncrease)
lastSample = lastSample + softstart;
softstart = softstart + 0.01;
end
but now I don't know how to continue.
Now the signal transition from the poke is going too fast. E.g. when a full turn is done by a user (say from 4->20mA) the engine goes way to fast to his endpoint@20mA and damages mechanics since the power of the engine.
So I created some hardware that inputs 4/20mA (ADC) from the poke and outputs 4/20mA (DAC) to the engine.
Now, when there is a full turn done by the user with the Poke I want to reach the endpoint in about 6 seconds. In this time there should be a soft start and a slow-shutdown. This is mostly to prevent all the mechanics for a major blast.
So the signal should increase slowly (soft-start) like a x^2 and end slowly like a Square root.
I tried different thinks in MathLab, but it isn't going very well since I do not know what the best is what I can do. Can anyone supply me some kind of formula? Or give me some tips?
This is what I've now:
calculation = ((lastSample)*0.90+ (newSample) *0.1)
// above draws a nice slow-stop, it is actually some kind of low-pass
// with this below I was trying some things to built a soft-start, but it failed
if (calculation > lastSample + maxIncrease)
lastSample = lastSample + softstart;
softstart = softstart + 0.01;
end
but now I don't know how to continue.