Visualizzazione post con etichetta robot. Mostra tutti i post
Visualizzazione post con etichetta robot. Mostra tutti i post

sabato 12 giugno 2021

ANN leg tilting classification, finally this seems to work :)

                                         https://www.youtube.com/watch?v=rep5edOnzvU

How it works: a Spring Boot PI4J and Weka based java application running on a Raspberry PI3 allows reading the 12 accelerometers on the legs junctions, plus the 4 buttons on the feet. An additional accelerometer on the head of the spider provides unique head 3 axis acceleration. The artificial neural networks, read all of the sensors values and upon a trained model "classify" data to provide a feedback on which one is the tilted leg. Upon this, the system can decide how to try to rebalance, then perform another classification and try to rebalance, until the spider is "flattened" horizontally. 


Next step will be to implement the read-classify-balance process mentioned above and interface the LIDAR set under the spider.


The classifier used that is a multi layer perceptron:



arff format used:

% 1. Title: Tss balance condition
% 2. Sources:
%      (a) tss arff generation routine
%

@RELATION tssbalance

@ATTRIBUTE LEG_SEG_ACC_A_0_X NUMERIC
@ATTRIBUTE LEG_SEG_ACC_A_0_Y NUMERIC
@ATTRIBUTE LEG_SEG_ACC_A_1_X NUMERIC
@ATTRIBUTE LEG_SEG_ACC_A_1_Y NUMERIC
@ATTRIBUTE LEG_SEG_ACC_A_2_X NUMERIC
@ATTRIBUTE LEG_SEG_ACC_A_2_Y NUMERIC
@ATTRIBUTE LEG_SEG_ACC_B_9_X NUMERIC
@ATTRIBUTE LEG_SEG_ACC_B_9_Y NUMERIC
@ATTRIBUTE LEG_SEG_ACC_B_10_X NUMERIC
@ATTRIBUTE LEG_SEG_ACC_B_10_Y NUMERIC
@ATTRIBUTE LEG_SEG_ACC_B_11_X NUMERIC
@ATTRIBUTE LEG_SEG_ACC_B_11_Y NUMERIC
@ATTRIBUTE LEG_SEG_ACC_C_6_X NUMERIC
@ATTRIBUTE LEG_SEG_ACC_C_6_Y NUMERIC
@ATTRIBUTE LEG_SEG_ACC_C_7_X NUMERIC
@ATTRIBUTE LEG_SEG_ACC_C_7_Y NUMERIC
@ATTRIBUTE LEG_SEG_ACC_C_8_X NUMERIC
@ATTRIBUTE LEG_SEG_ACC_C_8_Y NUMERIC
@ATTRIBUTE LEG_SEG_ACC_D_3_X NUMERIC
@ATTRIBUTE LEG_SEG_ACC_D_3_Y NUMERIC
@ATTRIBUTE LEG_SEG_ACC_D_4_X NUMERIC
@ATTRIBUTE LEG_SEG_ACC_D_4_Y NUMERIC
@ATTRIBUTE LEG_SEG_ACC_D_5_X NUMERIC
@ATTRIBUTE LEG_SEG_ACC_D_5_Y NUMERIC
@ATTRIBUTE FOOT_A0 {0, 1}
@ATTRIBUTE FOOT_B9 {0, 1}
@ATTRIBUTE FOOT_C6 {0, 1}
@ATTRIBUTE FOOT_D3 {0, 1}
@ATTRIBUTE HEAD_ACC_X NUMERIC
@ATTRIBUTE HEAD_ACC_Y NUMERIC
@ATTRIBUTE HEAD_ACC_Z NUMERIC
@ATTRIBUTE CLASS {LEG_A,LEG_B,LEG_C, LEG_D, NONE}

@DATA
To populate this data section some leg-named REST endpoints have been implemented that tilt a specific leg and save a leg tilted specific arff file. The merge of all these 5 files (LEG_ALEG_B, LEG_C, LEG_D, NONE) makes the training alle-legs arff file used to train the model.

giovedì 24 gennaio 2019

What is a strange spider ?

This spider runs on a Raspberry PI3, attached to the GPIO:




In the specific it uses I2C and Analogic pins.

I2C is used with different peripherals devices setup with different I2C addresses.

Purposes of the I2C devices are 2:


Collect digital inputs:



I will use this board
https://www.abelectronics.co.uk/p/54/io-pi-plus

IO Pi Plus

Control servo motors via PWM:





To power the Raspberry PI there are different ways: https://www.modmypi.com/blog/how-do-i-power-my-raspberry-pi

To avoid to bypass the best way to power the board up, I need to go through the micro usb. With a proper connector. So I can buy a cable at the shop close to home and cut out the "big usb" to have access to the Vcc +5V and GND wires I need. I will connect to a BEC serving 5V at 2Amp current.
A sperated BEC will be required at the same Vcc but higher current as I need it for servos and other loads, that cannot take current from the digital signals pins directly.

Overall design draft will be as per the pen made draw below: