
AB2012
Canada
Asked
— Edited
Hello! I have connected two motors to the EZ-B using an HBridge and can turn the motors on simultaneously for the same amount of time through commands such as Forward(). Is it possible to control the motors separately (e.g. one on and the other off, one rotating clockwise and the other counterclockwise, etc.) when using only one HBridge?
Using EZ-Scripts you could have a script that sets the robot moving forwards, reverse, stop, spin on the spot left, spin on the spot right, wide sweeping turn forwards, backwards etc.
How can I combine the EZ-scripts with the PWM controls?
Also, is there a timer built into ARC?
To control invididually, you will use an EZ-Script control or EZ-Script Manager control.
HBridges work by setting the logic to match the Truth table. Truth table means what voltages need to be applied to what pins to have the motor move a specific direction.
If you connect the channel 1 of the motor controller to pins D0 and D1, then you can create scripts like this...
Forward Channel 1
Code:
Reverse Channel 1
Code:
Stop Channel 1
Code:
If you connect the channel 2 of the motor controller to pins D2 and D3, then you can create scripts like this...
Forward Channel 2
Code:
Reverse Channel 2
Code:
Stop Channel 2
Code:
The only reason you need the PWM is if the PWM is connected to the motor controller for speed. The PWM triggers the speed in which the motor controller will power the motor. The PWM does not need to be connected. If it is not connected, the jumper pins on the 2.5 motor controller need to be in place. Without PWM connected, your motor will run at full speed.