Open M0LTE opened 2 years ago
Parts have been ordered to do this for minimal cost. Experimentation will be done once they arrive in a week or so.
At the moment it's sub-£10 for the encoder/switch and an arduino with a short USB cable (not necessary for the final design). I'm not planning to replicate the extra 3 switches on the FlexControl unless people specifically think that would be useful (I'm not sure it would for this application)
@borzwatson have a chat with @M5ET who is also interested in this
Hi @M5ET I am also interested in the encoder, but want to use a larger free-running one. I have one on order and also an Ardunino pro. I am planning to use the code/wiring used by the Langstone project suggested by @G4CDF at https://wiki.microwavers.org.uk/Langstone_Project#External_rotary_encoder_for_tuning. Will update when I receive the bits.
@borzwatson theoretically the encoder size itself should be irrelevant - you should be able to put whatever sized knob on it you like. Whilst my initial testing will be done with a clicky encoder (as that's what turned up from eBay), my intention would also be for it to be free-spin friendly in future versions, so I'll be looking at options once I've got the code nailed down.
The code itself should be trivial - just a quick read of how fast the encoder is spinning and therefore which ascii command to send out of the arduino's serial port over USB. @M0LTE has already planned to add the code on the rig side for FlexControl compatibility (which is what I'll emulate with the "cheap" encoder), so it should all slot together fairly nicely and easily!
@M0LTE has already planned to add the code on the rig side
This is done and working with a genuine Flex knob. The rig will do a scan of all serial ports at startup, looking for a serial port that, when opened at 9600 baud, responds with the magic ASCII string "F0304;" one or more times. It then grabs that port, drops the others, and it's wired up to the VFO display.
Knobs to twiddle https://sdrgadgets.co.uk/2-home
I would suggest implementing the extra four buttons even if it’s just header pins on a pcb and support in software. People can then use it to make their own flex knob. We will need a calibration option as a cheap encoder is 20 steps per revolution but the type that Simon purchased can be up to 600 so it will need to be scaled down. Accepting commands over serial to set the division factor and save them to flash would be easiest and a universal solution. I also have a cheap rotary encoder but also mouse scroll wheel encoders on order to try.
For the code to read the encoder I would suggest https://playground.arduino.cc/Main/RotaryEncoders/#Example3 as it is interrupt driven so should work well with high resolution encoders.
Hi,
Using the Langstone controller as a basis, I have a working code for this - seems to be very responsive on a 400 per rev control.
I have added it to the GitHub under control-knob folder. Note it is unfinished - plans I have
Add compiler switches so it will compile on Arduino's without USB mouse emulation - in this mode only FlexKnob protocol would be available.
Add support for Flex buttons
Add physical switch to select between mouse emulation and FlexKnob on Arduinos which support mouse.
Experiment with adding a I2C DAC to drive a physical S meter, driven by incoming serial commands << Note that is a side-line plan, I can understand many may see this functionality as utterly pointless! Also not sure how feasible it is with the amount of serial data to get a responsive S meter, but would like to experiment.
73
Simon M0ZSU
From: gblades @.> Sent: 17 January 2022 23:32 To: M0LTE/pi-transceiver @.> Cc: borzwatson @.>; Mention @.> Subject: Re: [M0LTE/pi-transceiver] Clone the FlexControl knob (Issue #12)
For the code to read the encoder I would suggest https://playground.arduino.cc/Main/RotaryEncoders/#Example3 as it is interrupt driven so should work well with high resolution encoders.
— Reply to this email directly, view it on GitHub https://github.com/M0LTE/pi-transceiver/issues/12#issuecomment-1014954466 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AJINSV7DKOFTSAO7ZR2RAULUWSRHVANCNFSM5LFFADPA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub . You are receiving this because you were mentioned. https://github.com/notifications/beacon/AJINSV3XWYTKTR7EKDGCI2LUWSRHVA5CNFSM5LFFADPKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOHR7PTYQ.gif Message ID: @. @.> >
Basic functionality now working, including the switch and 3 buttons - the DAC idea has now moved to the main project being driven directly by the Pi.
A side project.
It would be nice to have a little microcontroller connected to a rotary encoder which outputs the same simple ASCII protocol as the FlexControl knob via serial or USB serial.
This would connect internally to the Pi and could be exposed on the front panel as a rotary knob.