FOC-Stim: a new approach to DIY stim hardware.
Re: FOC-Stim: a new approach to DIY stim hardware.
The relevant value in the datasheet for our use case is the DC resistance, not impedance. For the primary this is 12 ohm, and for the secondary 0.5 ohm (only half the windings are used in this device, so 0.25 ohm in practice).
It isn't clear to me what you mean by K, why assuming 4 ohms makes any sense, or what you are referring to with "the 400 ohm version".
The load the device will see is inductor resistance + secondary resistance + (primary resistance + skin resistance) / winding ratio squared. Skin resistance varies between 50 and 1000ohm.
It isn't clear to me what you mean by K, why assuming 4 ohms makes any sense, or what you are referring to with "the 400 ohm version".
The load the device will see is inductor resistance + secondary resistance + (primary resistance + skin resistance) / winding ratio squared. Skin resistance varies between 50 and 1000ohm.
-
dr_bearcat
- Explorer

- Posts: 6
- Joined: Sat Jan 25, 2025 8:36 pm
Re: FOC-Stim: a new approach to DIY stim hardware.
I cant find winding ratio in datashit. Where did you find it?diglet wrote: Sun Jan 26, 2025 6:29 pm The relevant value in the datasheet for our use case is the DC resistance, not impedance. For the primary this is 12 ohm, and for the secondary 0.5 ohm (only half the windings are used in this device, so 0.25 ohm in practice).
It isn't clear to me what you mean by K, why assuming 4 ohms makes any sense, or what you are referring to with "the 400 ohm version".
The load the device will see is inductor resistance + secondary resistance + (primary resistance + skin resistance) / winding ratio squared. Skin resistance varies between 50 and 1000ohm.
Different windings can be made with different wire diameters (so have different resistance) and cannot be an indication of the transformation ratio (K).
Only by knowing the winding ratio we can know exactly the transformer ratio, but I can't find it.
By 12/0.5 ratio we get K = 25 isnt it too much ?
what you are referring to with "the 400 ohm version". - 42TU400-RC
Re: FOC-Stim: a new approach to DIY stim hardware.
The winding ratio is the square root of the impedance ratio, 5 for the 42TU200-RC, 10 in our particular configuration.
There is nothing about the 42TU400 that is 400 ohm. If you use the 42TU400 you will have slightly higher winding ratio, slightly higher output power, and slightly higher maximum shock in case of equipment failure. It is not worth changing the default transformer imo.
There is nothing about the 42TU400 that is 400 ohm. If you use the 42TU400 you will have slightly higher winding ratio, slightly higher output power, and slightly higher maximum shock in case of equipment failure. It is not worth changing the default transformer imo.
Last edited by diglet on Wed Jan 29, 2025 8:56 pm, edited 1 time in total.
- digitalparkinglot
- Explorer At Heart

- Posts: 475
- Joined: Thu Mar 09, 2017 7:20 pm
Re: FOC-Stim: a new approach to DIY stim hardware.
Hey Group,
I am attempting to build a FOC-Stim device. I have all the components to build it but I have not assembled it yet. I thought I would go ahead and get the B-G431B-ESC1 Discovery kit set up first before assembling everything. I plugged a USB cable into the B-G431B-ESC1 Discovery kit and I get two green lights and a flashing red light. I then opened up STM32CubeProgrammer to update the firmware. When I try clicking the "connect" button it gives me "Error: No debug probe detected." Is this happening because I need to assemble all the parts first...including running power to it?
I'm good at connecting parts together. I can sort of read a schematic. I don't really understand what the various electronic parts do or why they are used. I know absolutely nothing about coding. I would be very grateful for any help you all can give me.
Thanks!
-digitalparkinglot
I am attempting to build a FOC-Stim device. I have all the components to build it but I have not assembled it yet. I thought I would go ahead and get the B-G431B-ESC1 Discovery kit set up first before assembling everything. I plugged a USB cable into the B-G431B-ESC1 Discovery kit and I get two green lights and a flashing red light. I then opened up STM32CubeProgrammer to update the firmware. When I try clicking the "connect" button it gives me "Error: No debug probe detected." Is this happening because I need to assemble all the parts first...including running power to it?
I'm good at connecting parts together. I can sort of read a schematic. I don't really understand what the various electronic parts do or why they are used. I know absolutely nothing about coding. I would be very grateful for any help you all can give me.
Thanks!
-digitalparkinglot
Please enjoy my other creations:
- Spoiler: show
Re: FOC-Stim: a new approach to DIY stim hardware.
You should be able to update the firmware without anything else connected to the board, only the USB port.
To update the firmware you need to click the blue 'update firmware' button, located at the right edge of the screen.
- digitalparkinglot
- Explorer At Heart

- Posts: 475
- Joined: Thu Mar 09, 2017 7:20 pm
Re: FOC-Stim: a new approach to DIY stim hardware.
Thanks for responding Diglet.diglet wrote: Wed Jan 29, 2025 8:59 pmYou should be able to update the firmware without anything else connected to the board, only the USB port.
To update the firmware you need to click the blue 'update firmware' button, located at the right edge of the screen.
When I click the 'firmware upgrade' button this new window opens and everything is grayed out. If I hit the refresh device list it still is empty and everything is grayed out.
Please enjoy my other creations:
- Spoiler: show
Re: FOC-Stim: a new approach to DIY stim hardware.
That's odd, on my machine it shows the device in that list.
Can you install this driver? I don't remember doing it on my machine, but maybe it helps...
https://www.st.com/en/development-tools ... nk009.html
Can you install this driver? I don't remember doing it on my machine, but maybe it helps...
https://www.st.com/en/development-tools ... nk009.html
Re: FOC-Stim: a new approach to DIY stim hardware.
The device that this firmware upgrader talks to is using this driver

My boards had old firmware that was reconnecting and I tried replacing this driver with generic one, but it did not help, since problem is not in the board itself, but that development daughterboard that does com-port-to-usb. That one is composite device with this virtual com port and a usb flash drive. This driver "virtual com port" is required for flasher to work (and it seems to be standard microsoft driver)

My boards had old firmware that was reconnecting and I tried replacing this driver with generic one, but it did not help, since problem is not in the board itself, but that development daughterboard that does com-port-to-usb. That one is composite device with this virtual com port and a usb flash drive. This driver "virtual com port" is required for flasher to work (and it seems to be standard microsoft driver)
My estim creations: https://mega.nz/folder/73pxmBBQ#X6ylDzRafzTt9wanZ0dacw
And in E-Stim Index: viewtopic.php?t=27090
Try creating your own estims with my restim script generator!
And in E-Stim Index: viewtopic.php?t=27090
Try creating your own estims with my restim script generator!
- Spoiler: show
- BlackHatAnon
- Explorer

- Posts: 6
- Joined: Mon Apr 24, 2023 6:08 pm
- Gender: Male
- Sexual Orientation: Straight
- I am a: Switch
Re: FOC-Stim: a new approach to DIY stim hardware.
+2 for the Link009 driver. I installed this prior to flashing my boards. Should solve your issue DPL (fingers crossed)
- digitalparkinglot
- Explorer At Heart

- Posts: 475
- Joined: Thu Mar 09, 2017 7:20 pm
Re: FOC-Stim: a new approach to DIY stim hardware.
Still no luck. I installed the link009. I've tried on two machine and both give me the same grayed out buttons. I did an "install legacy hardware" and found STMicroelectronics STLink Virtual COM Port and installed that. This is what I get in the Device Manager...it says "This device cannot start. (Code10)". Even with this everything is still grayed out. I REALLY appreciate your help. Any other ideas?
Please enjoy my other creations:
- Spoiler: show
-
emiumfinal
- Explorer

- Posts: 33
- Joined: Sun Jun 24, 2018 3:16 pm
Re: FOC-Stim: a new approach to DIY stim hardware.
Ok, did some more playing around and edited this for my new issue. I can get restim to connect to the board successfully on COM3, but I can't also get teleplot to show anything. If I try to connect teleplot with restim already connected I get an access denied error and vice versa (I assume because they are taking exclusive control of the port). Should I be able to connect them both to the serial port, or is teleplot getting data from restim via UDP? I have the UDP ports set up the same, but nothing seems to be working. Do I need something in the teleplot prefix field in preferences?
I'm also getting a constant error - V_BUS too low or something similar - I'm assuming that is because I haven't finished assembling the board and hooking up 12V power? Right now I am just running it with the USB connection powering the board. Just don't want to build out the board if there is some other issue I need to sort out first.
I'm also getting a constant error - V_BUS too low or something similar - I'm assuming that is because I haven't finished assembling the board and hooking up 12V power? Right now I am just running it with the USB connection powering the board. Just don't want to build out the board if there is some other issue I need to sort out first.
Last edited by emiumfinal on Thu Jan 30, 2025 2:40 am, edited 1 time in total.
- digitalparkinglot
- Explorer At Heart

- Posts: 475
- Joined: Thu Mar 09, 2017 7:20 pm
Re: FOC-Stim: a new approach to DIY stim hardware.
After quite a bit of searching I think what my problem may be is that my micro USB cables may only be for charging and not for data. I didn't know there was such a thing as a charging only micro USB cables. I just ordered a couple cables that support data that should be here Friday. Hopefully that fixes my problem...fingers crossed.
-digitalparkinglot
-digitalparkinglot
Last edited by digitalparkinglot on Thu Jan 30, 2025 1:22 pm, edited 1 time in total.
Please enjoy my other creations:
- Spoiler: show
-
Bouncyboingboing
- Explorer

- Posts: 9
- Joined: Tue Mar 08, 2022 1:14 am
- Gender: Male
- Sexual Orientation: Open to new ideas!
Re: FOC-Stim: a new approach to DIY stim hardware.
I was just about to say that I'm having the same issue as DPL. Then saw your post above about the cables.
Tried a different cable (came with a UEBoom I think) and the board connected immediately. So hopefully a new cable is all that's required for you DPL.
Tried a different cable (came with a UEBoom I think) and the board connected immediately. So hopefully a new cable is all that's required for you DPL.
-
Bouncyboingboing
- Explorer

- Posts: 9
- Joined: Tue Mar 08, 2022 1:14 am
- Gender: Male
- Sexual Orientation: Open to new ideas!
Re: FOC-Stim: a new approach to DIY stim hardware.
However.
I'm totally lost on what to do now. I thought I might be able to figure it out intuitively but I'm sorry I'll need some more ELI5 instructions if anyone can provide them? The software STM32Cube programmer looks nothing like the screen shot on diglet's github.
Many thanks
I'm totally lost on what to do now. I thought I might be able to figure it out intuitively but I'm sorry I'll need some more ELI5 instructions if anyone can provide them? The software STM32Cube programmer looks nothing like the screen shot on diglet's github.
Many thanks
-
emiumfinal
- Explorer

- Posts: 33
- Joined: Sun Jun 24, 2018 3:16 pm
Re: FOC-Stim: a new approach to DIY stim hardware.
The screenshot is the Visual Studio software, not the STM one. The STM one is used to upgrade the firmware (there are some posts earlier that have screenshots of that). You use the Visual Studio program with the platformio plugin to load the FOC-Stim platform.io file and upload it to the device. That is what the screenshot shows.Bouncyboingboing wrote: Thu Jan 30, 2025 3:38 am However.
I'm totally lost on what to do now. I thought I might be able to figure it out intuitively but I'm sorry I'll need some more ELI5 instructions if anyone can provide them? The software STM32Cube programmer looks nothing like the screen shot on diglet's github.
Many thanks

