![]() This library was tested with the bipolar full bridge IC L298 and the (recommended) MOSFET full bridge IC TB6612. Pictures 4WD car with IR receiver and Bluetooth module and 4 AA rechargeable batteries. Plus all functions from above like setSpeedPWM() etc.rotate(int aRotationDegrees, turn_direction_t aTurnDirection, bool aUseSlowSpeed, void (*aLoopCallback)(void)).startGoDistanceMillimeter(int aRequestedDistanceMillimeter).įunctions for cars controlling 2 motors / motor sets from CarPWMMotorControl.hpp. updateMotor() - call this in your loop if you use the start* functions e.g.goDistanceMillimeter(uint8_t aRequestedSpeedPWM, unsigned int aRequestedDistanceMillimeter, uint8_t aRequestedDirection) įor non encoder motors, distance and drive speed PWM is used in a formula to convert millimeters into motor driving time.If it is set higher than RAMP_VALUE_OFFSET_SPEED_PWM (2.3 V), the software generates a ramp up from RAMP_VALUE_OFFSET_SPEED_PWM to requested driving speed PWM at the start of the movement and a ramp down to stop. getSpeed(), getAverageSpeed(), getDistanceMillimeter() and getBrakingDistanceMillimeter() for encoder motors or MPU6050 IMU equipped cars.ĭriving speed PWM (2.0 V) is the PWM value to use for driving a fixed distance.startRampUp(uint8_t aRequestedDirection).setSpeedPWMAndDirection(int SignedRequestedSpeedPWM).setSpeedPWMAndDirection(uint8_t aRequestedSpeedPWM, uint8_t aRequestedDirection).init(uint8_t aForwardPin, uint8_t aBackwardPin, uint8_t aPWMPin).Some functions allow a signed speedPWM parameter, which includes the direction as sign (positive -> FORWARD). SpeedPWM which is ignored for BRAKE or RELEASE.Can be FORWARD, BACKWARD, BRAKE (motor connections are shortened) or RELEASE (motor connections are high impedance). The motor is mainly controlled by 2 dimensions: For car control, only compensation of one motor is required. To compensate for different motor characteristics, each motor can have a positive compensation value, which is subtracted from the requested speed PWM if you use the setSpeedPWMCompensation() functions.The CarPWMMotorControl.cpp controls 2 motors simultaneously like it is required for most Robot Cars. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |