| When operating, the value of the Power property is used for the PWM.DutyCycle. If the Power property is a positive number, then Polarity is set to 0 and if the Power property is a negative number then the Polarity property is set to 1. The Option property selects whether the drive circuit has built in logic or not. When Option is 0, the H-Bridge is expected to take PWM, Direction and Brake inputs and internally configure its switches accordingly. When option is 1, the H-Bridge is expected to be composed of two drivers. Note that the Option property was added in Firmware B.2 The Mode property selects variations in the drive circuit. When the H-Bridge has built in logic (Option 0) then Mode selects the output state of the PWM Line when the braking logic is on. When the H-Bridge is composed of two drivers, the Mode selects whether or not the drivers have an enable line. Together the Operate and Mode properties represent 4 selectable H-Bridge circuits.
The following table shows the output levels for the different circuits during different power output levels. Note that InvertOutA and InvertOutB are assumed to be 0.
|
In circuits 1,2 and 4 the duration of the PWM pulse is based on the absolute value of the Speed property. In Circuit 3, the duration of the pulse is based on the raw bit value of the Speed property. In all circuits, the state of the Polarity property is outputted to the I/O Line specified by the IOLineA property. Therefore, IOLineA outputs 0 Volts when the Power property is a positive number and 5 Volts when it is a negative number. This can be reversed by setting the InvertOutA property. In the first 3 circuits, the state of the Brake property is outputted to the I/O Line specified by the IOLineB property. Therefore, IOLineB outputs 0 Volts when the Brake property is 0 and outputs 5 Volts when it is 1. This can be reversed by setting the InvertOutB property. In circuit 4 however, IOLineB outputs the inverse of IOLineA unless the Brake property is 1. When the Brake property is set to 1, the H-Bridge is configured to do a load-short. Circuits 1 and 2 expect the H-Bridge's internal logic to do this, while Circuits 3 and 4 set the outputs of IOLineA and IOLineB to the same level. In addition to the load-short, the PWM line is configured to discontinue the high-going pulses. In Circuit 3, the output of the PWM is set to the same level as IOLineA to accomplish load-shorting. The Operate property specifies if the H-Bridge drives its load. When the Operate property is set to 1 the IOLineP generates 5 Volt pulses. When the Operate property is set to 0 the pulses are discontinued and IOLineP is set to 0 Volts. If a current pulse was in progress it is cut short and the I/O line is immediately set to 0 Volts. The state of the I/O lines specified by IOLineA and IOLineB are not changed when Operate is set to 0. The PWM property is an instance of the oPWM Object which the H-Bridge Objects use to maintain the PWM output. It configures the PWM's properties so that it uses the IOLine specified by the IOLineP property. Since all instances of the oPWM Object use the same two PIC PWM hardware modules, then all instances of the H-Bridge Objects will use one of the two PWM modules. (see oPWM Object for more detail). |