The ProPo project, a DIY proportional servo

Any old or new electronic projects on the go
Tobe
Posts: 665
Joined: 16 Feb 2018, 06:19
Location: Varberg or Stockholm, Sweden

Re: The ProPo project, a DIY proportional servo

Post by Tobe »

Up an running with a custom Mike K amp.

The Tx and Rx are from my GG set-up based on Phils NRF24 project and both are flown with my GG-actuators. Some more tinkering and those 2 servo will be also flown.

Here are a few bits and pieces!
Experimental Homebuilt.jpg
Last edited by Tobe on 11 Mar 2021, 14:25, edited 2 times in total.
Cheers,

Tobe
User avatar
Mike_K
Posts: 669
Joined: 16 Feb 2018, 06:35
Location: Hertfordshire

Re: The ProPo project, a DIY proportional servo

Post by Mike_K »

Another part to Tobe's DIY propo servo, an amplifier based on an Arduino and a DRV8838 (or DRV8835).

I've got it working quite nicely with an old Futaba S3001 and a Hitec HS-311. I was going to try PID control but as is my normal practice at work, I started with just the Kp (proportional gain) and a dead band and the result is as good as the original Futaba or Hitec servo amp, so there seems little point in adding the integral or derivative part of the equation. In fact with a dead-band, an integral term wouldn't work and would just "wind-up", but I might add the Kd term later to see if I can increase the Kp gain further. I've tested it with frame rates between 11mS and 25mS and it seems happy with any rate in that range. The plan is to get this program working on an ATtiny85, so it will fit Tobe's servo ;)

To get the gain correct I did a series of tests measuring the outputs to the DRV8838 with a logic analyser, the top trace is motor enable, with it high the motor runs, the second trace is the Phase, HIGH it goes one direction, LOW the other direction and finally the ppm going to the Arduino.
Kp150. Gain as high as it will go without overshooting
Kp150. Gain as high as it will go without overshooting
Kp200. The Gain slightly too high, when the servo gets to position, the Phase changes and it moves back a fraction
Kp200. The Gain slightly too high, when the servo gets to position, the Phase changes and it moves back a fraction
And I did a few runs with a servo tester in "cycle mode" where it goes from 1mS to 2mS and then back repeatedly. Below is the trace with the servo going end-to-end in one second. Here you can see the servo is never far from its intended position, so the motor runs pulsed (at the 20mS frame rate in this case).
servo_tester_cycle_1s.jpg
The servo was easy to modify, just unsolder the motor and pot from the original circuit board. I used my own servo tester (another project to write up for this site one day) and a time-expired battery!
servo_amp_removed.jpg
Servo_amp_test_setup.jpg
And a short video clip of the servo being operated on the bench



Cheers

Mike

**Edit. I've updated the servo amp program/sketch to include a neutral adjustment**
Attachments
Servo_Amp_01.3.ino
(5.89 KiB) Downloaded 208 times
User avatar
Mike_K
Posts: 669
Joined: 16 Feb 2018, 06:35
Location: Hertfordshire

Re: The ProPo project, a DIY proportional servo

Post by Mike_K »

Tobe, that is a fantastic achievement.

A home designed and built transmitter case, joysticks, a Phil encoder, 2.4GHz module and Rx and now home designed and built servos. Not many people have designed and built a complete proportional system even in the "good old days" and I expect you're the first to do it in the 2.4GHz era. Even a lot of the USA and European manufacturers didn't design their own joysticks (think of all those using Kraft Hayes or an SLM/Skyleader joystick in the UK). And even fewer designed their own servos, most just bought those in.

A few of my encoders will be in the post shortly, then you can have a complete home designed and built computer transmitter with LCD display and model memories etc.

Cheers Mike
Tobe
Posts: 665
Joined: 16 Feb 2018, 06:19
Location: Varberg or Stockholm, Sweden

Re: The ProPo project, a DIY proportional servo

Post by Tobe »

This one is for you Martin!


I just played around with what I had available at home, a motor gearbox running a M3 at 1000 rpm, a linear pot(the same I use in my stick as trim 5K) and Mike's amp.
There is no backlash as I have 2 M3 nuts against each others in the in the slider.
20210311_171756.jpg
Attachments
20210311_171820.jpg
Cheers,

Tobe
Tobe
Posts: 665
Joined: 16 Feb 2018, 06:19
Location: Varberg or Stockholm, Sweden

Re: The ProPo project, a DIY proportional servo

Post by Tobe »

To all of you that might be tempted...give me a few days and I'll come up with a less demanding 3D-printed set up of this project.
I never thought that one of my side projects would create any interest at all. All this is part of me wanting to build from scratch a complete radio set, at least the hardware just to prove to myself that I still can build almost everything...that was the legacy that my late father thought me.
There is nothing you can't do or learn it's just a matter if it's worth the effort.
My late dad flew R/C the first time in 1949 and did it all his life....just remember the Zebra?
Attachments
20181116_113409.jpg
20181116_092050.jpg
Last edited by Tobe on 12 Mar 2021, 12:37, edited 1 time in total.
Cheers,

Tobe
User avatar
Wayne_H
Posts: 809
Joined: 17 Feb 2018, 05:26
Location: Temora, NSW. Australia
Contact:

Re: The ProPo project, a DIY proportional servo

Post by Wayne_H »

Tobe, more terrific design & engineering👏👏.

I'd also thought of using a linear pot & worm drive ala the small linear servos coming out of China - I have 4 or 5 in a grab bag of old multiplex parts only 2500klm away :shock: I reckon they are physically about 10% larger than the ones you have used.

Are you using any gear reduction between motor & worm drive? If so, what ratio?
Cheers,

Wayne
Once a Retrobate, always a Retrobate............ ;)
User avatar
Wayne_H
Posts: 809
Joined: 17 Feb 2018, 05:26
Location: Temora, NSW. Australia
Contact:

Re: The ProPo project, a DIY proportional servo

Post by Wayne_H »

Mike_K wrote: 11 Mar 2021, 12:31 Another part to Tobe's DIY propo servo, an amplifier based on an Arduino and a DRV8838 (or DRV8835).

.... I was going to try PID control but as is my normal practice at work, I started with just the Kp (proportional gain) and a dead band and the result is as good as the original Futaba or Hitec servo amp, ...

Cheers

Mike
Great stuff Mike, well done.

Does your amp have to use a 5k pot or can it accommodate other common i.e. readily available values?
Cheers,

Wayne
Once a Retrobate, always a Retrobate............ ;)
Tobe
Posts: 665
Joined: 16 Feb 2018, 06:19
Location: Varberg or Stockholm, Sweden

Re: The ProPo project, a DIY proportional servo

Post by Tobe »

Wayne_H wrote: 12 Mar 2021, 08:32
Are you using any gear reduction between motor & worm drive? If so, what ratio?
The GA2-N20 comes in different configuration so I just took what I had handy.
To avoid backlash I have 2 M3 nuts positioned against each other so there is no play
Attachments
TB2qy14X7fb_uJkHFNRXXc3vpXa_!!2815451570.jpg_460x460q90.jpg
Cheers,

Tobe
Tobe
Posts: 665
Joined: 16 Feb 2018, 06:19
Location: Varberg or Stockholm, Sweden

Re: The ProPo project, a DIY proportional servo

Post by Tobe »

Here comes my way to build the Mike Amp. first we have to realize that this Mike Amp. is probable more sophisticated than the one used commercially as it's fully programmable and can be adapt to almost any servo.
Mike Amp B.jpg
I show the board here running an old "Icon" that now can be flown again.
This picture shows necessary components, a DRV8838, an Arduino Pro Mini board and my "custom made stacking board connectors".
Mike Amp C.jpg
...and here I'm showing the wires connected to the 2 boards before and after mating.
Mike Amp D.jpg
To do this I have moved the ppmin from 2 to 6. I have also included my settings for the DIY

#define potRotation 180 //What the electrical movement of the servo/pot is
#define servoRotation 160 //What the total servo rotation is (must be equal or less than the pot rotation) for a 900uS to 2100uS ppm input
#define Kp 150 //The proportional gain for the error signal (
#define deadBand 10 //The servo dead band to stop the servo hunting for its set position in +/- uS /2
#define centre 0 //To adjust the centring of the servo, can be a +/-value eg -12 or 14. It's value is very roughly equivalent to +/-uS movement (1200/1024 = 1.17uS to be precise)

#define ppmIn 6 //must be in the range D0 - D7 (was ppmin 2)
#define drv8838EN 3 //must be in the range D0 - D7
#define drv8838PH 4 //must be in the range D0 - D7

#define potIn 0 //where the servo pot connects, must be in the range A0 - A7

This is how I build them and allows me to stack the DRV8838 on top of the Arduino.
DIY ProPo Mike Amp.JPG
DIY ProPo Mike Amp B.JPG
One remarks, this will only work if voltage of 4,8v -5-2v is applied i.e. 4s NiMh or the regular output of 5.0-5.2 v from a speed control would do fine but anything else will probably damage it and release the "blue smoke" contained in some of the electronics - 2s LiFe is a No-No
DIY ProPo Mike Amp.pdf
(231.38 KiB) Downloaded 173 times
Last edited by Tobe on 14 Mar 2021, 07:42, edited 7 times in total.
Cheers,

Tobe
Tobe
Posts: 665
Joined: 16 Feb 2018, 06:19
Location: Varberg or Stockholm, Sweden

Re: The ProPo project, a DIY proportional servo

Post by Tobe »

Hardware for the DIY ProPo
3D-printed parts preferably in ABS - I will be able to supply at cost plus S&H
GA12-N20 6v - 60-70 rpm https://www.aliexpress.com/item/4000274 ... 4c4duO8poi
Futaba Stick Pot 5K https://www.aliexpress.com/item/3304988 ... 4c4duO8poi
Dowel pin 1.5 x 8-10 mm

Printer setting:
ABS
0.4mm nozzle
85% infill
0.14mm layers
Support

I have tested the files on a couple of printers and if you stick with ABS and the above setting they have come out OK and acceptable.

The ProPo.zip folder includes .stp files of the assemblies so if utilized need to be split in parts and every part needs to be inserted into a new part after which you have working CAD files to make changes
Attachments
ProPo.zip
(5.16 MiB) Downloaded 176 times
Tobe's printing files.zip
(98.53 KiB) Downloaded 174 times
Cheers,

Tobe
Post Reply