Faze4 Robotic arm documentation

Contents:

About S-Drive project

What is S-Drive project?

S-Drive project is open-source project with aim to make good BLDC control for robotics cheap and available to everybody. Primary use for this project is in: Compliant robotic arms, dynamic walker robots, camera gimbals … Goal is to make everything simple to use and integrated but at the same time allow a lot of experimentation and ability for advanced development!

What does S-Drive project consist of?

S-Drive BLDC driver board

  • is small BLDC driver board with all needed functions integrated in!
_images/v3.jpg

S-Drive BLDC driver firmware

  • is firmware specially developed for S-Drive BLDC driver board.
_images/code1.png

S-Drive BLDC driver control software

  • lets you control and monitor motor connected to S-Drive BLDC driver!
_images/control_software.png

Table of contents

licence

Support the project

This project is completely Open source and free to all and I would like to keep it that way, so any help in terms of donations or advice is really appreciated. Thank you!

_images/PayPal-Donate-Button-PNG-Clipart.png

Arduino IDE setup for S-Drive firmware

Firs download Arduino IDE from official website: (Version we are running is 1.8.13)

Run Arduino IDE, go to file/preferences/additional boards manager urls: Enter : http://dan.drown.org/stm32duino/package_STM32duino_index.json (Any additional json file is sepperated with ,)

_images/Preferences.png

Now go to tools/board/board manager and search for STM32 Select STM32F1XX/GD32F1XX BOARDS (We used version 2020.8.9.)

_images/Boards_manager.png

Now downlaod needed libraries from S-Drive firmware repo: We recommend using versions of libraries from this repo for compatiblitiy. Using new versions can cause issuses!!

Copy needed libs to libraries folder of your Arduino IDE instalation.

We are almost done!

_images/STLINK.jpg

To program S-Drive BLDC driver board use ST-link. Windows 10 will usually download drivers alone, but if it does not download them from here: Note (STM32cubeprogramer is used for ARDUINO FOC firmware) https://my.st.com/content/my_st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-programmers/stm32cubeprog.license=1598927090654.product=STM32CubeProg.version=2.5.0.html

or just drivers here: https://www.st.com/en/development-tools/stsw-link009.html

_images/FTDI_USB.jpg

To acces serial port you need FTDI TO USB board. Windows 10 will usually download drivers alone, but if it does not download them from here: https://www.ftdichip.com/Drivers/VCP.htm

Troubleshooting

S-Drive control software

Latest version: Version 2.0

About

S-Drive control software lets you control and monitor S-Drive motor from PC. This version supports plotting, showing data and controlling of only one motor at the time. S-Drive control software allows you to see live data from your motor like:

  • speed
  • current
  • position
  • temperature
  • BEMF

AND at the same time control the motor in few different modes like:

  • Go to position and hold
  • set speed and flag at setpoint
  • Gravitiy compensation
  • Strong position hold
  • Speed and direction
  • Jump to position
  • Voltage mode

GUI guide - left side of screen

_images/control_software.png

On the left side you can see:

  • COM PORT: here you enter at what COM port your FTDI to USB board is connected to!
  • BAUDRATE: here you enter baudrate at wich your S-Drive board and control software communicate at.

Note

Note BAUDRATE is usually 1000008 or 1000000 in S-Drive Firmware

  • Status: Connected - GREEN for connected . RED for NOT connected
  • Telemetry is will print useful data about the motor.
  • Start will start serial communication, it can also be used to start wihout entering COM PORT and BAUDRARE values

To use it like that in python script edit bottom lines to COM PORT and BAUDRATE you are using!

1
2
s.baudrate = 1000000
s.port = 'COM3'

To COM PORT and BAUDRATE you are using!

  • Now if you use that edited script you can always connet to that com port with that baudrate when pressing START.
  • PAUSE pauses serial communication. To resume it PRESS start again!
  • On bottom is tkinter tool to navigate graphs!

GUI guide - Middle of screen

On the middle you can select what graph to view! Only one can be active at the time, or you can view multiple by selecting “Current,Position and Speed”.

GUI guide - Right side of screen

Here you can:

  • DISABLE MOTOR - turns off MOSFTETS
  • ENABLE MOTOR - Goes to POSITION HOLD on CURRENT POSITION!
  • CLEAR ERROR - clears ERROR from motor.

Note

if motor sends it still has error usually it means that temperature is still to high and it will disable itself again

After CLEAR ERROR are motor modes:

  • Go to position and hold - Goes to position with specific speed and holds desired position with desired Kp and current treshhold
  • set speed and flag at setpoint - Rotate at specific speed to desired setpoint at wich driver will send done flag
  • Gravitiy compensation - Gravitiy compensation mode
  • Strong position hold - Strong position hold on current position with desired Kp and current treshhold
  • Speed and direction - Move with desired speed in desired direction
  • Jump to position - Jump to desired position
  • Voltage mode - Move motor in desired direction my setting voltage to the driver

Note

voltage is in value from 0 - 1000 , 0 being zero volt 1000 being power supply voltage (peak)

Requirements to work!

In S-Drive firmware in Motor_parameters file you NEED to adjust :

1
uint16_t Main_serial_output_time = 50000;

Usually it is 10000, but that is to fast for S-Drive control firmware!

Troubleshooting

Simple “How it works”

Driver versions

S-Drive BLDC driver Version 3.1 (Latest version)

_images/vs.jpg

Whole S-Drive project started in july 2019 with simple breadboard prototype. From the very beginning project was planned to be used for robotic arms and legged robots, but to do that size was needed to be reduced.

S-Drive BLDC driver version 1 (August 2019)

_images/v1.jpg

First version was large and mostly made for prototyping and testing features. It used a lot of large components and had all pins from MCU routed as header pins for testing. Also It had usb plug and bootloader support, but that feature was removed to reduce size. Zener diodes were used on PULS and ENABLE pins for protection, but they were also removed to reduce size. As you can see it used a lot of large components like those blue and green connectors and resistors were definitely oversized. At that time i did not know what what type of communication I would so so multiple stuff was tested like : I2C, UART and SPI. This board was hand assembled. It uses 0805 components.

S-Drive BLDC driver version 2 (December 2019)

_images/v2.jpg

Second version is much smaller and looks similar to V3 but in reality it is more similar to first version. At this board I learned what needed to be made for V3 that is first stable version. From this board I also learned that board needs to have encoder embedded. This version was assembled by machines and uses 0603 components.

S-Drive BLDC driver version 3 rev1 (July 2020)

_images/v3.jpg

This is third version of S-Drive, it is newest and stable version where everything is working. What is different from V1 and V2:

  • RS485 chip for daisy chain ability
  • removed all large connectors
  • Additional EEPROM chip
  • No large connectors
  • All connectors were replaced with 2 connection buses where each bus has high voltage lines, UART comms, RS485 comms and low power lines
  • termistor connector
  • Small size of 50 x 41 mm
  • additional signal LEDs
  • Encoder is on bottom side!

S-Drive BLDC driver version 3 rev2 (In making)

Tested Motors

GB4114 Brushless Motor

_images/GB4114.png
kv Pole pairs Resistance
42 11 10.3 Ohm

GM7008H Brushless Motor

_images/GM7008H.jpg
kv Pole pairs Resistance
28 11 10.8 Ohm

2804 Brushless Motor

_images/2804.jpg
kv Pole pairs Resistance
140 7 10.7 Ohm

5010 150T Gimbal Brushless Motor

_images/5010.jpg
kv Pole pairs Resistance
??? 7 14.6 Ohm