This is a simple GUI program that can be used to test the StepperServoCAN motor. It is based on the StepperServo-hardware and StepperServoCAN projects.
- Python 3
- tkinter
- cantools
- python-can
-
Clone the repository:
git clone https://github.com/killinen/StepperServoCANtester.git
cd StepperServoCANtester
-
Install the required libraries:
pip3 install tkinter cantools python-can
-
Connect the StepperServoCAN motor to the computer via CAN interface.
-
Run the program:
python3 StepperServoCANtester.py
-
The program will automatically detect and display a list of available CAN interfaces to the user. In case multiple interfaces are available, the user will be prompted to select one.
-
Upon connecting to the selected CAN interface, the program will present a user-friendly GUI with two input fields for setting the torque and angle values of the motor.
-
The user can update the injected values to the motor by clicking the "Update Torque/Angle Value" button or by pressing the "Return" key on the keyboard.
-
Once the user selects either "TorqueControl" and provides a "Steer Torque" value, or selects "RelativeControl" and provides a "Steer Angle" value, the StepperServoCAN motor will start spinning.
-
To exit the program, the user can click the "Exit" button, press the "ESC" key, or simply close the window.
-
The torque value should be between -16 and 16, and the angle value should be between -4096 and 4096.
-
If no CAN interfaces are found, the program will abort. To test the program, you can set up a virtual CAN interface with the following commands:
sudo modprobe vcan
sudo ip link add dev vcan0 type vcan
sudo ip link set up vcan0
-
You can check for available CAN interfaces that are UP in Linux with following command:
ip -details -brief link | grep can | grep UP