Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!uunet!mcsun!ukc!reading!minster!george From: george@minster.york.ac.uk Newsgroups: comp.ai.neural-nets Subject: Pole Balancing Problem Message-ID: <665415070.18755@minster.york.ac.uk> Date: 1 Feb 91 13:31:10 GMT Organization: Department of Computer Science, University of York, England Lines: 54 Has anyone implemented the pole balancing simulator whoses equations are given in Barto and Sutton "Neuronlike Adaptive Elements That Can Solve Difficult Learning Control Problems" 1983 IEEE Trans Sys Man & Cyb??? i.e. the two equations given in the appendix. I have just coded them (see below), but the behaviour of the simulator is not reasonable, e.g. pole at angle 10 degrees say, small velocity to left, then pole should just fall down increasing velocity of cart. However, actually oscillates between the two - keeping the pole balanced! ;-) Assumed that sgn() meant a function that returns +1 for +ve numbers (including 0), and -1 for -ve numbers. Does anyone know what is wrong with the equations?? Otherwise, would be glad to have alternative equations for cart acceleration and pole acceleration (taking into account friction at cart/pole and cart/track interfaces). Many thanks - George Bolt pole_acc = ( GRAVITY * sin(pole_angle) + cos(pole_angle) * ( -1.0 * ((double) impulse_direction) * IMPULSE - POLE_MASS * POLE_HLENGTH * pole_vel * pole_vel * sin(pole_angle) + CART_FRIC * sgn(cart_vel) ) / ( CART_MASS + POLE_MASS ) - POLE_FRIC * pole_vel / (POLE_MASS * POLE_HLENGTH) ) / ( POLE_HLENGTH * ( 4.0 / 3.0 - POLE_MASS * cos(pole_angle) * cos(pole_angle) / (CART_MASS + POLE_MASS) ) ) cart_acc = ( ((double) impulse_direction) * IMPULSE + POLE_MASS * POLE_HLENGTH * ( pole_vel * pole_vel * sin(pole_angle) - pole_acc * cos(pole_angle) ) - CART_FRIC * sgn(cart_vel) ) / ( CART_MASS + POLE_MASS ); ____________________________________________________________ George Bolt, Advanced Computer Architecture Group, Dept. of Computer Science, University of York, Heslington, YORK. YO1 5DD. UK. Tel: [044] (0904) 432771 george@uk.ac.york.minster JANET george%minster.york.ac.uk@nsfnet-relay.ac.uk ARPA george!mcsun!ukc!minster!george UUCP ____________________________________________________________