From: Jasper S. <jas...@gm...> - 2008-11-02 14:14:11
|
Yup, TU/e here. Everything ok in Nijmegen? Anyway, thanks for the info on the time testing. It's a simple yet efficient method to see what is going on in there. Doesn't printing things make it slow though? You are right that the current random thing acts as noise (quite big noise though). I'll make different sliders/options for the disturbances/physical parameters etcetera later on. Also, I'll put in different types of controller, rewrite some stuff etc etc.. Lots to be done, in due time. The controller is running at a faster rate because this simple ODE solver gives too large errors when the timesteps become larger than 0.01s. So I split the visual framerate from the simulation timestep. Greetz, Jasper On Sat, Nov 1, 2008 at 9:26 PM, Stef Mientki <s.m...@ru...> wrote: > hi Jasper, > > TUE ? > > Jasper Stolte wrote: > > Hi Stef, > > > > > > Now an interesting extension of your program would be to introduce a > > disturbance, > > simply by pressing a button, > > but even nicer by shaking the VPython window ;-) > > > > We just ran it on another computer windows/linux: > > Fedora 9.0, 200 fps ==> 50% processor time (dual core) , > > winXP-SP2, 200 fps ==> processor use 20% (time between frames > > 0,0,0,15, > > , so indeed an average of 5 msec) > > > > > > Indeed, I was thinking of reading the acceleration sensor of my > > notebook and using that to generate a disturbance in the simulation. > > Didn't get around to that though, so now it just has a random > disturbance. > Perfect, but please also add a button, for those who don't have such a > notebook. > I thought you added the random, just as a small noise signal. It would > be nice to give it big sweeper, after it has reached is equilibrium. > BTW, why do you run your control machine on a higher frequency than the > framerate ? > > > > Nice to see it runs elsewhere without too much trouble. Quite strange > > that the processor load varies, as since I use a fixed time step ODE > > solver, the calculations are identical each timestep. I'm interested > > to find out how you know the timing between frames. How do you know it > > was at 0,0,0,15 ms? > just a simple print statement: > import time > self.ABS_TIME = time.time() > > def update(self, evt=None): > #for n in range(10): > for n in range(int(ceil(fs/fps))): > self.controller.input = -self.pendulum.output() + .05*rand(2,1) > self.pendulum.input = self.controller.output() + 1*rand() > > self.controller.timestep(1/fs) > self.pendulum.timestep(1/fs) > > self.visualization.update() > print ( int ( 1000 * ( time.time() - self.ABS_TIME ) ) ) > self.ABS_TIME = time.time() > > I also tried to remove the wx.Timer, and binded the update method to the > idle event, > then testing the elapsed time to decide if the calculations should be > done or not. > The effects are the same: steps of 15 msec :-( > Another option would be to implement your own main GUI-loop. > > cheers, > Stef > > > > Greetz, > > Jasper > > ------------------------------------------------------------------------ > > > > ------------------------------------------------------------------------- > > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > > Build the coolest Linux based applications with Moblin SDK & win great > prizes > > Grand prize is a trip for two to an Open Source event anywhere in the > world > > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > Visualpython-users mailing list > > Vis...@li... > > https://lists.sourceforge.net/lists/listinfo/visualpython-users > > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users > |