Bosch Indego (gen.1) goes Teensy

Jozsi76

Well-known member
Hello everyone,
In this thread I will be collect the experience with the rebuild a Bosch Indego connect (gen. 1) with the Teensy board.
Why:
- I find the hardwre of the Indego very good, also for big garden over 500m2
- I have allready thre of these Indegos with broken mainboard.
My Goals:
- to use most of the parts of the Indego, because I have a lot of these parts.
- the final function of the Teensy rebuild should have a very similarly scope of the original Indego.
- to have a low budget solution and rescue a lot of the scrap parts.

Here some pictures to the beginning:
20240303_163608_.jpg20240615_212556.jpg20240615_212111.jpg20220602_073508.jpg20240624_213452.jpg20240626_234710.jpg

My build based on a PowerPCBv1.09 and MainPCBv1.03. For the first try I will use a L298N driver for the brushed motors.
From the Indego LiOn battery (9S / 36V) I will cut two of the cells, so I will have a 7S/24V battery.
The mower motor is a 27V motor, so these will be ok. The driver motors are 36V but I have checked with 24V, the wheels have a speed of appr. 1,8km/h.

I will try to use the original Indego odometry on the motors. (red arrows) These are two hall sensors (Anachip AH175). I think now these have a similarly function as the KY-003 sensors. (An open collector transistor to pull down the signal of the Teensy odometryPin.
I will use only one of them because thru the gear translation, the hall sensors have appr. 2400 level changes (1200 rising and 1200 falling) in one wheel revolution.
(I hope my idea with this odometry will work. We will see.) Here the test with the oszilloscope of the hall sensors.
Oszi_Motorengeber_3_3V_24_5V.png

Now in the next posts I will need a lot of help to bring this guy to live. :)

The Teensy board is programmed, but i have only a Serial consol acess to it.
Base is the RL2000 model with adoptions in the mover.h:
//**************************************************************
// ------- select one platform type -------------------
//**************************************************************
//#define MI632
//#define YARDFORCE
#define RL2000
//#define MOW800

//**************************************************************
// ------- select one mainPCB -------------------
//**************************************************************
//#define PCB_V101
#define PCB_V103
and:
#if defined (RL2000) // here all setting for YARDFORCE
//*****************possible list of motor driver set to :****************
// 1 for brushless ZS-X11H v1 Driver
// 2 for DC L298N Driver
// 3 for DC BTS7960 Driver
#define LEFT_MOTOR_DRIVER 2 //never mix BL and DC on drive motor
#define RIGHT_MOTOR_DRIVER 2
#define MOW_MOTOR_DRIVER 2

#define BUMPER_IS_SWITCH true // set to true if the bumper is a single ON/OFF switch
#define BUMPER_REAR_EXIST false // set to true to manage the rear bumper connected on CAN3 J20 connector
#define BUMPER_ARE_NORMALY_CLOSED false // set to true if the bumper contact is closed when nothing is hit

#define START_BUTTON_IS_NC false //if button is normaly closed

// mower can have a cover that stop the mowing cycle but power still on the PCB,mower only start after closing the cover
// start button is under cover , so after push the start button you have 10 seconde to close cover and mower start
// openning the cover stop mowing cycle
#define MOWER_HAVE_SECURITY_COVER false // mower can have a cover that stop the mowing cycle but power still on the PCB,mower only start after closing the cover

#define INA226_MOW2_PRESENT false
#define INA226_MOW3_PRESENT false

#define ODOMETRY_ONLY_RISING false
#endif
Here the consol output:

SETUP
++++++++++++++ Start Robot Setup at 742.00 ++++++++++++
Initialise date time library
RTC has set the system time
------------------- Initializing SD card... ---------------------
SD Card failed, or not present
Version : 1.493-Teensyber
Pfod connection initialisation at : 19200
Load ErrorData Address Start= 500.00 Stop= 522.00
UserSettings OK from Address : 2000.00 To 2500.00
Load Stats Adress Start = 800.00 Stop = 826.00
IMU Warning: no calib data
-------- IMU CALIBRATION --------
ACCEL GYRO MPU6050 OFFSET ax: 376 ay: -1768 az: 1512 gx: 91 gy: 12 gz: -2
COMPASS OFFSET X.Y.Z AND SCALE X.Y.Z
comOfs=0.00,0.00,0.00
comScale=2.00,2.00,2.00
.
--------------------------------- GYRO ACCEL INITIALISATION ---------------
MPU6050 connection successful
52
Initializing DMP...
Enabling DMP... Packet size 28
Wait 3 secondes to stabilize the Drift
AccelGyro Yaw: 0.00--------------------------------- IMU READY ------------------------------
------- Initialize Perimeter Setting -------
Begin setup adc0 on pin:23
End setup adc0
Try to Start adc0 Timer Interrupt
adc0 Timer Interrupt Started
START
Mower 1.493-Teensyber
Config: RL2000
press...
d for menu
v to change console output (sensor counters, values, perimeter etc.)
off
Starting Ina226 current sensor
Checking ina226 current sensor connection
Ina226 Begin OK
Ina226 Configure OK
Ina226 Calibration OK
Watchdog configuration start
Watchdog configuration Finish
Setup finish

MAIN MENU:
1=test motors
To test odometry --> use Arduremote
3=communications menu
5=Deactivate and Delete GYRO calibration : To calibrate GYRO --> use Arduremote Do not move IMU during the Calib
6=Deactivate and Delete Compass calibration : To calibrate Compass --> use Arduremote start/stop
9=save user settings
l=load factory settings: Do not save setting before restart the mower
r=delete robot stats
x=read settings
e=delete all errors
0=exit

testing left motor (forward) half speed...
testing left motor (reverse) full speed...
testing right motor (forward) half speed...
testing right motor (reverse) full speed...
warning Watchdog detect that loops take too long duration
Tennsy can automaticly reboot if issue is not reset

Is it possible that the not calibrated IMU stop the motors? I can not drive the motors. Only a quiet squeaking comes if i try to test the motors over the console.
The mower will be powered at the moment with my bench power supply (25V), because the battery waiting for the rebuild to 7S.
At the moment I dont have accsess with the pfodApp to the ESP32 board. NoBT no WIFI. :(
This is the biggest problem at the moment. I try actually a lot of boards in Arduino IDE.
What software is better to use in the GitHub: "ESP32_BT_Passerelle" or "ESP32_WIFI_Passerrelle" ???

That for the first and we will se when the Robot comes to live... :D
 
No link between IMU and motor test.

ESP32_BT_Passerelle is the basic soft to work with PFOD.
Here a zip of a old webcontrol soft ,but i don't know where you can find the last version .
Not sure it work well without some change into Pfod.cpp and pfod.h of the teensy firmware.
 

Attachments

Ok. I have load the sketch "ESP32_BT_Passerelle" to my ESP32. In the serial consol answer the ESP32 after upload the sketch at 115200 baud the following:
ets Jul 29 2019 12:21:46



rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)

configsip: 0, SPIWP:0xee

clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00

mode: DIO, clock div:1

load:0x3fff0030,len:1448

load:0x40078000,len:14844

ho 0 tail 12 room 4

load:0x40080400,len:4

load:0x40080404,len:3356

entry 0x4008059c

Start Bluetooth

Bluetooth started with name DENNA Wait 10 seconde......

Try to connect to DUE

Connected

and also can connect to the pfodApp. But i see in the pfod App nothing. Here the screen:

Screenshot_20240628_141509_pfodApp V3.jpgScreenshot_20240628_140746_pfodApp V3.jpgScreenshot_20240628_142351_pfodApp V3.jpgScreenshot_20240628_142358_pfodApp V3.jpg

I think i have should see any options and settings... Or? I can view raw data or debug. But ther is nothing to change.:unsure:
 
The second problem, that the motors not drives.

Here my connection schema to the L298N on the left side:

L298N-left connect.png
on the right side is similarly but with the mirrored pins to the side A.
All jumpers on the L298N are pulled. Here the photo from this side:

20240628_151725.jpg
White is on PWM, Wh/Red on DIR, and Black is on EN pin.
Any wrong connection to see?
 
I'm not sure right now, but I don't think your wiring fits.
Here is the pin assignment:

Code:
#define pinMotorLeftEnable  5         // EN motors enable
#define pinMotorLeftPWM 7          // M1_IN1 left motor PWM pin
#define pinMotorLeftDir 6         // M1_IN2 left motor Dir pin
#define pinMotorRightEnable  2        // EN motors enable
#define pinMotorRightPWM  4        // M2_IN1 right motor PWM pin
#define pinMotorRightDir 3        // M2_IN2 right motor Dir pin
#define pinMotorMowEnable 8       // EN mower motor enable      (if using MOSFET/L298N, keep unconnected)

#define pinMotorMowPWM 10           // M1_IN1 mower motor PWM pin (if using MOSFET, use this pin)
#define pinMotorMowDir 9          // M1_IN2 mower motor Dir pin (if using MOSFET, keep unconnected)
 
Oh, okay. Than maybe thre is a redundancy in the code.
I have connected mine as I found this in the drivers.cpp:

// L298N motor driver
// IN2/C(10)/PinPWM IN1/D(12)/PinDir
// H L Forward
// L H Reverse
// pinDir connected to IN1
// pinEnable connected to IN2
// pinPWM connected to ENA

I will now try what you posted from the mower.h. :cool:

ps: Or better not to try tochange?
I found in internet to the L298N module the following:
The EN pins are the PWM pins, and IN1 IN2 are for the direction.
Therefore my schema schould be correct. Very confusing :unsure:
 
Last edited:
Ok. I have load the sketch "ESP32_BT_Passerelle" to my ESP32. In the serial consol answer the ESP32 after upload the sketch at 115200 baud the following:


and also can connect to the pfodApp. But i see in the pfod App nothing. Here the screen:

View attachment 1602View attachment 1603View attachment 1604View attachment 1605

I think i have should see any options and settings... Or? I can view raw data or debug. But ther is nothing to change.:unsure:
@Bernard It seems that someone on Ardumower have the same problem with the APP?
 
Hm, now I tested this config for the L298N:
#define pinMotorLeftEnable 5 // EN motors enable
#define pinMotorLeftPWM 7 // M1_IN1 left motor PWM pin
#define pinMotorLeftDir 6 // M1_IN2 left motor Dir pin

EN to EN on L298N
PWM to IN1
Dir to IN2

with the motor test from the serial consol now the motors start by the half speed test, but very very slowly. I measured the voltage on the motor pin: appr. 8V
And by full speed happens nothing. :(

Anything is wrong with the connection of the drivers.
 
It's for PCB1.01 version ,but here the wiring and the connector of my TCG158.

For pfod.
If you see connected , it's that the BT link is OK
If HMI not start it's because there is no data flow on the serial link between ESP32 and Teensy
Check wiring between the 2 serial PIn of teensy TX1 RX1 and ESP32 TX2 RX2 it's cross link

Into mower.h the port and speed for ESP32 com is here:
Code:
#define Bluetooth Serial1  // Ardumower default OK for ESP32 or HC05
#define BLUETOOTH_BAUDRATE  19200  // baudrate used for communication with Bluetooth module
 

Attachments

  • 20240628_192119.jpg
    20240628_192119.jpg
    1.2 MB · Views: 14
Ok. The connections I will check with your photo.

To the baudrates: In the "ESP32_BT_Passerelle.ino" file there are two baudrates

//BT seial for Pfod init
Serial.begin(115200);
Serial.println("Start Bluetooth");
ESP_BT.begin("DENNA");
Serial.println("Bluetooth started with name DENNA Wait 10 seconde......");
delay(10000);

Serial.println("Try to connect to DUE");
Serial2.begin(19200);
Serial.println("Connected");

the Serial.begin is for the seriel communication in ArduinoIDE?
the Serial2.begin is for the communication between ESP32 and Teensy?
 
If you have not cut the trace to power the teensy over USB you can test the Pfod exchange by this way.
Remove teensy and esp32 from PCB.
Remove teensy SD Card
connect the 2 module by this way:
Teensy / esp32
pin0 RX1 / TX2
pin1 TX1 /RX2
GND under Vin / GND near Vin
3.3V (250mA max) / 3V3

20240628_203600.jpg

Connect teensy to PC using usb cable
And check Pfod connection.

If it's not working ,can you send a picture of the ESP32 you are using ?
 
Thanks Bernard!
Today was on my plan to reduce the Indego Battery to 7S. Now its finished and installed in the case.
Now i go on the Teensy and ESP32 communicaton again. ;)
The power trace on Teensy is already cutted, but it is not a problem for me to solder here a bridge. After the test I can remove the bridge again.
 
First check that you have the correct ESP32 module (devkit V1) or one with same pin assignement.

test again with the battery, if it not work:
Try to power the ESP32 and teensy with 2 usb cable connected to the same PC and simply shunt the teensy trace pad using a simple metal plate.
 
Nope. No communicationbetween the boards :(

here the build up:
20240629_021602.jpg
here the serial consol for this setup:
SETUP

++++++++++++++ Start Robot Setup at 999.00 ++++++++++++

Initialise date time library

RTC has set the system time

------------------- Initializing SD card... ---------------------

SD Card failed, or not present

Version : 1.493-Teensyber

Pfod connection initialisation at : 19200

Load ErrorData Address Start= 500.00 Stop= 522.00

UserSettings OK from Address : 2000.00 To 2500.00

Load Stats Adress Start = 800.00 Stop = 826.00

IMU is not activate

------- Initialize Perimeter Setting -------

Begin setup adc0 on pin:23

End setup adc0

Try to Start adc0 Timer Interrupt

adc0 Timer Interrupt Started

START

Mower 1.493-Teensyber

Config: RL2000

press...

d for menu

v to change console output (sensor counters, values, perimeter etc.)

off

Starting Ina226 current sensor

Checking ina226 current sensor connection

INA226 Battery Charge is not OK

INA226 Motor Right is not OK

INA226 Motor Left is not OK

INA226 MOW1 is not OK

************** WARNING **************

INA226 powerboard connection is not OK

Watchdog configuration start

Watchdog configuration Finish

Setup finish

POWERBOARD I2C LINE is not OK
 
Yes, this variant I tryed also. The BT connection to ESP32 is ok. pfodApp says: connected but no pfodApp connection.
Screenshot_20240629_120202_pfodApp V3.jpg
I think a problem is the RX TX communication between ESP and Teensy.
 
YEESSS!!! UART Communication is finaly alive! 🥳
Screenshot_20240629_140322_pfodApp V3.jpg
Thank for this Post @Richtel https://www.diy-robot-lawn-mower.com/threads/kalibrieren.125/post-3106

The newer ESP32 boards needs an extended specification of the UART ports, because the standard is pin 9 and 10.
There we need to define it to GPIO16 and 17. https://microcontrollerslab.com/esp32-uart-communication-pins-example/

As example this:
Serial2.begin(19200,SERIAL_8N1, 16, 17);
Now, goes on with the calibration of the motors.;)
 
Back
Top