Skip to content

LukasGaud/LAT-Exp

Repository files navigation

Lossless-Adjustable-Transformer-Experiment

This file covers the setup of how to run the experiments for lossless-adjustable transformer.

Main git commands

git pull - pulls the latest from repository

git add 'filename' - adds file with a name 'filename' to commit

git commit -m 'commit message' - performs a commit with 'commit message' message

git push - pushes commits to git

git stash - stashes (removes) all the local changes (can be used if there is error in pulling/commiting)

git setup

  1. Download gitHub desktop from https://desktop.github.com/
  2. Clone this repository to your local computer

ssh to Raspberry Pi

  1. Turn on Raspberry Pi

  2. Bring up Top Left -> Accessories -> Keyboard 20230113_145622

  3. Open Terminal clicking the terminal icon at the top

  4. Using the pop up keyboard type "ifconfig" in terminal 20230113_145706

  5. The following message will be displayed. Find the line that says wlan0. Write down the numbers next to "inet" (starts with 10.248...) 20230113_145714

  6. On a Mac open terminal (Command + Space, then type "terminal")

  7. In terminal type: ssh pi@IP-Address where IP-Address is replaced by the number 10.248....

  8. You will then be prompted for a password. Type "pass" and press Enter. You should now be connected to Raspberry Pi.

Navigating the code on Raspberry Pi

To navigate to the correct folder type

  1. cd git
  2. cd LAT-Exp

Connecting Loadcell

  1. Download DSCUSB Toolkit from here on your laptop https://www.mantracourt.com/software/dscusb/dsc-usb-toolkit

  2. Connect the USB from the loadcell to your laptop

  3. Run the DSCUSB Toolkit program, the loadcell should then appear

  4. To start recording data go to 'Logging' type 20230119_093116

  5. Select the folder where you want to record the data (I would recommend that the folder is in the same git repository so that it is synced to git)

  6. Name the file being recorded as 'data_loadcell.csv'

  7. In 'Information' tab select 'Net' so that there is zero torque recorded at rest 20230119_093125

Compiling the script

  1. Locate the script that you want to run (from the "Scripts" folder) and save it as a main.cpp script in the main directory on your laptop

image

2) Commit the changes to git using git desktop
  1. Pull the changes in Raspberry Pi by typing "git pull"

  2. Go the directory where main.cpp is located on your Raspberry Pi by using command "cd 'folder name'". You can check what is in the current folder on raspberry pi by typing "ls".

  3. type "chmod +x build.sh"

  4. type "chmod +x canableStart.sh"

  5. type ./build.sh

  6. The compiler should build the file

  7. If running the code for the first time after turning the Raspberry Pi on, type "canableStart.sh"

Running the experiment/script in Raspberry Pi

  1. Open DSCUSB toolkit program and choose 'Net' for the torque calculation, so that there is no torque recorded at rest

  2. Start recording the loadcell data on DSCUSB toolkit

  3. Now switch to terminal to operate Raspberry pi

  4. In the folder where the main.cpp script is located, type ./bin/main

  5. After running the script the file data.csv needs to be uploaded to git. To do this type

  6. "git add 'data.csv'"

  7. git commit -m "New Data"

  8. git push

Stopping Script

To stop the script at any time press 'Command + C"

Now when on your laptop if you "pull" on GitHub desktop the updated data.csv file should be available

Code Explained

The code contained in this repository for the following experiments: 1) Code to test stiction with spring disconnected 2) Code to test dynamic resistance with spring disconnected 3) Code to test stiction with spring connected 4) Device Law with sinusoidal carriage motion. These scripts will be covered separately.

Stiction with spring disconnected

  1. Performs the stiction measurement trajectory

  2. Parameters that can be modified are:

image

Running MATLAB postprocessing code

  1. The code is located in folder MATLAB Processing Scripts
  2. Copy this folder to some local directory for convenience
  3. Copy and paste 'data.csv' and 'data_loadcell.csv' files to some local directory
  4. When running processing code you will need to change the path in this line to the path of where the files are located

image

5. This is how mine file structure looks

image

Useful links

CTRE - documentation: https://v5.docs.ctr-electronics.com/en/stable/

CTRE - C++ documentation: https://api.ctr-electronics.com/phoenix/release/cpp/

Github troubleshoot - https://docs.github.com/en

Loadcell software manual - https://novatechloadcells.co.uk/products/dscusb

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published