Any advice? Automated rotary knob

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
obod0002c
Normal user
Posts: 119
Joined: 10 Aug 2019, 20:31

Any advice? Automated rotary knob

#1 Post by obod0002c » 28 Dec 2022, 10:06

Hi, Wondering if one of the readers here eventually knows a way to automate a rotary knob like the one pictured.
I do not want to get in touch with anything hiding behind the front panel ..
Attachments
rk.jpg
rk.jpg (67.36 KiB) Viewed 3790 times

TD-er
Core team member
Posts: 8644
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Any advice? Automated rotary knob

#2 Post by TD-er » 28 Dec 2022, 10:27

You mean like adding some clamp with a servo setting the angle?
This brings the question how much force is needed to rotate it.

obod0002c
Normal user
Posts: 119
Joined: 10 Aug 2019, 20:31

Re: Any advice? Automated rotary knob

#3 Post by obod0002c » 28 Dec 2022, 11:07

Not easy to answer, a hand can do pretty easily.
But I even thought of not getting to deep into the bits and pieces.
Idea came from when I saw this
fb.jpg
fb.jpg (55.69 KiB) Viewed 3780 times
Obviously too weak

User avatar
chromo23
Normal user
Posts: 821
Joined: 10 Sep 2020, 16:02
Location: germany

Re: Any advice? Automated rotary knob

#4 Post by chromo23 » 28 Dec 2022, 15:08

Hi, i would like to know what you want to achieve.
Do you need something for just turning the device on and off or just off. (bidirectional or unidirectional?)
Or is it only for switching between heating and heating+warm water?

obod0002c
Normal user
Posts: 119
Joined: 10 Aug 2019, 20:31

Re: Any advice? Automated rotary knob

#5 Post by obod0002c » 28 Dec 2022, 17:42

Hi, switching between heating and heating+warm water would be great, if one direction only is possible that'll help, too

User avatar
chromo23
Normal user
Posts: 821
Joined: 10 Sep 2020, 16:02
Location: germany

Re: Any advice? Automated rotary knob

#6 Post by chromo23 » 28 Dec 2022, 21:05

If it is only for two states, i would advise using a servo motor and a kind of attachment to the knob. Unfortunately i don´t have my computer with me, so the sketch is kind of "simple" but i think it makes clear what i mean.
It is advantageous to own a 3d printer for this ;)
Additional infos:
https://espeasy.readthedocs.io/en/lates ... ervo-motor
aaa.jpg
aaa.jpg (30.36 KiB) Viewed 3704 times
Edit: i choose this setup because manual override could be still possible dependent on the clearance of the mechanism...

TD-er
Core team member
Posts: 8644
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Any advice? Automated rotary knob

#7 Post by TD-er » 28 Dec 2022, 22:45

chromo23 wrote: 28 Dec 2022, 21:05 [...]
It is advantageous to own a 3d printer for this ;)
[...]
Perfect excuse to buy one.
Who doesn't have a 3D printer these days? ;)

User avatar
chromo23
Normal user
Posts: 821
Joined: 10 Sep 2020, 16:02
Location: germany

Re: Any advice? Automated rotary knob

#8 Post by chromo23 » 28 Dec 2022, 23:09

TD-er wrote: 28 Dec 2022, 22:45 Who doesn't have a 3D printer these days? ;)
Or two… :D

TD-er
Core team member
Posts: 8644
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Any advice? Automated rotary knob

#9 Post by TD-er » 28 Dec 2022, 23:12

chromo23 wrote: 28 Dec 2022, 23:09
TD-er wrote: 28 Dec 2022, 22:45 Who doesn't have a 3D printer these days? ;)
Or two… :D
Or more... ;)
Glad I can also sometimes borrow my dad's printers too, when I really need to print some large batches of enclosures.
A few months ago I had all my room filled with them printing 24/7 for 2 weeks.
That was a lot of planning to keep them occupied all time and also not running out of filament (a box of filament was held at customs..)

obod0002c
Normal user
Posts: 119
Joined: 10 Aug 2019, 20:31

Re: Any advice? Automated rotary knob

#10 Post by obod0002c » 29 Dec 2022, 09:06

Know what you're talking about as/although I don't own one, but for things like these the diy area should provide enough material.
I'm at the moment more afraid of the parts you won't print like all the cables, two differing mains adapters, outlet, ..

User avatar
chromo23
Normal user
Posts: 821
Joined: 10 Sep 2020, 16:02
Location: germany

Re: Any advice? Automated rotary knob

#11 Post by chromo23 » 29 Dec 2022, 10:58

obod0002c wrote: 29 Dec 2022, 09:06 I'm at the moment more afraid of the parts you won't print like all the cables, two differing mains adapters, outlet, ..
There is actually not so much to it.
Assuming you have a wemos d1 mini for example:
There are three cables from the servo to the wemos d1 mini and one usb cable from the microcontroller to the usb power adapter.
Bildschirmfoto 2022-12-29 um 10.57.12.png
Bildschirmfoto 2022-12-29 um 10.57.12.png (142.96 KiB) Viewed 3609 times

obod0002c
Normal user
Posts: 119
Joined: 10 Aug 2019, 20:31

Re: Any advice? Automated rotary knob

#12 Post by obod0002c » 29 Dec 2022, 17:37

Just for info, as one failing should be enough:
the device already shown before is battery operated but can move in one direction only, despite the four arrows ..
fb.jpg
fb.jpg (55.69 KiB) Viewed 3578 times
The chip used looks like an ESP but somehow smaller and not branded.

obod0002c
Normal user
Posts: 119
Joined: 10 Aug 2019, 20:31

Re: Any advice? Automated rotary knob

#13 Post by obod0002c » 03 Jan 2023, 14:25

amazingly the device above was strong enough to turn the heating. However I wasn't able to flash it as I didn't spot the necessary PIN's.
Also Alexa integration worked only partly: linking the device was successful, controlling the device wasn't.
Pity.

obod0002c
Normal user
Posts: 119
Joined: 10 Aug 2019, 20:31

Re: Any advice? Automated rotary knob

#14 Post by obod0002c » 03 Jan 2023, 14:31

chromo23 wrote: 29 Dec 2022, 10:58 Assuming you have a wemos d1 mini for example:
There are three cables from the servo to the wemos d1 mini and one usb cable from the microcontroller to the usb power adapter
before moving too deep into the configuration: 'Motor - PWM Motor' is the correct device to choose from (saw that the device's list differs from bin to bin, beg due to memory reasons).

Binary Filename:⋄ ESP_Easy_mega_20221105_custom_ESP8266_1M
ESP Board Name: Espressif Generic ESP8266 ESPEasy 1M Flash 128k FS

Is there a help page or an example available to choose the right values of the many that can be controlled?

User avatar
chromo23
Normal user
Posts: 821
Joined: 10 Sep 2020, 16:02
Location: germany

Re: Any advice? Automated rotary knob

#15 Post by chromo23 » 03 Jan 2023, 14:42

I never used a servo. But since the controlling is done via the internal gpio handling (https://espeasy.readthedocs.io/en/lates ... #p000-page) you can just use any build. I´d recommend the ESP_Easy_mega_20221224_normal_ESP8266_1M.bin from the latest release. There is no need to add a device for the servo.

obod0002c
Normal user
Posts: 119
Joined: 10 Aug 2019, 20:31

Re: Any advice? Automated rotary knob

#16 Post by obod0002c » 03 Jan 2023, 15:02

uhm,
589640: HTTP: Servo,1,14,45
589642: SERVO : command not included in build
596422: EVENT: Clock#Time=Tue,15:02

User avatar
chromo23
Normal user
Posts: 821
Joined: 10 Sep 2020, 16:02
Location: germany

Re: Any advice? Automated rotary knob

#17 Post by chromo23 » 03 Jan 2023, 15:08

Oh sorry then, i thought this is integrated in all builds. At least I haven't seen any other info about it...
So maybe TD-er reads this and can shed light into this.

Edit: But i guess, since the servos work with PWM, you could also use the PWM command.

obod0002c
Normal user
Posts: 119
Joined: 10 Aug 2019, 20:31

Re: Any advice? Automated rotary knob

#18 Post by obod0002c » 03 Jan 2023, 15:18

no worries, didn't thought it would be that easy to detect why it's not running ;-)

TD-er
Core team member
Posts: 8644
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Any advice? Automated rotary knob

#19 Post by TD-er » 03 Jan 2023, 15:21

To control a servo, you need to use PWM.
But... the pulses sent to a servo are really short.
Also the PWM frequency for a servo is rather low.
So what is done with the servo command is that it will reconfigure the PWM completely different from other typical PWM use cases.
To have some kind of 'resolution' with the servo pulses, we need to use 16-bit counters, where the normal PWM is using 10 or 12 bit counters.
Using the normal PWM command, you cannot get the fine control over those short pulses you need for servos.

We used to have a special library for servos, which adds a significant amount to the build size, but I'm not sure we still do.
If we don't then I don't think leaving the servo command out and having PWM commands in the build is going to make a lot of difference in build size.

obod0002c
Normal user
Posts: 119
Joined: 10 Aug 2019, 20:31

Re: Any advice? Automated rotary knob

#20 Post by obod0002c » 03 Jan 2023, 16:12

not sure if I understood that correctly ..

I'm now trying with a test installation on an ESP32, no memory restrictions.
Servo is working, I'd say okay.
Is there a chance to stop preventing the servo from continuous positioning', let's say half a second after firing the command?
Oh, maybe I simply need to set GPIO pin to low.

I'll then try to build my own ESPEasy version, not sure if I'll manage, Linux and Arduino are set up but this isn't everything here :lol:
Also not sure if that'll fit into 1M or if I'd rather go on collecting parcel deliveries

TD-er
Core team member
Posts: 8644
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Any advice? Automated rotary knob

#21 Post by TD-er » 03 Jan 2023, 16:28

See:
https://espeasy.readthedocs.io/en/lates ... ernal-gpio
A position value of 9000 will stop the PWM signal. This can be useful to save energy on servos which do not need power to remain at the same position.

User avatar
Ath
Normal user
Posts: 3419
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Any advice? Automated rotary knob

#22 Post by Ath » 03 Jan 2023, 16:51

obod0002c wrote: 03 Jan 2023, 16:12 I'll then try to build my own ESPEasy version, not sure if I'll manage, Linux and Arduino are set up but this isn't everything here :lol:
Also not sure if that'll fit into 1M or if I'd rather go on collecting parcel deliveries
Please use VSCode with PlatformIO for development, as that's the endorsed configuration: https://espeasy.readthedocs.io/en/lates ... ormIO.html
It contains a section specifically aimed at developers new to ESPEasy-development.
/Ton (PayPal.me)

obod0002c
Normal user
Posts: 119
Joined: 10 Aug 2019, 20:31

Re: Any advice? Automated rotary knob

#23 Post by obod0002c » 03 Jan 2023, 17:13

upuh, wanted to use less not more :lol:

obod0002c
Normal user
Posts: 119
Joined: 10 Aug 2019, 20:31

Re: Any advice? Automated rotary knob

#24 Post by obod0002c » 03 Jan 2023, 17:14

TD-er wrote: 03 Jan 2023, 16:28A position value of 9000 will stop the PWM signal. This can be useful to save energy on servos which do not need power to remain at the same position.
works like a charm .. after I found a Wemos with 4M exposing also 5V

obod0002c
Normal user
Posts: 119
Joined: 10 Aug 2019, 20:31

Re: Any advice? Automated rotary knob

#25 Post by obod0002c » 11 Feb 2023, 11:03

Software as well as servo control are working fine.
I also found a nice place to mount the servo so it will not disturb.

Unfortunately, I didn't manage to turn the switch by using a servo.

The switch has an approx. 3cm long spindle which is then attached to the onboard switch - which I obviously doesn't want to modify.

If I attach the servo to the switch like in a model airplane (metal linkage?), everything somehow gets twisted and is not turning correctly, reliably.
PXL_20230204.jpg
PXL_20230204.jpg (112.64 KiB) Viewed 2846 times
Yes, I know, 3D-printing, but with having none, the solution to the problem needs to be different ;)

Post Reply

Who is online

Users browsing this forum: No registered users and 38 guests