Motor drive
(→Additional Arduino libraries) |
(→Additional Arduino libraries) |
||
(2 intermediate revisions by one user not shown) | |||
Line 23: | Line 23: | ||
* Adafruit-GFX-Library to get the paint functions for the display | * Adafruit-GFX-Library to get the paint functions for the display | ||
* Adafruit_SSD1306 to get the specifics for the used display | * Adafruit_SSD1306 to get the specifics for the used display | ||
+ | |||
+ | cd ~/ | ||
+ | mkdir -p git | ||
+ | cd git | ||
git clone https://github.com/adafruit/Adafruit_BusIO.git | git clone https://github.com/adafruit/Adafruit_BusIO.git | ||
git clone https://github.com/adafruit/Adafruit_SSD1306.git | git clone https://github.com/adafruit/Adafruit_SSD1306.git | ||
Line 43: | Line 47: | ||
svn checkout svn://repos.gbar.dtu.dk/jcan/scorpi | svn checkout svn://repos.gbar.dtu.dk/jcan/scorpi | ||
− | + | The main package for this page is: | |
* The motor_driver firmware for Teensy 4.1 | * The motor_driver firmware for Teensy 4.1 | ||
− | * The teensy_interface for a Raspberry - for now not fully compatible with the firmware | + | |
− | * | + | Other parts will be described on other pages, pt. (April 2024) there are also: |
+ | * The teensy_interface for a Raspberry - for now, not fully compatible with the firmware | ||
+ | * ROS2-iron code starts with a YDLidar driver and is in the ROS2 directory. Further, the slam toolbox and the base ROS2-iron compiled successfully on Raspberry Pi 5 on Raspberry OS 64bit. | ||
* Some 3D print STL files. | * Some 3D print STL files. | ||
* some other minor stuff. | * some other minor stuff. | ||
− | == | + | == Moror drive == |
− | Compile and upload to Teensy | + | Compile and upload to Teensy. |
cd ~/scorpi/motor_drive | cd ~/scorpi/motor_drive | ||
make | make | ||
− | This should produce a file called motor_drive.hex ready to be uploaded: | + | This should produce a file called motor_drive.hex, ready to be uploaded: |
− | NB! | + | NB! Before you upload, press the power reset button to avoid power shutdown. |
Press had hold "power reset" | Press had hold "power reset" |
Latest revision as of 20:47, 18 April 2024
Back to scorpi
Contents |
[edit] Load arduino and Teensyduino
Install Arduino version 1.8.19 for the platform, find it here https://www.arduino.cc/en/software
Unpack in the Downloads directory (to fit the path in the Makefile)
cd ~/Downloads tar -xf arduino-1.8.19-linuxaarch64.tar.xz
Install Teensyduino from https://www.pjrc.com/teensy/td_download.html
Make the installer executable and install it on top of the Arduino installation.
chmod +x TeensyduinoInstall.linuxaarch64 ./TeensyduinoInstall.linuxaarch64
[edit] Additional Arduino libraries
Additional libraries from Ardufruit are needed for the small display:
- Adafruit_BusIO to get additional services from the I2C interface
- Adafruit-GFX-Library to get the paint functions for the display
- Adafruit_SSD1306 to get the specifics for the used display
cd ~/ mkdir -p git cd git git clone https://github.com/adafruit/Adafruit_BusIO.git git clone https://github.com/adafruit/Adafruit_SSD1306.git git clone https://github.com/adafruit/Adafruit-GFX-Library git clone https://github.com/pfeerick/elapsedMillis.git
The obtained libraries should be included in the Arduino/Teensyduino library list, e.g. if the GIT repositories are in a ~/git directory:
cd Arduino-1.8.19/hardware/teensy/avr/libraries ln -s ~/git/Adafruit_BusIO ln -s ~/git/Adafruit-GFX-Library ln -s ~/git/Adafruit_SSD1306 ln -s ~/git/elapsedMillis
[edit] Get code from SVN
The code is available on SVN:
cd svn checkout svn://repos.gbar.dtu.dk/jcan/scorpi
The main package for this page is:
- The motor_driver firmware for Teensy 4.1
Other parts will be described on other pages, pt. (April 2024) there are also:
- The teensy_interface for a Raspberry - for now, not fully compatible with the firmware
- ROS2-iron code starts with a YDLidar driver and is in the ROS2 directory. Further, the slam toolbox and the base ROS2-iron compiled successfully on Raspberry Pi 5 on Raspberry OS 64bit.
- Some 3D print STL files.
- some other minor stuff.
[edit] Moror drive
Compile and upload to Teensy.
cd ~/scorpi/motor_drive make
This should produce a file called motor_drive.hex, ready to be uploaded:
NB! Before you upload, press the power reset button to avoid power shutdown.
Press had hold "power reset" make upload Release "power reset" when "alive" LED starts blinking
[edit] Raspberry 5
Compiling motor drive on the Raspberry 5 failed in one of the Teensy libraries.
This was fixed by renaming a few files in the library:
cd ~/Downloads/arduino-1.8.19/hardware/teensy/avr/libraries/USBHost_t36/ mv BluetoothConnection.cpp BluetoothConnection.cpp.not mv bluetooth.cpp bluetooth.cpp.not mv joystick.cpp joystick.cpp.not
It was probably in the Bluetooth part, but I failed to remove Bluetooth from joystick.cpp, so all USB-host joystick support has gone.
No joystick is OK for this project.
The code compiles but does not run! The same code runs fine when compiled on a normal Ubuntu.