-
Notifications
You must be signed in to change notification settings - Fork 8
RPi API
Full documentation here.
#include "tle94112-rpi.hpp"
#include "tle94112-motor.hpp"
Tle94112Rpi controller;
The Tle94112Rpi
class is used for low level communication with the motor controller. One instance per controller is needed.
Tle94112Motor motor(controller);
The Tle94112Motor
class is abstracting and simplifying common motor control functions like start, stop and coast. One instance per motor can be used.
controller.begin();
motor.connect(motor.HIGHSIDE, controller.TLE_HB1);
motor.connect(motor.LOWSIDE, controller.TLE_HB5);
motor.HIGHSIDE
is the positive polarity of the motor, while motor.LOWSIDE
is the negative polarity side. controller.TLE_HB[1-12]
connects the respective motor side to one of the half bridges. Multiple half bridges can be connected to one motor pole to reach a higher current limit. These should then be connected in parallel.
motor.setPwm(motor.LOWSIDE, controller.TLE_PWM1);
motor.setPwmFreq(motor1.LOWSIDE, controller.TLE_FREQ100HZ);
If you want to change the speed of your motor using PWM, you can assign one of the three PWM channels of the controller to this motor. Please always assign the PWM channel to motor.LOWSIDE
as the high side is active free wheeling. Available PWM frequencies are 80 Hz, 100 Hz and 200 Hz.
motor.begin();
motor.start();
Can be called with the optional speed argument, which can be any integer between -255 and 255. Negative numbers let the motor turn backwards. 0-255 sets the duty cycle to 0 - 100%.
motor.coast();
Disable the half bridges the motor is connected to and let it coast.
motor.stop();
Create a connection between positive and negative motor pole. This will brake the motor. Brake force can be adjusted by passing an integer parameter between 0 and 255 to the method.
motor.speed(127);
Set the speed of the motor to any integer value between -255 and 255. Negative values let the motor run backward.
controller.getSysDiagnosis();
This command reads out the error register of the multi half bridge. Please refer to example errorDiagnosis to understand the meaning of the different error flags.
controller.clearErrors();
This method clears all error flags which are not persisting. Required to re-enable the outputs after a latching error like over-current or over-voltage shut them down. More information can be found in this example.
Find the complete documentation in the Raspberry Pi Doxygen docs section.
Library Architecture
TLE94112 API
TLE94112Motor API
PAL Interface
Source Tree Structure
Preprocessor Configuration
Porting Guide
Doxygen Docs
Arduino
- Getting Started
- Lib Installation
- Arduino API
- PlatformIO
Cypress ModusToolbox
- Getting Started
- Lib Installation
- ModusToolbox API
- Examples
Cypress WICED
- Getting Started
- Lib Installation
- WICED API
- Troubleshooting Guide
Raspberry Pi (C++)
- Getting Started
- Lib Installation
- Raspberry Pi API
- Examples
Raspberry Pi (Python)
- Getting Started
- Lib Installation
- RPi Python API
- Examples