Hercules MIDI with 6300

  • 11
  • Idea
  • Updated 4 years ago
All,

I wrote a program in "processing" that allows me to control my 6300 over CAT with the Hercules DJ Instinct.

Currently working;
VFOA Freq w/variable speed
VFOB Freq w/variable speed
XIT offset
RIT offset
PTT

Planned;
ACGT
Main Volume
vfoA volume
vfoB volume
Step size
mode
bandwidth
etc.

I am somewhat limited with CAT.  DDUTIL adds in additional CAT commands (DD6) that will do most of what else I want.  However I cant seem to get the DDUTIL commands to work.  So if anyone has experience using DDUTIL commands.  Please help me out!

Anyway here is a short video, sorry about the shaking! :)

https://www.youtube.com/watch?feature=player_detailpage&v=oidCZVeAKbo&list=UUXPBbnOEFQ_MN6UM...

W4WHL
Photo of William Hemmingsen

William Hemmingsen

  • 573 Posts
  • 278 Reply Likes

Posted 4 years ago

  • 11
Photo of Ken - NM9P

Ken - NM9P, Elmer

  • 4083 Posts
  • 1276 Reply Likes
William,
You could make your control IF/THEN statements active in multiple decks with something like:

IF ((channel == 1) || (channel == 2)) && (pitch == 20))
Then do this function....

That would allow you to use the same buttons on most of the controller when you change the VFO channel.

You could also have the different decks allow a different layout for some functions. But that could get really complicated...

Ken - NM9P
Photo of William Hemmingsen

William Hemmingsen

  • 573 Posts
  • 278 Reply Likes
easier is:

if (pitch == 20) {;} // Any channel

but this is not my issue.  My issue is;  I wish I could set the channel number via software and not just the DECK button.

I would like the controller to sync with the smartsdr, so if I changed active slice in smartsdr, it would switch the deck auto-magically.

I would Also like the deck switch to skip 3 & 4, just cycle 1 & 2.  But this is forced in hardware and can't be software controlled.

Not a super show stopper, it just means I have to tap the button 3 times to get from slice b back to slice A.

I could ignore all channel numbers and just use a Boolean toggle to swap slices.  But then I have a useless button and display.  I guess a few extra clicks is not a super big deal.

William
Photo of Ken - NM9P

Ken - NM9P, Elmer

  • 4083 Posts
  • 1276 Reply Likes
OK, I didn't know you could just ignore channel number and just read pitch. That is good to know when I start programming mine. It should arrive in a few days.
Photo of William Hemmingsen

William Hemmingsen

  • 573 Posts
  • 278 Reply Likes
Ken,

The slider on the right side is neither a controller event nor a note event, I was lost on this and had to dig into the midi library.  I ended up having to read the raw data to read this value.  Here is how I did it:

void rawMidi(byte[] data) {

  int command = (int)(data[0] & 0xFF);
  int value = (int)(data[2] & 0xFF);

  if (command == 224) { //do someting here}

Channel 1 slider = 224
Channel 2 slider = 225
Channel 3 slider = 226
Channel 4 slider = 227

This had me almost sending the controller back to amazon.  Took me many hours to get this working LOL

William
(Edited)
Photo of William Hemmingsen

William Hemmingsen

  • 573 Posts
  • 278 Reply Likes
Photo of MH_Flexer

MH_Flexer

  • 65 Posts
  • 13 Reply Likes

Hi William,

Looks like a really good start, the shape and orientation of the PL1 is such that I can see it easily setting along side my trackball with easy access. 

I downloaded the Processing program, once I get my CMD installed and start using it I'll be getting into the code myself.

I am on a notebook computer, I just ordered a USB 16" monitor for more screen real estate.  My dinette table is getting crowded.

Happy Easter,


Duane

Photo of MH_Flexer

MH_Flexer

  • 65 Posts
  • 13 Reply Likes
Second thoughts, the PL1 has really large footprint, sticking to the CMD Micro
Photo of Steve W6SDM

Steve W6SDM

  • 625 Posts
  • 282 Reply Likes
William,

Thank you for the absolutely outstanding work.  You developed this entire thing in about a week - that's amazing.  I think Behringer ought to send you a commission on all of the CMD Controllers they sold as a result of your programming.  I see Amazon is running out of these, so anyone interested should get theirs now.

You know, I used the Hurcules board and PowerSDR/UI that Toby Wellnitz, DH1TW, put together for years with my Flex 5000.  I really missed it when I upgraded to a 6300.  Now there's something to take its place.  I have found that having two direct control wheels, one for each slice, is a big help in contests and working DX pileups.

One more thing;  I think this type of project really shows the Flex advantage.  Users developing new ideas and sharing them with the user community is something you don't see with the other radio brands.  With the API, we will see even more advanced and useful developments.  Even outside of API programming, things like the Behringer CMD interface are a big plus for Flex users.

Thanks again, William.

Steve, W6SDM
Photo of Steve W6SDM

Steve W6SDM

  • 625 Posts
  • 282 Reply Likes
Sounds good.  Yes, I still have it.  From what I can see and have read about the Behringer controller, it's much more "solid" than the Hurcules and it looks like it's a lot prettier.  It also looks like it would fit the desk real estate better.

If there's anyone out there looking for a Hurcules, I can make them a really good deal on mine.
Photo of Bob W7KWS

Bob W7KWS

  • 25 Posts
  • 4 Reply Likes
Regarding fitting the shack, I rearranged things today.  Here's what I've ended up with.  The Flex is quickly taking over as my default rig.

Bob
Photo of William Hemmingsen

William Hemmingsen

  • 573 Posts
  • 278 Reply Likes
Tmate2 and the CMD Micro.  You have more knobs than a "Knobbed Radio)...LOL

How did you get it to stand up like that?
(Edited)
Photo of Bob W7KWS

Bob W7KWS

  • 25 Posts
  • 4 Reply Likes
Two of these from Amazon, one at each end. Two sided tape holds them really well.

http://www.amazon.com/gp/product/B00N1VDCGO/ref=oh_aui_detailpage_o01_s00?ie=UTF8&psc=1

Bob
(Edited)
Photo of Bob - W7KWS -

Bob - W7KWS -

  • 301 Posts
  • 48 Reply Likes
I'm right handed. The TMate2 to the right allows me to tune Slice A without covering controls on the Micro with my arm.  Left hand can then be on AGC, PTT, Etc.

I tried using Slice B as my default but many other items make that sub-optimum.
Photo of William Hemmingsen

William Hemmingsen

  • 573 Posts
  • 278 Reply Likes
I plan to at some point (after I finish playing with the PL-1) will make major updates to the micro code.  One thing I want to do is add in a shift feature so many more functions can be added.  This would also eliminate the need for the toggles in the app window.

I still like the Micro the best so far.  It's size is great and the dual Jog wheels work great.  It also looks very radio like.

The PL-1 is HUGE, but it has much more dials and switches.  It will take me a good bit of time to get a version of code released for this.  Tons more work to complete, and not enough time to work on it.

William
Photo of William Hemmingsen

William Hemmingsen

  • 573 Posts
  • 278 Reply Likes
All,

Here is a new version of the CMD Micro that has a longer timeout value.  For all having discovery issues, please try this version and let me know.  If 1.9e is working fine for you, no need to update, as no new features have been added.

https://www.dropbox.com/s/gf5wg8trwv9u0zu/CMDMicroFlex6k_v1_9f.zip?dl=0

William
Photo of William Hemmingsen

William Hemmingsen

  • 573 Posts
  • 278 Reply Likes
Al,

How do you have the PC directly connected to the radio?  Are you using a second NIC card for internet access?  My guess is my program is trying discover on the wrong interface.

Please elaborate on your setup.

Thanks

William
Photo of Al K0VM

Al K0VM, Elmer

  • 595 Posts
  • 100 Reply Likes
I use wifi for the internet connection..

I use either Radio<cat5>PC<wifi>router  (prefered) or Radio<cat5>router<wifi>PC

AL, K0VM
Photo of William Hemmingsen

William Hemmingsen

  • 573 Posts
  • 278 Reply Likes
That is the issue.  The APP is listening for UDP on the wifi interface which is the default.  Do this :

  • Open Control Panel\Network and Internet\Network Connections
  • Press your ALT key, then choose the Advanced menu and select Advanced Settings.
  • Under Adapters and Bindings, move the multicast NIC (local lan connection) above the Internet Access NIC (wifi) in the Connections field.
William
Photo of Al K0VM

Al K0VM, Elmer

  • 595 Posts
  • 100 Reply Likes
William,
   I tried reordering the interfaces as you suggest but the problem remain... It now seems that I had a firewall issue.  When I switched to the direct connection, my network type changed from private to public but the firewall never asked me if I wished to allow the software through..  Turning the firewall off allowed the connection to happen.. I turning it back on and was then prompted to allow the connection..  Everything running since then..   ( I have since reverted the interface order and the SW still runs with the direct connection. )
    Thanks..

AL, K0VM
Photo of William Hemmingsen

William Hemmingsen

  • 573 Posts
  • 278 Reply Likes
As long as it works :)
Photo of William Hemmingsen

William Hemmingsen

  • 573 Posts
  • 278 Reply Likes
Made some good progress on the PL1 today.  So far here is what is working thus far.

2 slice tune
Step 1/10/50 + x10
tx select
ATU
main vol
slice vol
hp vol
panadapter zoom +-
mic level
PTT

All these function have associated leds working.  All encoder levels (vol, mic, bandwidth, etc) receive current value from radio , so adjustments are from correct starting point. 

Lots more to do, but all the hard hurdles are over.

I came up with a new VFO tuning routine to do snap tuning, its pretty slick.  snap tuning to 50/500 was a bit of work..  And float math is faulty.  So all values are converted to integers before math is applied, then converted back to floats.

All will come with time. I will add a couple of functions each day, and should have a alpha release in a week  I don to want to release anything till 90% functions are working.

William
(Edited)
Photo of William Hemmingsen

William Hemmingsen

  • 573 Posts
  • 278 Reply Likes
Made some more progress on the PL1 today.  The following additional functions are working:

CWX 1-4
balance/wpm
agct/proc
xit/rit

Much more to go!

2 more dials and a bunch of buttons.  But the dual function dials are the hardest.  So I would say about half way.

William
(Edited)
Photo of William Hemmingsen

William Hemmingsen

  • 573 Posts
  • 278 Reply Likes
good idea
Photo of William Hemmingsen

William Hemmingsen

  • 573 Posts
  • 278 Reply Likes
Ken did you see my new parsing code?  Its much better in the PL-1 code.  I posted a link a few days back
Photo of Ken - NM9P

Ken - NM9P, Elmer

  • 4083 Posts
  • 1276 Reply Likes
Haven't had much time to look yet.
Is that the code near the top of the program to decypher the frequency, mode, etc.?
Photo of William Hemmingsen

William Hemmingsen

  • 573 Posts
  • 278 Reply Likes
if you are looking at the flex_parse.pde than yes.  The first parts under void draw.

William
Photo of William Hemmingsen

William Hemmingsen

  • 573 Posts
  • 278 Reply Likes
The new code for the PL1 is now almost 1000 lines and most of it from scratch.
Photo of William Hemmingsen

William Hemmingsen

  • 573 Posts
  • 278 Reply Likes
All for the PL-1 do you think we need selection for canned filter sizes if we have filter hi and lo dials? 

Personally I do not see the need, but let me know what you think.

William
Photo of William Hemmingsen

William Hemmingsen

  • 573 Posts
  • 278 Reply Likes
Yes its a monster.  Its HUGE.  I am very very close to a release Added NB,NR,VOX,  the filter addition will be the next challenge.  I will have a preview in a couple days I'm sure.  I'm very close.  Its just taking a bit of time, as I want the dials to give LED feedback. 
Photo of Doug Hall

Doug Hall

  • 206 Posts
  • 58 Reply Likes
William,
You haven't, by chance, taken the PL-1 apart have you? I'm curious as to whether there is room inside to mount a Raspberry Pi. Given that the Pi can run the Processing environment, supports midi devices, and works well with a WiFi dongle it might be possible to make a completely wireless controller. Power up, let it discover and connect to the radio, and you're up and running. No software on the PC at all. Whatever configuration changes are necessary could be done via a simple web interface. I'm curious enough to try it if the RasPi will fit in the box.
73,
Doug K4DSP
 
Photo of William Hemmingsen

William Hemmingsen

  • 573 Posts
  • 278 Reply Likes
Yes I have taken it apart, and its fairly tight.  I doubt you could fit a Pi in there.

William
Photo of Ken - NM9P

Ken - NM9P, Elmer

  • 4083 Posts
  • 1276 Reply Likes
As a second resort, you might build a small box and mount it alongside the MIDI controller using the docking strip.
Photo of William Hemmingsen

William Hemmingsen

  • 573 Posts
  • 278 Reply Likes
speaking of taking apart.  A dab of white lithium grease works wonders on the jog wheels.  Just pull the c clip holding the jog wheels in place, pull the wheel out, re-grease, and reinstall the c clip.  Its a 2 5 min job!

Just don't loose the c clip :)


William
(Edited)
Photo of MH_Flexer

MH_Flexer

  • 65 Posts
  • 13 Reply Likes

Having some issues with Dropbox.  Can't seem to connect and create a file link.  I have updated the CD Micro Version History but will have to try and post a link tomorrow.

Duane

Photo of William Hemmingsen

William Hemmingsen

  • 573 Posts
  • 278 Reply Likes
Ken,

I played around with the jog speed sensor again, and was able to come up with a solution that x10 when turned fast.  So this is really a viable solution.  Just need to tweak it a bit more for stability.  Here is whats working ok for me:

  //VFOA Frequency Control
  if ((channel == 0) && (number == 31) && (value > 64)) {
    if ((stepcount == 1) && (value > 72)) {Fstep=10;}
    if ((stepcount == 1) && (value < 72)) {Fstep=1;}
    if ((stepcount == 2) && (value > 72)) {Fstep=100;}
    if ((stepcount == 2) && (value < 72)) {Fstep=10;}
    if ((stepcount == 3) && (value > 72)) {Fstep=500;}
    if ((stepcount == 3) && (value < 72)) {Fstep=50;}
    if ((!slowdown) || (slow >=10)) {
      if (Fstep != 1) { //if step = 1, no snap tune/ else snap tune
      int freq = round(FreqA * 1000000);
       freq = Fstep*round(freq/Fstep);
       freq = freq + Fstep;
       FreqA = (float) freq/1000000;} else {
        FreqA = FreqA+0.000001;}
        CommaFix = nf(FreqA, 1, 6);
        CommaFix = CommaFix.replaceAll(",", "."); //Fix for German computers
        c.write("C44|slice tune 0 "+CommaFix+"\r\n"); slow=0;
    }else {slow++;}
  }

  if ((channel == 0) && (number == 31) && (value < 64)) {
    if ((stepcount == 1) && (value < 56)) {Fstep=10;}
    if ((stepcount == 1) && (value > 56)) {Fstep=1;}
    if ((stepcount == 2) && (value < 56)) {Fstep=100;}
    if ((stepcount == 2) && (value > 56)) {Fstep=10;}
    if ((stepcount == 3) && (value < 56)) {Fstep=500;}
    if ((stepcount == 3) && (value > 56)) {Fstep=50;}
    if ((!slowdown) || (slow >=10)) {
      if (Fstep != 1) { //if step = 1, no snap tune/ else snap tune
      int freq = round(FreqA * 1000000);
       freq = Fstep*round(freq/Fstep);
       freq = freq - Fstep;
       FreqA = (float) freq/1000000;} else {
        FreqA = FreqA-0.000001;} 
        CommaFix = nf(FreqA, 1, 6);
        CommaFix = CommaFix.replaceAll(",", "."); //Fix for German computers
        c.write("C44|slice tune 0 "+CommaFix+"\r\n"); slow=0;
    }else {slow++;}
  }

The Micro has this ability also

William
Photo of William Hemmingsen

William Hemmingsen

  • 573 Posts
  • 278 Reply Likes
All,

I have finished coding the PL1, of course it needs tweaks but I'm ready to release a preview.  All functions listed on the app window work.  I'm not even sure anyone other than Ken has one.  But anyway here is the layout.  App is uploading now, will post a link shortly.


Photo of William Hemmingsen

William Hemmingsen

  • 573 Posts
  • 278 Reply Likes
Here is the code for the CMD PL1.  This has a completely redesigned VFO frequency tuning section.  I was getting bad math due to floating point errors.  This caused inconsistent frequency increments.  This is an issue with the CMD Micro also, but nobody has complained yet.  Anyway here it is.

https://www.dropbox.com/s/1drmmpq68uecnup/CMDPL1Flex6k_v0_2.zip?dl=0
Photo of Ken - NM9P

Ken - NM9P, Elmer

  • 4083 Posts
  • 1276 Reply Likes
William,
I have been playing with it for about an hour, and looking at the code at the same time.

Really nice job!

Good use of boolean functions for switches, toggles, and multi-functions.
Good use of count-ups for things like filter and band switches.

I like the automatic quick-tune and nudge functions.  I may add a 5/50 option to mine to round out the possibilities.

I Really like the Pan Zoom control.

The only problems I am having so far are:

1) the Slice B tuning control makes Slice A jump to the B frequency, then it tunes Slice A, not B.  Strange, and probably a simple logic fix.
I have not had time to trace it down.  I need to look a little deeper to see what you are doing there.

2) The band- does not wrap around from 160 to 6 meters.  It goes the other way just fine. You probably have one number too large on the indexing counter test.

When I have more time, I plan to reprogram some of the controls for other functions.
I might try to make the slider the pan-zoom, and use a couple of knobs for separate volume and balance of the A & B slices.  I will probably sacrifice the MIC Gain control.  Once I set my various TX profiles, I never change it.  Probably the same for PROC.  

I will need to add another option to the RX ANT selection and preamp routines, because the 6500 has more options.  I need to ad RXA to the RX antenna selections so I can select my receiving loop.

I notice that it is going to be really easy to customize the filter selections for the different modes.  Just change a few numbers!
 
You have done yourself proud, William.  You have dug out the most difficult parts of the access code and made it possible for others to modify not only other CMD controllers, but other Hercules controllers as well.  Thanks for your hard work!

I have a busy week ahead so I won't be able to do a lot of programming this week.
I may play with a few simple options and see how well I do, then hit it next week on my day off.  I won't have a day off this week.

BTW... Do you know how easy it would be to do a serial interface using CAT commands to the 1500/3000/5000 models or other rigs?  I am sure there would be a lot of interest in that!

Again, Very Nice Job.  (I thought you were only going to add a couple of functions each day?  <grin>)

Ken - NM9P
Photo of William Hemmingsen

William Hemmingsen

  • 573 Posts
  • 278 Reply Likes
Ken Both of those issues were simple fixes.  The Freq section for B just had a typo.  And the band wrap around was just as you said, A misplaced value.  All is working now. 

It was a piece of work for sure.  Tear into it and make it your own.  I have no intention of supporting the PL1 past the basic first go.  I will however fix anything that is broken in this initial release.

I think it has all the basic building blocks for anyone to sit down with processing and figure out how to mod it.   I have not coded in 25 years, and never in processing.  So I think anyone with a bit of time can figure it out from here.

Serial commands are very easy.  My first Hercules control used cat, see the first post in this thread.  PSDR has very extensive CAT commands, unlike smartsdr with just the bare minimum.  With PSDR you can control almost every function via cat.  So I see no reason you could not make a controller for those rigs.  Also the ANAN comes to mind.

But I'm about burnt on this project..LOL  I want to do a few new releases of the CMD micro.  I would like to change it as follows;

1.  Update Freq tuning to fix floating point errors
2.  Add more functions with a "shift" key
3.  Add a toggle for canned TX filters
4.  Get rid of the oncreen toggles

William
Photo of Jeffrey Kerber, N3VE

Jeffrey Kerber, N3VE

  • 127 Posts
  • 20 Reply Likes

Just accidently hit the right arrow key on my keyboard and every click changed a few things in SSDR.  The RF power, mic profile, tx band width and others.  Does this happen to you?  I am using the cmd micro 1.9e  Any comments?  I closed the program and unplugged the usb and the right arrow makes no changes. 

Jeff N3VE

Photo of William Hemmingsen

William Hemmingsen

  • 573 Posts
  • 278 Reply Likes
Jeffrey,

Wow I just developed keyboard shortcuts.  Kidding.  I have no idea.  I will load up 1.9e and see if I can reproduce it.

William
Photo of William Hemmingsen

William Hemmingsen

  • 573 Posts
  • 278 Reply Likes
Jeffery,

I tried everything I could think of and could not reproduce this issue.  The program itself does not read any key presses, so not sure whats going on there.  But I would be interested if others could try reproducing this issue.

William
Photo of Jeffrey Kerber, N3VE

Jeffrey Kerber, N3VE

  • 127 Posts
  • 20 Reply Likes

William, I will try to reproduce this tonight.  It was very strange as a lot of setting changed.  Don't know if this has anything to do with what I had clicked on last in SSDR.  I did not think your program had anything to do with it, but when I shut it down, nothing happened when I pressed the arrow keys.  It was very strange.  Is 9e the latest version?

Jeff

Photo of Bob - W7KWS -

Bob - W7KWS -

  • 301 Posts
  • 48 Reply Likes
Right & left arrows are tuning frequency up & down here.  No time to understand this until tonight but my first thought is that SmartSDR has some keyboard shortcut commands.
Photo of William Hemmingsen

William Hemmingsen

  • 573 Posts
  • 278 Reply Likes
The arrow keys do not do anything for me.  But interested
Photo of William Hemmingsen

William Hemmingsen

  • 573 Posts
  • 278 Reply Likes
All here is a new alpha (possibly buggy) version for the CMD Micro.  This version has the following new features.

1.  Improved Frequency control - no more floating point errors (1+1 no longer = 3 LOL)
2.  New steps 1 -amber/10-blue/50- flashing
3.  Jog wheels x5 step when spun fast, for quick movements
4.  Vox key replaced with "Shift" button.  If shift is lit, the functions listed above the button/dial are available.  This opens up the possibility for more future functions.

Give it a test and report back!  Much more work to clean this up and add new features.  But before continuing, I would like this tested thoroughly.

https://www.dropbox.com/s/ln4hq84g663808c/CMDMicroFlex6k_v2_0.zip?dl=0



William
(Edited)
Photo of Alex - DH2ID

Alex - DH2ID, Elmer

  • 957 Posts
  • 179 Reply Likes
William, I like Nrs. 1-4, the program seems to work. Will test it later.
Because I use ONLY external tuners for all my TRX, I would like
TUNE to stay fixed. Now I need two key clicks, shift and tune.
Thank you for your improvements!

BTW can you tell me the approximate size of the PL-1 compared to the
CMD micro? I have to fit it to my (small) shack ;-)

73, Alex DH2ID
(Edited)
Photo of William Hemmingsen

William Hemmingsen

  • 573 Posts
  • 278 Reply Likes
Alex,  I can make a custom version for you to swap them.  Or I can teach you how.  If you like the newest version, let me know and I will compile you a version with "tune" hard coded.

The PL1 is huge - I would say ~ 12" x 6"
(Edited)
Photo of Alex - DH2ID

Alex - DH2ID, Elmer

  • 957 Posts
  • 179 Reply Likes
YES yes yes, hard coded sounds good to me :-) But only if it's not too much extra work for you, you do enough for us!
Ok, the PL-1 is not for me, then, too big.... 
Photo of Bob W7KWS

Bob W7KWS

  • 25 Posts
  • 4 Reply Likes
Quick test before lunch.  More when I get back this afternoon.

I swapped A & B knobs and that works great.

I can't tell if the touch sensitivity is playing a part or not but the gear shift in 2.0d seems flawless after a 1 minute of testing.  More later.  Thanks again.

Bob
Photo of William Hemmingsen

William Hemmingsen

  • 573 Posts
  • 278 Reply Likes
Photo of William Hemmingsen

William Hemmingsen

  • 573 Posts
  • 278 Reply Likes