| The oDCMotor3 Object monitors the Speed and the Brake properties, and based on their numeric values controls the power, polarity, and braking properties of a oHBridgeH object which in turn controls two drivers connected to the motor. When the oDCMotor3 object is initialized, it configures the oHBridgeH object to use two drivers by setting the oHBridgeH object's properties. It then sets the oDCMotor3 object's properties as specified in the arguments to the Init method.
The Speed property controls the speed of the motor. When operating, a 0 in the Speed property will cause the motor to be at a full stop. If the Speed property is greater than 0, then the DC Motor will go forward at a speed specified by the Speed property. The higher the number (up to 127), the faster the motor will turn. If the Speed property is less than 0, then the DC Motor will go backwards at a speed specified by the Speed property. The lower the number (down to negative 128), the faster the motor will turn in reverse. The actual direction that the DC Motor spins when going in the "forward" direction can be reversed by setting the Invert property. When the Brake property is set to 1, the I/O line specified by IOLineB is activated and the two drivers are set to the same voltage rail which causes the motor to generate power back into itself, effectively driving itself back the other way which causes it to come to an abrupt stop without the need for mechanical braking. The Operate property specifies if the motor is on or off. When the Operate property is set to 1 the two drivers control the motor based on the Speed and Brake properties. When the Operate property is set to 0 the two drivers shut off and the motor stops. The HBridge property is an instance of the oHBridgeH object which is created when the oDCMotor3 object is. The oDCMotor3 object configures the oHBridgeH object in such a way that it will provide the proper I/O control for the two drivers and the physical brake. Attributes of the motor's operation can be adjusted by directly manipulating the oHBridgeH object. Note that doing so may change the way the motor behaves to something different than the way described in this document. (see oHBridgeH object for more detail) The maximum number of oDCMotor objects that can be dimensioned in a single application program is 2, limited only be the number of PWM channels available in the ooPIC. |