From 4750031ad6074ae2951acf2e2aacf67f7c6858b9 Mon Sep 17 00:00:00 2001 From: Lucien Renaud Date: Thu, 26 May 2022 19:18:11 +0200 Subject: [PATCH 1/4] Update 'README.md' Add complete link to pictures --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 8ddeb07..6b9782f 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ The aim of this project is to be able to use the 3-axis DJI gimbal with a custom open source controller like [SimpleFOC](https://docs.simplefoc.com/). This high quality gimbal is very tiny and easy to find as a replacement part which makes it very suitable for DIY projects. - - + + ## Pinout identification The Gimbal is composed of a flex PCB with a main connector and 3 smaller for each motor. The main end connector is a 40-pin mezzanine board to board connectors. In order to work easily I have designed a breakout board which open to a 2.54" header. (Kicad folder) @@ -13,7 +13,7 @@ Here is the strategy I followed to find the pinout: 2. Group remaining pins by motor With the multimeter find all the pins connected to the motor connector. (Reapeat 3 times for the other connectors) - + ### Open-loop control @@ -31,7 +31,7 @@ Connected directly to a MCU (here a STM32 Nucleo F401RE) and with the Simple FOC ### 1. Setup Each motor is composed of two ratiometric linear hall sensors. (Texas Instrument DRV5053 Analog-Bipolar Hall Effect Sensor) They are placed at around 120º from each other (eyes measured) and measure the magnetic field of the rotor. - + Ratiometric means that the output signal is proportional to the voltage supply to the sensor. In this setup, with 5V supply, the output measured is between 520mV and 1.5V, so a 1V amplitude signal. @@ -40,7 +40,7 @@ Ratiometric means that the output signal is proportional to the voltage supply t These oscilloscope traces are the sensor output when rotating the rotor forth and back. (a bit less than 180º on the 3rd motor) The channel 0 (Yellow) is the Hall 1 and the Channel 1 (Green) is the Hall 2 - + We can see that in the first movement (positive rotation), the green is out of phase of π/2.` @@ -102,4 +102,4 @@ To achive position control it is necessary to have first, a velocity controller However, the motors of the gimbal have hard stop and can only rotate of around a half turn. It was so necessary to remove these mecanical stops. I drilled with a 1.6mm drill the two little holes to remove it. Then the motor was able to rotate freely and PID can be tuned. - + From a909abbdd16d395a32a799a8689435c639c4f973 Mon Sep 17 00:00:00 2001 From: Lucien Renaud Date: Thu, 26 May 2022 19:27:44 +0200 Subject: [PATCH 2/4] Update 'README.md' Fix the image link --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 6b9782f..5d0f47c 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ The aim of this project is to be able to use the 3-axis DJI gimbal with a custom open source controller like [SimpleFOC](https://docs.simplefoc.com/). This high quality gimbal is very tiny and easy to find as a replacement part which makes it very suitable for DIY projects. - - + + ## Pinout identification The Gimbal is composed of a flex PCB with a main connector and 3 smaller for each motor. The main end connector is a 40-pin mezzanine board to board connectors. In order to work easily I have designed a breakout board which open to a 2.54" header. (Kicad folder) @@ -13,7 +13,7 @@ Here is the strategy I followed to find the pinout: 2. Group remaining pins by motor With the multimeter find all the pins connected to the motor connector. (Reapeat 3 times for the other connectors) - + ### Open-loop control @@ -31,7 +31,7 @@ Connected directly to a MCU (here a STM32 Nucleo F401RE) and with the Simple FOC ### 1. Setup Each motor is composed of two ratiometric linear hall sensors. (Texas Instrument DRV5053 Analog-Bipolar Hall Effect Sensor) They are placed at around 120º from each other (eyes measured) and measure the magnetic field of the rotor. - + Ratiometric means that the output signal is proportional to the voltage supply to the sensor. In this setup, with 5V supply, the output measured is between 520mV and 1.5V, so a 1V amplitude signal. @@ -40,7 +40,7 @@ Ratiometric means that the output signal is proportional to the voltage supply t These oscilloscope traces are the sensor output when rotating the rotor forth and back. (a bit less than 180º on the 3rd motor) The channel 0 (Yellow) is the Hall 1 and the Channel 1 (Green) is the Hall 2 - + We can see that in the first movement (positive rotation), the green is out of phase of π/2.` @@ -102,4 +102,4 @@ To achive position control it is necessary to have first, a velocity controller However, the motors of the gimbal have hard stop and can only rotate of around a half turn. It was so necessary to remove these mecanical stops. I drilled with a 1.6mm drill the two little holes to remove it. Then the motor was able to rotate freely and PID can be tuned. - + From aa2e898c0b6d9e4763ebd08b9e4966083197241a Mon Sep 17 00:00:00 2001 From: Lucien Renaud Date: Fri, 18 Nov 2022 15:02:18 +0100 Subject: [PATCH 3/4] testing math --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 5d0f47c..4486a18 100644 --- a/README.md +++ b/README.md @@ -48,12 +48,14 @@ We can see that in the first movement (positive rotation), the green is out of p 1. Get the absolute angle within a period Since the 2 signals correspond to a cos and sin signals, it is possible to compute the angle inside the period using arctan2 function. However, we have more than one period, it is so necessary to increment a position. + $$\theta= atan2(a,b)$$ 2. Incremental position To increment the position, it is necessary to start from 0 at a known postion. For that the motor is moved in open loop to one end and the position is set to 0. Then we need to sum all the delta of movement at each measure sample. + $$\phi_t=\phi_{t-1} + (\theta_t - \theta_{t-1})mod(-\pi;\pi)$$ ## Coding the solution From 15338a6c65e2b969558efba1c7ed811eb5bea233 Mon Sep 17 00:00:00 2001 From: Lucien Renaud Date: Sun, 15 Jan 2023 19:52:34 +0100 Subject: [PATCH 4/4] Update readme: correcting ratiometric to absolute sensor The sensors are NOT ratiometric they are absolute --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4486a18..869fb77 100644 --- a/README.md +++ b/README.md @@ -29,11 +29,11 @@ Connected directly to a MCU (here a STM32 Nucleo F401RE) and with the Simple FOC ## Position estimation with the integrated linear hall sensors ### 1. Setup -Each motor is composed of two ratiometric linear hall sensors. (Texas Instrument DRV5053 Analog-Bipolar Hall Effect Sensor) They are placed at around 120º from each other (eyes measured) and measure the magnetic field of the rotor. +Each motor is composed of two absolute linear hall sensors. (Texas Instrument DRV5053 Analog-Bipolar Hall Effect Sensor) They are placed at around 120º from each other (eyes measured) and measure the magnetic field of the rotor. -Ratiometric means that the output signal is proportional to the voltage supply to the sensor. In this setup, with 5V supply, the output measured is between 520mV and 1.5V, so a 1V amplitude signal. +Those sensor are absolute, meaning that the output of the measured magnetic field is the same regardless of the power suplly. In this setup, with 5V supply, the output measured is between 520mV and 1.5V, so a 1V amplitude signal. ### 2. Measures