SudoFlex project aims to create a board family for digital control applications. SFB1 board is the first step of the project and the only available board in the market for now. This repository includes all necessary information and resources to start to use SFB1. Front and back views of the board are shown below.
Control algorithms for the board are developed by built-in blocks and block connections. There are 94 blocks for different functions. A summary of the blocks can be found below. | |
---|---|
For a detailed reference information about SFB1 you can refer to the user manual in pdf format. Latest user manual can be found under Releases section.
Pin mapping and button/led definitions can be seen on the table below.
Abbreviation | Description |
---|---|
DIx | Digital Input pins |
DOx | Digital Output pins |
PWMIx | PWM Input pins |
PWMOx | PWM Output pins |
ENCx | Incremental Encoder Input pins |
AIx | Analog Input pins |
AOx | Analog Output pins |
MODBUS_xx | Modbus RTU pins |
SYNC (26) | Synchronization pin. This pin goes high at the start of sampling and stays high during algorithm execution. So signal frequency is equal to sampling frequency and signal pulse width shows the algorithm execution time. |
STA (27) | If algorithm execution time exceeds sampling period this pin goes high. It is also connected to STA led. |
TX, RX (28, 29) | UART Programming Interface pins for SFB1 |
GND (30) | Ground pin for SFB1 |
3.3V (31) | Power pin for SFB1. Applied voltage must not exceed 3.3V and should be regulated. |
RFS | Return to factory settings button. If this button is pressed during reset, board clears the saved algorithm and returns to default algorithm string. |
RST | Reset button |
LoopSW | Loop on-off switch |
PWR | Power led |
STA | Status led. This led turns on if sampling frequency is too high for the current algorithm execution or sampling frequency is zero. |
In order to start developing with SFB1 board, one has to make minimum connections as shown on the figure below. First, regulated 3.3V power must be supplied to the board. Second, a UART-USB converter board should be connected to the SFB1 board to make a programming and logging interface connection with SudoFlex-Configurator running on the computer. UART-USB converter boards are common in the market and can be obtained easily at reasonable prices. Both FTDI and CH340 based boards are perfectly convenient, however CH340 based boards may need driver installation.
SudoFlex-Configurator is a desktop GUI application used for developing control algorithms. It has also a serial interface that can be used for downloading generated algorithms to the board and tracing log messages. A screenshot of the application can be seen on the figure below.
SudoFlex-Configurator only works on 64-bit Windows and Linux platforms for now. Under Releases section, there are 3 application files:
sudo usermod -a -G dialout <username>
sudo chmod a+rw /dev/ttyUSB0
7 introductory examples are prepared for a gentle introduction to SFB1. Json files of the examples can be found under the "examples" folder. These examples demonstrate the basic I/O and communication features of SFB1. After this introduction, SFB1 user manual should be used for detailed information about other blocks board features.
In this example, a led blinks at sampling frequency. DO block is used to drive the led which is connceted to pin-0 (DO0). NOT block is used to toggle the led state.
In this example, a led turns on when the button is pressed and turns off when the button is released. DO block is used to drive the led which is connected to pin-0(DO0). DI block is used to read the button state where the button is connected to pin-9(DI9).
SFB1 implements Modbus-RTU slave protocol. MODBUS_RTU block can be used to enable this feature. This block has many settings by which one can configure all communication and register structure settings for application needs. Signals in SFB1 are 32-bit wide. Therefore each signal occupies 2 Modbus registers. In this example, a button' s state is read by a DI block and a led is driven by a DO block. DI block is connected to "input signal" input of the MODBUS_RTU block. Holding signal output of the MODBUS_RTU block is connected to DO block. By using a PC Modbus-Master application (Like Modbus Poll, Radzio) button state can be read and led state can be set over Modbus.
SFB1 has 10 analog input channels. In this example, a potentiometer is used to create a varying analog signal. This signal is read by AI block over AI0. Also, MODBUS_RTU block is used to analog to digital coversion result.
SFB1 has two encoder channels. In this example, an incremental encoder reading is obtained by ENC block and sent over Modbus.
Some useful data of a signal like duty-cycle, pulse-width, frequency can be read in real-time by a PWMI block. In this example, a signal is generated by a signal generator and fed to PWMI1 channel of SFB1. Again, obtained data can be traced over Modbus.
PWMO block is used to generate PWM signals. By block settings, one can set duty-cycle or pulse-width or frequency of the generated signal. This example demonstrates these three cases. 3 signals generated ove PWMO2, PWMO4, PWMO5 channels. You can set duty-cycle of the signal over PWMO2, pulse-width of the signal over PWMO4, and frequency of the signal over PWMO5 via Modbus. A logic analyzer or oscilloscope can be used trace the signal properties.