It's interesting. Is it the controller you described in the lejospid.pdf on your site?
I use motor's emulator. It solves circuit equation and the motion equation like this
http://web.mac.com/ryo_watanabe/iWeb/Ryo%27s%20Holiday/NXT%20Motor.html. I use Apache common math library to solve differential equations.
The emulator calculates the speed and position every tick. In Lego controller tick is equal to 1 ms, in leJOS controller it equals to 4 ms. All diagrams are built using 4ms sampling interval.
For emulate variable load I used sine function like this:
- Code: Select all
private double loadForce(double omega, double time) {
//variable load, bidirectional
return Tau_d * 2 * Math.atan(10000 * omega) / Math.PI * (1 + Math.sin(time * 5) / 2);
}
Yes, in high load test the load has been applied in one direction.
I can send you the test sources, if you are interested.