Adafruit Motor Shield 1438 on the TXT Controller

Alles rund um COMPUTING inkl. Microcontroller & Co.
Everything about COMPUTING incl. Microcontrollers
Forumsregeln
Bitte beachte die Forumsregeln!

Adafruit Motor Shield 1438 on the TXT Controller

Beitragvon fotoopa » 12 Sep 2018, 11:40

Today I started with the setup to place the Adafruit motor shield 1438 on the TXT Controller. The motor shield is powered by 3.3V. The 3.3V of my I2C interface board I connected to the 5V on the ADA1438 module. So I didn't have to change the selection 3.3V-5V (pcb trace) on the motorshield. The 3.3v is required for the TXT Controller, 5V is not allowed without additional level shifters. Warning: Never place the motor shield simultaneously on the Arduino and the TXT given the 3.3V and 5V ! Otherwise you need to use 5V and levelshifters on the I2C on the TXT.
A picture of the test setup:

Bild
The HD version: https://www.flickr.com/photos/fotoopa_hs/42821177990

I connected the logic analyser to the 4 available pins for the servo pwm signals channel 0, 1, 14 and 15. Starting from an example of Dirk Fox I could quickly start after changing the I2C address. The results were perfect on the LA.
I now have to study the PCA9685.pdf datasheet to be able to drive the 4 motors. It doesn't look very difficult, so it must work. To control stepper motors I see more problems.
If you use an Arduino Uno R3 instead of the TXT Controller it works but the TXT Controller is much slower.

A picture of the Arduino setup:
Bild
HD version: https://www.flickr.com/photos/fotoopa_hs/29652218047

First I made the setup with the Arduino to get more familiar with the hardware and software. For me this is all new, so it may take a while before everything is ready for the TXT Controller. I'm going to try the step motor control last, now I'll first control the 4 motors or just 8 extra outputs as an extension to the TXT.
As soon as new parts are ready I post the results here.

Frans.
fotoopa
 
Beiträge: 92
Registriert: 05 Okt 2017, 11:44
Wohnort: Belgie
Alter: 75

Re: Adafruit Motor Shield 1438 on the TXT Controller

Beitragvon fotoopa » 14 Sep 2018, 19:54

Testing of the motor shield module ADA1438.
Everything now works from the TXT Controller for 4 motors and 4 servos. Speed and direction adjustable for all motors. The ADA1438 module contains a level converter for controlling the servos. Because the ADA1438 module works on 3V3 this level converter was needed. For this I use the level converter from ADAfruit ADA 757. I brought out the 4 servo pwm signals on the available connector. The level converter fits directly on this connector. On the board itself there was only room for 2 servos and you still had the level problems if the ADA1438 worked on 3V3.
An overview:

Bild
HD version: https://www.flickr.com/photos/fotoopa_hs/43960631944

Bild
HD version: https://www.flickr.com/photos/fotoopa_hs/44630096042

Bild
HD version: https://www.flickr.com/photos/fotoopa_hs/43769977025

I have set the PWM frequency to 50Hz. For the motors this is rather low but if you use servos they do not all work well at higher frequencies. I made 2 routines, one for the servos and one for the motors. All motors are sent in a burst. This makes the necessary time very short. If you only use motors you can drive up the frequntie. I think that they work smoother and are less audible. When you connect the motors to the 9V output of the TXT Controller I measured a lower voltage at the motor. Loaded with the motors there is only 8.30V coming out of the TXT. The motor drive module also has a voltage drop. This makes the final voltage on the motors below 8V at 100% control. It is in your best interest to control the motors directly from a good 9V power supply.
There are still some reservations about the way of working with the ADA1438 module. If you abort the program abrut in the TXT controller without a real stop command to the ADA1438 module it is possible that the motors that are running will not stop anymore. I recommend to provide a hardware emergency stop to turn off the 9V.
The I2C module should be used at least once within 5 sec, otherwise there is a bug in the TXT Controller that hangs your I2C connection. I will work with an update loop that refreshes all motors data at once every 20 msec. If you do everything in a burst that time is quite short, otherwise there may be 5 msec between each close I2C device. The burst lasts only a good 1 msec.
Soon I will upload the full program.

Frans.
fotoopa
 
Beiträge: 92
Registriert: 05 Okt 2017, 11:44
Wohnort: Belgie
Alter: 75

Re: Adafruit Motor Shield 1438 on the TXT Controller

Beitragvon vleeuwen » 14 Sep 2018, 20:23

It is a nice shield.

I am using the ADA-2348 its also working fine with a Raspberry Pi 3 and Windows IoT 10, very simple to program with MS-Visual Studio 2017 with his integrated development environment for Windows IoT.

The ADA-2348 I2C controlled and deal with 4 motors or 2 steppers.
Benutzeravatar
vleeuwen
 
Beiträge: 925
Registriert: 31 Okt 2010, 23:23

Re: Adafruit Motor Shield 1438 on the TXT Controller

Beitragvon fotoopa » 15 Sep 2018, 10:24

vleeuwen hat geschrieben:I am using the ADA-2348 its also working fine with a Raspberry Pi 3 and Windows IoT 10, very simple to program with MS-Visual Studio 2017 with his integrated development environment for Windows IoT.
The ADA-2348 I2C controlled and deal with 4 motors or 2 steppers.
Yes, that's the same application. On the Pi 3 you will be able to control it better because the TXT Controller is a very slow system. Especially the time between writing or reading to the I2C is slow with the TXT. There is always minimum 5 msec after each close device. If you need multiple commands, the total time is quickly quite high. You can optimize this by sending or reading as much data as possible in a burst. The update time to send all motors at once is 1.2 msec. If you send all data in one burst then you only need that 1.2 msec with a max delay of 5 msec reaction time. This slow operation mainly affects the reaction time to stop an motor as fast as possible. If you have to update the 4 motors separately, an extra delay of 5 msec will occur between each motor. I prefer to use an FPGA module. These are up to 10,000 times faster and everything runs parallel. Mutual tasks have no influence on the timing of the other tasks.

The TXT Controller has mainly advantages to the PC interface. You have a nice layout, large screen and very high resolution. That's why I rarely use the small screen of the Controller itself. Once you are 75 years old you need very strong glasses to read something on those small screens. For standalone applications, however, it is useful. Then they are still powered by battery and should not take up much space.

Frans.
fotoopa
 
Beiträge: 92
Registriert: 05 Okt 2017, 11:44
Wohnort: Belgie
Alter: 75


Zurück zu Robo Pro / Computing / Software

Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 3 Gäste

cron