ディジタルVFOの場合,周波数ステップの切替えが必須かと思う.
ただ,実際操作してみるとステップ切替え操作はかなり煩わしいもので,なんとかしたいと思っていた.
切替え頻度を減らすにはパルス数の多いエンコーダを使えばよさそうだが,今一つスッキリ解決するような気がしない.それにエンコーダが高価.
そこで,特に目新しいものではないが回転速度を検出してそれに応じて連続的に周波数ステップを変化させるようにしてみた.ここに動画をUPしておく.
今回試した方法は次のとおり.
ダイアル速度を vd,加速を始める速度しきい値を vth として,次式のように変数 L に積算していく.
(1) vd>vth のときのみ, L=L + (vd – vth);
また,速度 vdが 0 のときは,減速用の定数をRdec として,
(2) L=L – Rdec; ただし,L<0 ならL=0;
次に,Lの値からRaccを加速率の定数として次式でステップ数を決める.
(3) ステップ=最小ステップ + Racc*L^n;
現状,n=2 としているが,他の定数も含め操作感に関わる値なので,いろいろと調整するといいと思う.また際限なくステップが大きくなるのを回避するためには,Lの上限を設定すればいい.
ダイアルの速度の検出は簡単で,エンコーダカウント値の絶対値が速度そのものなので,特に何か処理が必要なことはない.
公開しているソースで言えば,count という変数の絶対値が速度( vd=|count| ).
理由は,count はメインループの1回の処理時間当たりのカウント値なので,その絶対値はダイアルの速度に比例したものとなるため.
結局,メインループの処理1回で変化させる周波数Δfは,
(4) Δf=count*( 最小ステップ + Racc*L^n );
動画は,
vth=2, Racc=0.002, Rdec=1.0, n=2, 最小ステップ=10[Hz]
で動作させたもの.
個人的には,ステップ切替えスイッチは無くてもいい,と思えるくらいの操作感になっていると思う.
“Since the speed of the dial is easy to detect”, how?
Do you use a relative timer such as millis() and find the difference between subsequent calls? Or some other mechanism?
The dial is brilliant, well done!
VK3HN.
いいねいいね
Thanks!
The rotary encoder(RE) interface process is counting RE pulse and updating the valiable “RE_count” independently of main loop.
In main loop, copying the value of “RE_count” to the local variable “count” and immediately clearing “RE_count”.
Thereby the unit of “count” is [Encoder pulse number]/[Period of the main loop], that means its dimension is speed or velocity.
JF3HZB.
いいねいいね
Impressive, wonderful. SP9MRN
いいねいいね
Thanks!
いいねいいね
Hi, I love this project but can’t seem to find the ESP32 dev kit board.
I did find this board on ebay that looks very similar. Although has less pins bought out.
eBay item number:
222445989691
Is it possible to use this board? I tried uploading the sketch to it but with no success. It “fails to connect to ESP32, packet header problem”.
I did install the ESP32 into the Arduino IDE. I used “ESP32 dev module” as the board. Then left the defaults except choosing the Port number.
Glenn
vk3pe
いいねいいね
Update, I managed to upload now and have a display running OK. Had to hold down the BOOT button on the module for it to upload. My module is missing pins 17 & 16 for the Encoder so I used 34 & 35 which works. ie changed the 2 #defines for the A/B. Using a cheap encoder of 16 positions I think from eBay which misses every 2nd count. ie it counts in 20Hz not 10Hz at moment.
glenn
vk3pe
いいねいいね
Operating BOOT button may be unnecessary by adding a 10uF capacitor between EN pin and GND.
Since RX2 is IO16, TX2 is IO17,
maybe you don’t need to change the pin assignment of the encoder.
いいねいいね
Hola.
Where can I obtain the schema and sketch ??
Thnk´s
Josep
EA3BDD
いいねいいね
Hi.
Where can i get this dds vfo for my Yaesu FT-101F ?
Thnk´s
Josep
EA3BDD
いいねいいね
You can download the schematic and sketch from
https://1drv.ms/f/s!AuNEkncH4HtWhpoI-NgJxz5nNLD4JA
いいねいいね
Hi.
Tnk´s, thnk´s, thk´s. Josep
ea3bdd
いいねいいね
WORKS VERY WELL see http://www.carnut.info/FT-7_Yaesu_repairs/FT-7%20Digital%20VFO%20and%20Display/Yaesu_FT-7_digital-VFO-Display.html
いいねいいね: 1人
Hi.Your name ?Your country ?Your calk sign ?Tnk’s for all info.Josepea3bddEnviado desde mi smartphone Samsung Galaxy.
いいねいいね: 1人
Thanks for your report. I’m glad it worked well.
いいねいいね
My name is Glenn, VK3PE in Melbourne Australia.
I have updated my web page with a little more information on what I did for this great project.
http://www.carnut.info/FT-7_Yaesu_repairs/FT-7%20Digital%20VFO%20and%20Display/Yaesu_FT-7_digital-VFO-Display.html
いいねいいね
TJ, there is a problem with the code for this project:-
With the default freq_step set to 10Hz
Moving the encoder one way increases the frequency output in 10Hz steps but rotating the other way (anticlockwise) the output frequency decreases in 1Hz steps. NOT 10Hz steps.
If I change the Increments value to 1000Hz, (#define freq_step 100;) clockwise moves the frequency output up in 1KHz steps OK,
BUT anticlockwise moves the 1KHz AND 1Hz steps of the output frequency at the same time.
I do not understand the code enough to know why this occurs. Can you please have a look at this.
I put in a Serial.println to output the current frequency to the serial output. That is how I am seeing this fault.
glenn
vk3pe
いいねいいね
I have confirmed the operation of the VFO system.
However, the problem with your system could not be found here.
If the freq_step is set to 10Hz, it is impossible the step becomes 1Hz with this program code.
Since I cannot confirm such defect, It is difficult for me to identify the cause.
In fact, I received the output of si5351 with a receiver.
As a result, the frequency has changed very smoothly without any problems in my system.
The difference between your and my system is about the encoder.
It may be the cause of the problem.
It seems that you can not use IO16, 17
How about the following settings
#define PULSE_INPUT_PIN 4 //Encoder A
#define PULSE_CTRL_PIN 19 //Encoder B
Tj Lab
JF3HZB
いいねいいね: 1人
Thanks TJ. I will have to look closer at my setup here..
Glenn
vk3pe
いいねいいね
Great project, even better than the videos. I bought the ESP32-DevkitC, but it uses the ESP32-WROVER-B module. As I discovered this doesn’t support pins 16 & 17 (even though they are brought out to pins). I changed to 26 & 27 and it works fine. Now to find a project I can use it in.
Many thanks
Jim – G3ZQC
いいねいいね: 1人
Hi. Tnk´s for information. It´s important for us. We are not very experts but with your information and that of Glenn we go ahead and learning. At the moment everything works for us. We hope to be successful. Josep ea3bdd
いいねいいね
Hi, No problem. It’s a steep learning curve though. Really clever piece of coding, just wish I could understand it better.
73
Jim – G3ZQC
いいねいいね
Jim,
Thanks for your report.
Glad to hear that your system works fine.
Tj Lab
JF3HZB
いいねいいね
Hi,
I did have a slight concern. The first encoder I tried was a mechanical one with detents (clicks). Each ‘click’ produced approximately 4 frequency steps. I assume the PCNT produces a count pulse for each change of state from encoder A and encoder B. I took the liberty of replacing the PCNT code with an interrupt driven scheme. Now I only get one frequency step per ‘click’. I replaced the mechanical encoder with a 120ppr optical one, and it works really well.
Now to find a project worthy of the vfo.
73
Jim – G3ZQC
いいねいいね
Jim,
Thanks for the useful information.
For using mechanical rotary encoders, as you did,
I also think good to count pulses with interrupt driven.
Yet, It’s comfortable to use the 120p/rev encoder, isn’t it?
Tj Lab,JF3HZB
いいねいいね
Hi.I have some problem with the “Rotary.h” file.Where can I have the correct sketch ?JosepEnviado desde mi smartphone Samsung Galaxy.
いいねいいね
The correct sketch and files can be downloaded from
https://1drv.ms/f/s!AuNEkncH4HtWhpoI-NgJxz5nNLD4JA
The set of sketch and files does not contain the file “Rotary.h”.
First of all, “Rotary.h” is not necessary.
Tj Lab, JF3HZB
いいねいいね
Hi. Sorry all. The last mail are a mistake. It´s an other project. Sorry. Josep
いいねいいね
The same phenomenon occurs with me, I have flipped hardware A and B moderately, so that the encoder is flipped from left to right. But here too the steps down are slower than up. Therefore, it cannot be the decoder. It must be something in the software, but it cannot yet figure out what it is.
The encoder that I use is an optical 600n. this decoder needs at least 7 volts (5v regulator internal), but because A and B are open collectors, it gives no problems with the ports of the ESP32
いいねいいね
Equal steps up and down solved!
Find this line in Alternative Loop (core0)
afstp=(long)(0.5 + (float)(count)*((float)freq_step + Racc*L*L) );
and chance it to
afstp=(long)(0 + (float)(count)*((float)freq_step + Racc*L*L) );
The up and down steps are equal now
いいねいいね
Hi. Thnk´s for info. The Circular dial is working !!. Now we are whith the circuit for output to FT-7. A lot of problems with the schematic. Heave you an definitive schematic or is the same as alwais ?? Some photo would be helpful Thnk´s, thnk´s thnk´s josep ea3bdd
. The schematic that we have,
いいねいいね
Hi.
Thnk´s for info.
The Circular dial is working !!.
Now we are whith the circuit for output to FT-7.
A lot of problems with the schematic.
Heave you an definitive schematic or is the same as alwais ??
Some photo would be helpful
Thnk´s, thnk´s thnk´s
josep
ea3bdd
いいねいいね
How do you make the Font’s ? Some friends and I would like to have some other Font sizes for our implementation into a VFO project using your Sketch as a basis.
Is there a program to generate other Fonts?
いいねいいね