sabato 30 novembre 2019

IO PI Plus issue

After few tests it seems the board is not announcing itself anymore on the i2c bus. The plans, given that so many inputs are not needed on the digital side, is to use for GIO pins:

domenica 24 novembre 2019

giovedì 21 novembre 2019

Well, I need 24 ADC connected to I2C bus, for 12 ADXL335, threee axis analog accelerometer, to read at least 2 axis output from each of them.


Because each segment of the leg needs two axis accelerometer, it means there is the need for:

12 servo motors

each servo needs two axis to get the position (rotation)

so: 12 leg segmenst  * 2 channels each accelerometer = 24 analog input ADC is required.

A good option is this stackable ADC, with 8 channels each board:


ADC Pi Zero




https://www.abelectronics.co.uk/p/69/adc-pi-raspberry-pi-analogue-to-digital-converter


Each of these has 2 ADC chips of type MCP3424 

That seems to be supported by Pi4j:

https://github.com/Pi4J/pi4j/blob/master/pi4j-example/src/main/java/MCP23017GpioExample.java Up to 4:

can be connected using these I2C addresses:

0x68
0x69

0x6A
0x6B

0x6C
0x6D

0x6E

0x6F

Each board will take two addresses as each board has two chip. Way to setup the I2C address is this:






Board features (copied from the AB electronics page):

8 x 17-bit 0 to 5V Single Ended Inputs
Control via the Raspberry Pi I2C port
Stack up to 4 ADC Pi boards on a single Raspberry Pi
Jumper selectable I2C addresses
Buffered 5V I2C port
Based on the MCP3424 from Microchip Technologies Inc
Single Ended full-scale range of 5.0V
On-board 2.048V reference voltage (Accuracy  ± 0.05%, Drift: 15 ppm/°C)
On-Board Programmable Gain Amplifier (PGA): Gains of 1, 2, 4 or 8
Programmable Data Rate Options:
   - 3.75 SPS (17 bits)
   - 15 SPS (15 bits)
   - 60 SPS (13 bits)
   - 240 SPS (11 bits)
One-Shot or Continuous Conversion Options
The ADC Pi is an 8 channel 17 bit analogue to digital converter designed to work with the Raspberry Pi. The ADC Pi is based on two Microchip MCP3424 A/D converters each containing 4 analogue inputs.  The MCP3424 is a delta-sigma A/D converter with low noise differential inputs.

We designed the ADC Pi to work as a single ended A/D converter using the internal 2.048V reference voltage with the -V pins tied to ground. A voltage divider on the ADC Pi board brings the input voltage range to a much more useful 0 – 5.06V. In this configuration the sample size is 17 bits for each channel.

The ADC Pi is powered through the host Raspberry Pi using the GPIO port and extended pins on the GPIO connector allow you to stack the ADC Pi along with other expansion boards.

The two MCP3424 A/D converters communicate via i2c to the host Raspberry Pi giving you eight analogue inputs to use.  A logic level converter is included on the ADC Pi board giving you a buffered 5V i2c port making it easy to add other I2C devices which operate at 5 volts without damaging the raspberry pi 3.3 volt i2c port.  The i2c buffer uses N-channel mosfets with a maximum drain current of 100mA.

The I2C address bits are selectable using the on-board jumpers.  The MCP3424 supports up to 8 different I2C addresses so with two A/D converters on each ADC Pi you can stack up to 4 ADC Pi boards on a single Raspberry Pi giving you 32 ADC inputs.

The MCP3424 contains a programmable Gain Amplifier giving the user a selectable gain of x1, x2, x4 or x8 before the analogue to digital conversion takes place.

The data rate for analogue to digital conversions is 3.75 (17 bit), 15 (15 bit), 60 (13 bit) or 240 (11 bit) samples per second. Data rate and resolution can be configured within software using the I2C interface.

We have a knowledge base article, ADC Sample Rate Comparison which has more detailed sample information and test scripts to compare the different MCP2424 ADC chip bit and sample rates.

Unused inputs should be tied to ground.

To connect the ADC to the ADXL335, I'm using the explanation as shown in the below link:


The circuit will require no extra components because I will use the ADC PI instead of the differential one:




Connect the VCC pin on the ADXL335 board to 3.3V on the GPIO header.
Connect the GND on the ADXL335  to GND on the GPIO header.
Now we need to connect the output from the ADXL335 board to the ADC inputs, as the output from the ADXL335 is up to 3.3 volts we need to add a voltage divider between the ADXL335  output and the ADC Pi positive inputs on each channel. ADC Pi comes with a voltage divide on board, so no need for an extra external one.
Connect the X pin on the ADXL335  to input 1 on the ADC Pi
Connect the Y pin on the ADXL335  to input 2 on the ADC Pi 
The Z pin will not be connected, to measure rotation 2 axis will be enough.

lunedì 18 novembre 2019

First tests with the software: display and servos


Spring Boot application with PI4J library

REST for display control





REST for stepper motor control via PVM


Motor zero test




mercoledì 13 novembre 2019

Devices: Oled Display

The small display on the board is a tiny and cheap display, whose specs follow:

Feature:

Resolution: 128*64
Control chip: SSH1106
Display area: 29.42 x 14.7mm
Driving voltage: 3.3-5V
Operating temperature: -40 ℃ to 70 ℃
Interface type: IIC/I2C  interface

Pin definitions:

1> GND (power ground)
2> VCC (positive power supply)
3> SCL (clock line)
4> SDA (data line)

About control chip SSH1106:

SSG1106 compatible with SSD1306 basic, difference is that SSH1106 control chip RAM space is 132*64, while SSD1306 space is 128*64.
The 1.3-inch OLED 128*64 dot matrix, so in the middle of the screen production took 128 row. When using SSD1306 program point SSH1106 screen, only need to change address to 0x02 row to start.

martedì 12 novembre 2019

Force sensor ddidn't work ! Bending them means breaking the contacts.


And because of this I had to switch to another approach, less expensive (I already lost 7 * 4 euros :( ) and with no noise or ADC conversions to do. Because of these, i went with a button on top of a sticky cable fix, and created 4 contact sensors. Quite raw and simple, but cheaper and hopefully working better.







domenica 3 novembre 2019

Legs forrce sensing sensors mount

Sensor type is:

GS04741


This sensor has this resistance/force response curve:


and this measures:

About the sensor


Features:
  • The flexible sensor has the characteristics of flexible ultra-thin, ultra-low power consumption and extreme speed response, etc.
  • Small size, this flexible pressure sensor is based on new nanometer pressure-sensitive materials supplemented by ultra-thin film substrate.
  • This pressure sensor has the characteristic of high stability, high consistency.
  • Highly sensitive flexible nanometer materials can realize highly sensitive detection of pressure.
  • When sensor detects outside pressure, the resistance of sensor will change.
  • Pressure signal can be converted into a corresponding electrical signal output using simple circuit.

Specifications:
Model: RP-C18.3-STManufacturing process: thin film
Output signal: analog
Pressure induction range: 20g-6kg
Trigger: 20 g, triggered, default Resistance <200 kΩThickness: 0.4mm
Not trigger resistance: > 10MΩ
Activation time: <0.01s
Delay: +10%, (RF+-RF-)/FR+,1000g force
Response time: < 10ms
Size: 3.2 x 1.8cm / 1.25 x 0.7in

Weight: 5g

Pull down resistor, needed to solve floating logical levels issues:


force___flex_fsrpulldownsch.gif

force___flex_fsrpulldowndia.png


Assembled "feets" are like below :)