Coder Social home page Coder Social logo

infineon / multi-half-bridge Goto Github PK

View Code? Open in Web Editor NEW
6.0 7.0 6.0 25.06 MB

Library of Infineon's multi-half-bridge TLE94112 for Arduino, Raspberry Pi and more.

License: Other

C++ 85.73% Makefile 1.57% Batchfile 0.06% Shell 0.75% CMake 4.30% Python 7.59%
arduino library makers automotive dc-motors multi-motor-applications infineon-shields wiced tle94112el tle94112es

multi-half-bridge's Introduction

Multi Half Bridge Library

arduino build

C++ library of Infineon's Multi Half-Bridge IC controllers.

Supported Products

DC motor control shield with TLE94112EL for Arduino DC motor control HAT with TLE94112ES for Raspberry Pi TLE94112ES / TLE94112EL

Supported Frameworks

Arduino Library RPi Python Library
Arduino API WICED API RPi API
RPi Python API
Getting Started Getting Started Getting Started C++
Getting Started Python
ModusToolbox API TLE94112 API
TLE94112Motor API
Getting Started Porting Guide

More Information

License

This project is licensed under the MIT License - see the LICENSE file for details.

multi-half-bridge's People

Contributors

arkajyotichatterjee avatar cyberschmiddi avatar djaumann avatar ederjc avatar jaenrig-ifx avatar mhollfelder avatar olaffilies avatar pandayswarnam avatar r-nikhita avatar vroni99 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

multi-half-bridge's Issues

driver not working

Your driver seems not to work and is blocking the LED.

This is my test code ( You can commen/uncomment USE_DRIVER ). The LED is only blinking when not using the driver.
Environemt: Arduino UNO, DC-Motor-Shield TLE94112EL V1.3

#include <TLE94112.h>
#include <Tle94112Motor.h>

Tle94112 controller = Tle94112();

Tle94112Motor motor1(controller);

#define USE_DRIVER

void setup()
{
  #ifdef USE_DRIVER
  // Enable MotorController Tle94112
  // Note: Required to be done before starting to configure the motor
  controller.begin();

  // Connect motor1 to HB1 and HB3
  motor1.connect(motor1.HIGHSIDE, controller.TLE_HB1);
  motor1.connect(motor1.LOWSIDE, controller.TLE_HB3);

  // Drive HB1 with signal from PWM1
  // Note: This allows to control the speed of the motor
  motor1.setPwm(motor1.HIGHSIDE, controller.TLE_PWM1);

  // Set PWM Frequency, default is 80 Hz
  motor1.setPwmFreq(motor1.HIGHSIDE, controller.TLE_FREQ100HZ);
  #endif
  pinMode(LED_BUILTIN, OUTPUT);
}



void loop()
{
  for (int n = 10; n < 255; n++)
  {
    motor1.setSpeed(n);
    delay(100);
    digitalWrite(LED_BUILTIN, HIGH);
    delay(100);
    digitalWrite(LED_BUILTIN, LOW);
  }

}

cant controll independently 6 motors

i used this library and the example with controlling 2 motor to independently control each of the 6 motors i connected with IR remote. but for each motor i have to choose controller.TLE_PWM3, controller.TLE_PWM2, or controller.TLE_PWM1. and even if i use different buttons from remote for each motor, if i used controller.TLE_PWM3 for three motors for example, when i try to change the speed of one of them, all the 3 the motors are changing their speed. i attached here the code im trying to use.
im sorry if this is not a correct request, its my first day on this site and one of my first arduino projects.
thank you!

`
#include <TLE94112.h>
#include <Tle94112Motor.h>
#include <IRremote.h>

//declaram fiecare buton folosit. de ex n21 reprezinta butonul de la care comandam alimentarea motorului 2 cu factorul de umplere 1 (50%).
#define n11 0x1
#define n21 0x2
#define n31 0x3
#define n41 0x4
#define n51 0x5
#define n61 0x6
#define n12 0x7
#define n22 0x8
#define n32 0x9
#define n42 0x22
#define n52 0x0
#define n62 0xA
#define n13 0x29
#define n23 0x2C
#define n33 0x2D
#define n43 0x2B
#define n53 0x2F
#define n63 0x2E
#define ON 0xC
#define OFF 0xD
#define sus 0x20
#define jos 0x21

//setam pinul de intrare pentru receptorul IR
int RECV_PIN = 2;

Tle94112 controller = Tle94112();

Tle94112Motor motor1(controller);
Tle94112Motor motor2(controller);
Tle94112Motor motor3(controller);
Tle94112Motor motor4(controller);
Tle94112Motor motor5(controller);
Tle94112Motor motor6(controller);

IRrecv irrecv(RECV_PIN);

decode_results results;

void setup()
{

irrecv.enableIRIn();
controller.begin();

// Configuram semipuntile la care conectam motorul 1
//dam sensul rotatiei, poate fi schimbat prin inversarea lowside cu hiside
motor1.connect(motor1.HIGHSIDE, controller.TLE_HB1);
motor1.connect(motor1.LOWSIDE, controller.TLE_HB3);

motor1.setPwm(motor1.HIGHSIDE, controller.TLE_PWM3);

// setam frecventa pwm la 200(poate fi setata si la 100 sau 80)
motor1.setPwmFreq(motor1.HIGHSIDE, controller.TLE_FREQ200HZ);

motor2.connect(motor2.HIGHSIDE, controller.TLE_HB2);
motor2.connect(motor2.LOWSIDE, controller.TLE_HB4);

motor2.setPwm(motor2.HIGHSIDE, controller.TLE_PWM3);

motor2.setPwmFreq(motor2.HIGHSIDE, controller.TLE_FREQ200HZ);

motor3.connect(motor3.HIGHSIDE, controller.TLE_HB5);
motor3.connect(motor3.LOWSIDE, controller.TLE_HB6);

motor3.setPwm(motor3.HIGHSIDE, controller.TLE_PWM3);

motor3.setPwmFreq(motor3.HIGHSIDE, controller.TLE_FREQ200HZ);

motor4.connect(motor4.HIGHSIDE, controller.TLE_HB7);
motor4.connect(motor4.LOWSIDE, controller.TLE_HB8);

motor4.setPwm(motor4.HIGHSIDE, controller.TLE_PWM1);

motor4.setPwmFreq(motor4.HIGHSIDE, controller.TLE_FREQ200HZ);

motor5.connect(motor5.HIGHSIDE, controller.TLE_HB11);
motor5.connect(motor5.LOWSIDE, controller.TLE_HB12);

motor5.setPwm(motor5.HIGHSIDE, controller.TLE_PWM1);

motor5.setPwmFreq(motor5.HIGHSIDE, controller.TLE_FREQ200HZ);

motor6.connect(motor6.HIGHSIDE, controller.TLE_HB10);
motor6.connect(motor6.LOWSIDE, controller.TLE_HB9);

motor6.setPwm(motor6.HIGHSIDE, controller.TLE_PWM1);

motor6.setPwmFreq(motor6.HIGHSIDE, controller.TLE_FREQ200HZ);

motor1.begin();
motor2.begin();
motor3.begin();
motor4.begin();
motor5.begin();
motor6.begin();

}

void loop()
{
//citirea codurilor de la telecomanda

if (irrecv.decode(&results)) {
Serial.println(results.value, HEX);
irrecv.resume();

//functionarea motoarelor

if (results.value == n11)
{
motor1.start(63);}

if (results.value == n12)
{

motor1.start(255);}

if (results.value == n13)
{
motor1.start(0);
}

if (results.value == n21)
{
motor2.start(63);
}
if (results.value == n22)
{
motor2.start(255);
}

if (results.value == n23)
{
motor2.start(0);
}

if (results.value == n31)
{
motor3.start(63);
}

if (results.value ==  n32)
{

motor3.start(255);
}

if (results.value == n33)
{
motor3.start(0);
}

if (results.value == n41)
{
motor4.start(63);
}

if (results.value ==  n42)
{

motor4.start(255);
}

if (results.value == n43)
{
motor4.start(0);
}

if (results.value == n51)
{
motor5.start(63);
}

if (results.value ==  n52)
{

motor5.start(255);
}

if (results.value == n53)
{
motor5.start(0);
}

if (results.value == n61)
{
motor6.start(63);
}

if (results.value ==  n62)
{

motor6.start(255);
}

if (results.value == n63)
{
motor6.start(0);
}
}
} `

TRUE and FALSE undefined with Arduino boards, IDE version 1.8.3+ (with workaround)

The library works perfectly with the Infineon board XMC1100 Arduino compatible. Installing the shield on an Arduino UNO instead compilation can't happen. Investigating in the errors list I found the following messages:

C:\Users\enrico\Desktop\Arduino\libraries\TLE94112\src\TLE94112.cpp:42:13: error: 'FALSE' was not declared in this scope
  mEnabled = FALSE;

C:\Users\enrico\Desktop\Arduino\libraries\TLE94112\src\TLE94112.cpp:50:13: error: 'TRUE' was not declared in this scope
  mEnabled = TRUE;

C:\Users\enrico\Desktop\Arduino\libraries\TLE94112\src\TLE94112.cpp:64:13: error: 'FALSE' was not declared in this scope
  mEnabled = FALSE;

[etc...]

I have added a couple of conditions defines in the library header file as shown below

#ifndef TLE94112_CONF_H
#define TLE94112_CONF_H

// PATCH START ===================================================
/*
	The following two conditional define patches the compatibility of the library
	with NON-Infineon boards. The boolean TRUE and FALSE (uppercase) are defined
	in the Arduino IDE Infineon XMC110 library but are note recognised when
	the board is set to Arduino UNO/Genuino. It is reasonable suppose that this
	same issue - untested - exhists too with the other boards of the Arduino
	family supported by the Arduino IDE versione 1.8.3 and further
	
	Enrico Miglino <[email protected]>
	July, 5, 2017
*/
#ifndef TRUE
#define TRUE true
#endif

#ifndef FALSE
#define FALSE false
#endif
// ================================================= PATCH END

#include "Arduino.h"

This patch has been added in the header file Arduino/libraries/TLE94112/util/tle94112_conf.h

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.