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

- Posts: 7
- Joined: Sun Dec 19, 2021 10:20 pm
Re: FOC-Stim: a new approach to DIY stim hardware.
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
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

- Posts: 64
- Joined: Wed Jan 13, 2016 10:00 am
- Gender: Male
Re: FOC-Stim: a new approach to DIY stim hardware.
Heyaa
I'm about to pull the trigger
About the on/off switch... there's like thousand variations. Should it be a 250vac switch? Or what 
I'm about to pull the trigger
Re: FOC-Stim: a new approach to DIY stim hardware.
A 12V, 0.5A switch is sufficient.
-
andreas261
- Explorer

- Posts: 64
- Joined: Wed Jan 13, 2016 10:00 am
- Gender: Male
Re: FOC-Stim: a new approach to DIY stim hardware.
Thank you. And thanks for doing all this 
- 19Hellothere83
- 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.
I just finished mine, now i need to test it.
But I still have no idea how restim works
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 ...
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 ...
- 19Hellothere83
- 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.
found the restim wiki
so forget my last post - sorry for the spam
- 19Hellothere83
- 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.
Instead of the switch I installed an emergency button
. I will have time to test it in 10 days!
- Attachments
-
- IMG_6208-compressed.jpeg (852.94 KiB) Viewed 6255 times
- 19Hellothere83
- 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.
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
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
Re: FOC-Stim: a new approach to DIY stim hardware.
The wording of the menu options in Restim has changed. The preferences menu is now located under setup.

In the preferences screen, select the FOC-Stim tab and then your serial port in the dropdown.
Re: FOC-Stim: a new approach to DIY stim hardware.
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
. 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 tried the following:
I finally built my own box
- 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- 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)
Re: FOC-Stim: a new approach to DIY stim hardware.
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.
Re: FOC-Stim: a new approach to DIY stim hardware.
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.
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.
Re: FOC-Stim: a new approach to DIY stim hardware.
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:
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.
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);
}
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.
Re: FOC-Stim: a new approach to DIY stim hardware.
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!
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!
Re: FOC-Stim: a new approach to DIY stim hardware.
Hi edger,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)
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

