function [y_enc,y_tach]=run_inverted_pendulum_help(u,input_type,initial_angle);

% function [y_enc,y_tach]=run_inverted_pendulum(u,input_type,initial_angle);
% This function simulates the non-linear pendulum at 20 Hz (dt=0.05 seconds)
% from an initial position (in radians).  The default initial position is 
% zero radians (i.e. vertical)
%
% The function returns an encoder measurement of the angle from vertical
% (in radians) as well as the pendulum speed (if desired) in rad/sec.
%
% Note you may call the function as:
% y_enc(k+1)=run_inverted_pendulum(u,type)
%
% This will return the encoder measurement ONLY and assume an initial 
% angle of zero (i.e. vertical/inverted).
%
% The input_type dictates if the input is a voltage or torque. 
%   input_type='volt'   will be a voltage input with a max of 12 volts
%   input_type='torq'   will be a torque input with a max of 0.466 Nm
%
% Note that the input_type of torque assumes a current controlled motor
% such that you can directly command torque to the motor (i.e. can neglect
% the motor dynamics) using a motor driver like the National Semiconductor
% LMD18245 H-bridge chip.
%
% TO RUN:
%
% clear all
% dt=1/20;
% end_time=5;
% x0=init_angle=pi/20;
% for k=1:end_time/dt
%     u(k)=0.1;
%    [y1(k+1),y2(k+1)]=run_inverted_pendulum(u(k),'torq',init_angle);
% end
%
% Note that y2 is optional.
%
% Note that you must "clear all" before any new run of the simulation in
% order to clear (i.e. reset) the initial condition
% You can call the function with initial_angle each time (or just the first 
% time you run the simulation).  The intial condition is not reset until 
% you run clear all
%
% Note the simulation includes sensor noise and disturbances!

display('This is only a function to provide "help" comments');


