FOC-Stim: a new approach to DIY stim hardware.

This is the place for all suggestions, releases and feedback regarding Milovana Hardware efforts.
HerBoneRanger
Explorer
Explorer
Posts: 7
Joined: Sun Dec 19, 2021 10:20 pm

Re: FOC-Stim: a new approach to DIY stim hardware.

Post by HerBoneRanger »

Dear Diglet,

I've clicked on the link above to the github workflow and then clicked the "build" with a tick. I think it's done something.

At the very least, when I open Restim in FOC mode, refreshed the port in the Restim preferences and then hit the "Start" button, the restim log window did stuff that looks like it connected to the board and it is showing "VBUS to Low: 4.83 Turn ON the power". As I've not yet added the 12v power supply to the board, this seems about right. I'm still yet to build the rest.

I've even got graphs on the teleplot thing when I opened VS-Code!

Thank you, this monkey is one step closer to Banana Nirvana!!
HBR
To Do: Come up with a witty signature.
andreas261
Explorer
Explorer
Posts: 64
Joined: Wed Jan 13, 2016 10:00 am
Gender: Male

Re: FOC-Stim: a new approach to DIY stim hardware.

Post by andreas261 »

Heyaa
I'm about to pull the trigger :-D About the on/off switch... there's like thousand variations. Should it be a 250vac switch? Or what :lol:
diglet
Explorer At Heart
Explorer At Heart
Posts: 390
Joined: Sun Dec 11, 2022 5:43 pm

Re: FOC-Stim: a new approach to DIY stim hardware.

Post by diglet »

A 12V, 0.5A switch is sufficient.
andreas261
Explorer
Explorer
Posts: 64
Joined: Wed Jan 13, 2016 10:00 am
Gender: Male

Re: FOC-Stim: a new approach to DIY stim hardware.

Post by andreas261 »

Thank you. And thanks for doing all this :love:
User avatar
19Hellothere83
Explorer At Heart
Explorer At Heart
Posts: 228
Joined: Wed Feb 10, 2021 7:10 am
Sexual Orientation: Open to new ideas!
I am a: Submissive

Re: FOC-Stim: a new approach to DIY stim hardware.

Post by 19Hellothere83 »

I just finished mine, now i need to test it.
IMG_6188.JPG
IMG_6188.JPG (373.68 KiB) Viewed 6405 times
IMG_6186.JPG
IMG_6186.JPG (218.18 KiB) Viewed 6405 times
But I still have no idea how restim works :innocent:
Any chance there is a good tutorial or a forum thread which explains it thoroughly?
Search gives loads of results but cant find anything like a tutorial or explanation ...
User avatar
19Hellothere83
Explorer At Heart
Explorer At Heart
Posts: 228
Joined: Wed Feb 10, 2021 7:10 am
Sexual Orientation: Open to new ideas!
I am a: Submissive

Re: FOC-Stim: a new approach to DIY stim hardware.

Post by 19Hellothere83 »

found the restim wiki :-) so forget my last post - sorry for the spam
User avatar
19Hellothere83
Explorer At Heart
Explorer At Heart
Posts: 228
Joined: Wed Feb 10, 2021 7:10 am
Sexual Orientation: Open to new ideas!
I am a: Submissive

Re: FOC-Stim: a new approach to DIY stim hardware.

Post by 19Hellothere83 »

Instead of the switch I installed an emergency button 😂. I will have time to test it in 10 days!
Attachments
IMG_6208-compressed.jpeg
IMG_6208-compressed.jpeg (852.94 KiB) Viewed 6273 times
User avatar
19Hellothere83
Explorer At Heart
Explorer At Heart
Posts: 228
Joined: Wed Feb 10, 2021 7:10 am
Sexual Orientation: Open to new ideas!
I am a: Submissive

Re: FOC-Stim: a new approach to DIY stim hardware.

Post by 19Hellothere83 »

I tried to connect the box to restim.
However I can't get it to work.
The wiki seems to have screenshots that are either older or newer to the actual restim release, however it is different:
Just one example,: under tools I have no preferences and therefore cannot choose an audio device.
Probably Im just to stupid, but with the restim wiki I cant get the FOC unit to work.
Is there any chance someone could help me :-(
diglet
Explorer At Heart
Explorer At Heart
Posts: 390
Joined: Sun Dec 11, 2022 5:43 pm

Re: FOC-Stim: a new approach to DIY stim hardware.

Post by diglet »

19Hellothere83 wrote: Wed Sep 10, 2025 3:42 pm
The wording of the menu options in Restim has changed. The preferences menu is now located under setup.

Image

In the preferences screen, select the FOC-Stim tab and then your serial port in the dropdown.
Spark86
Explorer
Explorer
Posts: 9
Joined: Mon Jul 22, 2019 5:17 pm

Re: FOC-Stim: a new approach to DIY stim hardware.

Post by Spark86 »

Let me start with saying a huge thank you to you, diglet, for your amazing dedication, creativity, hard work and kindness! And for your generosity in sharing your ideas and work with the community.

I finally built my own box :w00t: . It was quite a challenge given my limited soldering, electronics and programming skills but I think I did well enough and am eager to try it. Sadly, I cannot make it work with Restim.
  • I think I succeeded in (i) updating the firmware with STM32CubeProgrammer and then (ii) building and uploading the FOCstim code with Visual Studio / Platformio following the instructions.
  • In Restim, I can select my box as FOC device.
  • But when I press “Start” nothing happens, the terminal output says:

Code: Select all

Connecting to FOC-Stim at COM3
connection established
get firmware version...
timeout requesting firmware version
closing connection to FOC-Stim
I tried the following:
  • Checked Windows Device Manager (Box is shown under ports / COM3 with no issues)
  • Checked / updated the driver
  • Tried different USB cables (but since I used the same cable for successfully updating the firmware I don’t think it is a cable issue; also, the device is shown in Windows Explorer)
The only remaining thing I can think of now is that maybe the board is not working properly (I might have even damaged it a little when struggling with soldering the wires to it). Does anyone have another idea?
diglet
Explorer At Heart
Explorer At Heart
Posts: 390
Joined: Sun Dec 11, 2022 5:43 pm

Re: FOC-Stim: a new approach to DIY stim hardware.

Post by diglet »

Spark86 wrote: Tue Oct 07, 2025 10:52 pm
Have you tried selecting a different serial port in preferences? It's under the FOC-Stim tab.

Do you get different results if you do not connect 12v to the board?

If you click 'upload and monitor' in VS Code, do you see any interesting messages when the board starts? If you see some garbage appear in the console every few seconds, the software is running properly.
Spark86
Explorer
Explorer
Posts: 9
Joined: Mon Jul 22, 2019 5:17 pm

Re: FOC-Stim: a new approach to DIY stim hardware.

Post by Spark86 »

Thanks for your swift reply!

Yes, I had already tried to change COM ports. I just switched again (assigned COM13 in device manager and chose the same in Restim settings / FOC) without success.

No, the result without 12v power connected is the same. When I first tried the box I got a different message, something telling me that there was insufficient power, because the solder of one of the wires from the socket to the board broke. After I fixed the soldering that message was gone.

I just tried "Upload and monitor" but after the programming output I get no further output.
diglet
Explorer At Heart
Explorer At Heart
Posts: 390
Joined: Sun Dec 11, 2022 5:43 pm

Re: FOC-Stim: a new approach to DIY stim hardware.

Post by diglet »

Can you go into src/main_focstim_v1.cpp, find the setup() function around line 101 and copy-paste this code right at the start of the function:

Code: Select all

    Serial.begin(115200);
    pinMode(LED_BUILTIN, OUTPUT);
    while (1) {
        Serial.printf("hello\r\n");
        digitalWrite(LED_BUILTIN, 1);
        delay(200);
        digitalWrite(LED_BUILTIN, 0);
        delay(200);
    }
Then do upload and monitor again.

If you don't see any output and the small LED next to the +12v pad is not blinking, you can be pretty confident the board is super dead.

If this does work, remove the code again and change the delay(100) in setup() at 104 to delay(1000). Then maybe the software prints an useful error message when it's initializing the hardware.
Spark86
Explorer
Explorer
Posts: 9
Joined: Mon Jul 22, 2019 5:17 pm

Re: FOC-Stim: a new approach to DIY stim hardware.

Post by Spark86 »

It was the board ... I got a replacement today and after the checking procedure you suggested (thanks!) produced strange results (blinking LED but nothing in the console) I replaced the old board. Now the connection is working, yey!

I still seem to have messed up the soldering again as I get the "V_BUS under-voltage detected (V_BUS = 4.95). Stopping pulse generation." and "V_BUS too low: 4.94. Turn ON the power." messages that others only got when they had not yet connected the 12v. I guess I need to work on my soldering skills. I have some free time on Sunday, hopefully I get it to work then.

Thanks for your help again!
nopr4me
Curious Newbie
Curious Newbie
Posts: 4
Joined: Tue Sep 10, 2024 10:49 am

Re: FOC-Stim: a new approach to DIY stim hardware.

Post by nopr4me »

edger477 wrote: Mon Dec 16, 2024 9:44 am There is bom of necessary components and 3d-printed case cad on my fork of repo: https://github.com/edger477/FOC-Stim/tree/master/case (rest of repo is identical, I only added this folder)
Hi edger,

A quick question about your breadboard: it looks as though you have connected together the number 3 input terminals of the transformers at F2, Q2, A2 compared to diglet's schematic where the number 2 terminals are connected. And your inputs come in on the number 2 terminals at F4, Q4 and A4. Is this correct?

Thanks
Post Reply