Popular Post Ampakinetic Posted December 30, 2019 Popular Post Share Posted December 30, 2019 Hi Guys, I've registered to post that I've got access to the STM32 FOC motor library source code and have bought all the parts I'll need to hopefully be able to recreate the key parts of the motor controller in my Gotway MSX. I'll initially be trying to power a cheap 1KW 48V wheel. I will head off in my own direction to see how far I get with the firmware and motor controller PCB design and if I get somewhere I'll post about it here and will be willing to share my Eagle files and the non-STM lib parts of the controller source. 7 Quote Link to comment Share on other sites More sharing options...
atdlzpae Posted March 23, 2020 Share Posted March 23, 2020 20 hours ago, MonsterV1 said: I'm in need. I recently burned my board in my monster v1. I'd like to keep it going since I've got around 10k miles on it. Will you let me know when I can buy something? Open-source? Don't hold your breath. Your best bet is a monster motherboard. Search around, there surely are tons of EUC people in SF Bay who can help you with repair. 1 Quote Link to comment Share on other sites More sharing options...
Inductores Posted March 25, 2020 Author Share Posted March 25, 2020 On 3/22/2020 at 6:17 AM, MonsterV1 said: I'm in need. I recently burned my board in my monster v1. I'd like to keep it going since I've got around 10k miles on it. Will you let me know when I can buy something? Still waiting for some FW developer... Quote Link to comment Share on other sites More sharing options...
pst Posted March 30, 2020 Share Posted March 30, 2020 Have we gotten to a point yet of understanding/documenting the problem enough to create a design? A FW developer won't be much good if the goals/physics/etc. of the design itself aren't clear. Quote Link to comment Share on other sites More sharing options...
pst Posted March 30, 2020 Share Posted March 30, 2020 (edited) On 3/22/2020 at 9:31 PM, atdlzpae said: Open-source? Don't hold your breath. Your best bet is a monster motherboard. Search around, there surely are tons of EUC people in SF Bay who can help you with repair. I totally agree. Honestly, even if an open-source one DOES become available, the best bet for "average people" would still be to get a factory replacement. An open source one would require lots of platform-specific tuning, testing, and then tuning... and some more testing... etc. Not to mention needing a reliable, working hardware platform to do it on! Edited March 30, 2020 by pst Quote Link to comment Share on other sites More sharing options...
tudordewolf Posted March 30, 2020 Share Posted March 30, 2020 (edited) 14 minutes ago, pst said: Have we gotten to a point yet of understanding/documenting the problem enough to create a design? A FW developer won't be much good if the goals/physics/etc. of the design itself aren't clear. Well, I feel like at its most basic you're reading the gyroscopic input and using PID on the motor to try and keep it "level" - but this produces a very "stiff" ride and would have all sorts of oscillation problems; so the software has to incorporate some amount of dampening both on the data coming from the gyroscope and the commands going to the motor, and perhaps clever use of the information coming back from the motor to determine what its "true" degree of tilt is. Further, it probably has to account for the "distortion" acceleration would produce in the gyroscope's reading... and all this is what makes different manufacturer's wheels ride differently. We should document the various behaviors and come up with a sort of long-form "equation" of the gyroscope's value, the wheel's RPM, and the change that will be sent to the motor controller. The simplest one would be something like, "for every degree of tilt away from zero, increase the desired rpms to 10 more than the current value", and have everything treated as a variable or its derivative / dampened value of itself. Like if you want tiltback, then you'd probably implement it by having a set speed where the "desired" angle of the pedals begins to shift, and also account for the fact that changing this mid-ride will require more power than maintaining the speed (that is, initiating tiltback requires the wheel to pull ahead of the user even more than they 'commanded' it to) You could have the wheel convey its speed / power usage by requiring the user to stay slightly 'forward' on the pedals to keep it going fast, or implement a sort of "cruise control" where you'd have to actively brake to slow it down, which is probably what creates the "gotway glide" effect. Edited March 30, 2020 by tudordewolf 1 Quote Link to comment Share on other sites More sharing options...
h3X Posted April 3, 2020 Share Posted April 3, 2020 (edited) I started working with the NodeMCU and I'm currently working on a self balancing small vehicle with VESC as a side project between school assignments. I've built a platform from my old electric longboard motor + wheels, and have the Node and MPU6050 on a breadboard. So far it connects to wifi and sends the sensor data to my computer, where I receive them with a python server and I'm planning on plotting the data there. I'm currently using Arduino libraries. I'll post up some code when I get to driving the motor and actually using sensor data to modify the motor output. Pictures:https://drive.google.com/open?id=1K-FvSROn1MtEFWmukpnywSJ94Zd-Cyiyhttps://drive.google.com/open?id=1JytaML7-txvs_S8z8JP2GOUi9eeH92fThttps://drive.google.com/open?id=1K7WUB4wYPiM3eHnVlebXUMDbmbCk3s5W The board is connected to a servomotor right now, but driving a brushless ESC should be possible using exactly the same code. What I'm missing now is cleaning up the code and implementing threading, connecting the actual motor, and writing a balancing algorithm. Edited April 3, 2020 by h3X Added some pictures 1 Quote Link to comment Share on other sites More sharing options...
h3X Posted April 9, 2020 Share Posted April 9, 2020 (edited) Here are this week's news from my end of things: After delivering my latest school assignment, I found all the necessary hardware to progress this project. This involved moving the components to a bigger breadboard to have enough space for a connector for the ESC, and stealing a servo cable off another project. I have connected the breadboard from the post above to the VESC and through that a brushless motor. It's all hooked up to a 6s battery and the NodeMCU is powered through the VESC BEC via the servo cable. On the software side I've done some research and figured out how to run the ESC: I need to generate a 200Hz (?) PWM signal with a pulse width of 1000 (minimum throttle) to 2000 (maximum throttle) microseconds. It may still work with the Servo.h library, but I have to go through the startup ESC calibration routine before it will run. (???) I have realized that I can use hardware interrupts to detect a state change on the IMU sensor to read that only when a new value is available, so I might not need multithreading to run things concurrently with precise timings after all. See you in the next update! Below: testing the pwm output Edited April 9, 2020 by h3X a sudden thought 1 Quote Link to comment Share on other sites More sharing options...
MonsterV1 Posted April 16, 2020 Share Posted April 16, 2020 I was wrong . My green white just pulled out of the PCB. Yea, I agree, different wheels would have different algorithms for speed pitch and yawl, so it would be incredibly difficult to open source so many variables with no room for error. I agree. I will just stick to the mfg parts. I thought it was a cool idea, but not practical IMHO. Quote Link to comment Share on other sites More sharing options...
h3X Posted April 30, 2020 Share Posted April 30, 2020 I bought a used/broken MCM2 for $10. All parts are there but someone has cut the wires... So now I have another 14" test platform! Quote Link to comment Share on other sites More sharing options...
Alj Posted May 24, 2020 Share Posted May 24, 2020 On 1/20/2019 at 7:41 AM, lizardmech said: I tried a few years ago, had plenty of prototype hardware running but I could never find anyone who could code in C that was willing to work on it. Why C? it is 21 century. Writing in rust-lang will result in less troubleshooting and better safety in general. 1 Quote Link to comment Share on other sites More sharing options...
atdlzpae Posted May 24, 2020 Share Posted May 24, 2020 (edited) @Alj Multiple reasons: 1. Finding a person who has experience with Rust on microcontrollers is almost impossible. 2. Even if you find one, finding a replacement is almost impossible (as a boss you don't want to be stuck with an employee you can never replace). 3. Toolchains and libraries for C are plenty, while for Rust are abysmal. So it's more work to get everything working. 4. Memory management in Rust is more of a hindrance than safety in an environment as tight as a microcontroller. At least for a programmer who knows what he's doing. 5. Things like FreeRTOS and HAL are already written in C. So Rust would need to provide really good advantages to convince someone to add yet another compiler and libraries into the mix. Also, consider the disadvantages of mixing two quite different languages and compilers at once (gcc for C&C++, llvm for Rust). A few years ago I've done an STM32 project. I've compiled a Hello World using Rust for it, but ultimately I've decided to go with C++. I'm glad I did, because we were looking half a year for a programmer to replace me. :-/ In Rust we'd have to look way longer. As for troubleshooting and safety... It doesn't matter as much for small projects like a unicycle firmware. You still need extensive testing, regardless of the language. Also, very often uC's are doing everything on global variables with a really simple state. There usually isn't much you can screw up memory-wise. Edited May 25, 2020 by atdlzpae 2 Quote Link to comment Share on other sites More sharing options...
Alj Posted May 26, 2020 Share Posted May 26, 2020 On 5/24/2020 at 5:59 AM, atdlzpae said: While I compltely agree with everything you said, here are some thoughts. On 5/24/2020 at 5:59 AM, atdlzpae said: @Alj Multiple reasons: 1. Finding a person who has experience with Rust on microcontrollers is almost impossible. For a good developer it does not really matter which language it is but Rust naturally attracts very good developers due to steep learning curve. On 5/24/2020 at 5:59 AM, atdlzpae said: 2. Even if you find one, finding a replacement is almost impossible (as a boss you don't want to be stuck with an employee you can never replace). That can be also said about Firefox project, yet they are successful with this decision. On 5/24/2020 at 5:59 AM, atdlzpae said: 3. Toolchains and libraries for C are plenty, while for Rust are abysmal. So it's more work to get everything working. SIngle standard tool set of rust also simplifies things. And for STM32 this problem is already solved. On 5/24/2020 at 5:59 AM, atdlzpae said: 4. Memory management in Rust is more of a hindrance than safety in an environment as tight as a microcontroller. At least for a programmer who knows what he's doing. It is also very hard to find programmer who knows what he's doing. And you will never find out which is it till its too late with C. Also i suspect hardware is not needed to be significantly constrained considering you have to do lots of calculations many times a second and you do not need to save much power because you got plenty of it.... On 5/24/2020 at 5:59 AM, atdlzpae said: 5. Things like FreeRTOS and HAL are already written in C. So Rust would need to provide really good advantages to convince someone to add yet another compiler and libraries into the mix. Also, consider the disadvantages of mixing two quite different languages and compilers at once (gcc for C&C++, llvm for Rust). C is also drifting towards llvm (clang) and you can still use FreeRTOS http://www.hashmismatch.net/freertos-meets-rust/ On 5/24/2020 at 5:59 AM, atdlzpae said: A few years ago I've done an STM32 project. I've compiled a Hello World using Rust for it, but ultimately I've decided to go with C++. I'm glad I did, because we were looking half a year for a programmer to replace me. :-/ In Rust we'd have to look way longer. I've done couple projects in rust (not on micro though) where parallel computation were needed. Simple project would have been coded in C much quickly than rust but not multithreaded/parallel one. ALSO after it was launched to production noone returned to it and no other developer had to look at it because there were no discovered bugs. I doubt that would be the case with C, in overal it would eat more of everybody's time. And in our case it is not only troubleshooting time, significant portion of a health risk is removed by strict compiler versus relying on human factor here. On 5/24/2020 at 5:59 AM, atdlzpae said: As for troubleshooting and safety... It doesn't matter as much for small projects like a unicycle firmware. You still need extensive testing, regardless of the language. Also, very often uC's are doing everything on global variables with a really simple state. There usually isn't much you can screw up memory-wise. THats the thing! We already have a handful of wheels which were created this way. I e they barely work after some testing. But I'm hesitant to entrust my life to them and if i was creating this wheel I'd want to minimize accidents due to cheap design. Id want not to be the cause of someone's death. This has to be done with western standards of safety and cost of human life. Automotive-grade components. Sealed connectors and enclosures (which already exists in cars). Possibly redundant design or safety wheel stop protocol in case of main controller failure. Ability of wheel to hold the balance and stop if absolutely any electronic component fails. That would probably mean 2 brains. One is main and another one is "safety net". 1 Quote Link to comment Share on other sites More sharing options...
Cychotic Posted July 31, 2020 Share Posted July 31, 2020 C is superior in terms of optimization. Lowest level you should ever program in. You can use high level programming fundamentals in C as well, it just takes more work and better architecture. You can do parallel task similar to RTOS, again it's just takes more effort. Obviously RTOS is going to be more "parallel." But from my experience, there are very few applications that truly requires it. A WELL constructed super loop with proper prioritization and many state machines. You achieve less overhead and superior speed and reliability. There is also Protothread if you find it to be more convenient to use, but you don't need really need it, since the fundamentals are the same. Yes it is 21th century, with the exception of C++ (which you end up writing mostly C), but there simply isn't a high level language that can compete with C in terms of performance for microcontrollers. 2 Quote Link to comment Share on other sites More sharing options...
Cychotic Posted July 31, 2020 Share Posted July 31, 2020 (edited) On 6/12/2019 at 3:56 AM, Inductores said: Let me finish the schematic, I can post it at the end of the week. Actually it's already finished, but I need to order the symbols. Edit: Nevermind, found your schematic. I will give some feed back. Edited July 31, 2020 by Cychotic Quote Link to comment Share on other sites More sharing options...
Inductores Posted September 28, 2020 Author Share Posted September 28, 2020 I promised @s.m. to send him a controller board in exchange for a GT16 board he already sent me, so I still have the need to finish this project... So after some months thinking about it and buying some modules, I finally decided to use a ESP32 module: As I said before, I have not enough experience to programming, but I'll do my best to finish this projech. I also moved from PADS to Altium because of professional needings, so I'll make the board in Altium and (maybe) I'll try to export it to KiCAD. I just need some time... 1 Quote Link to comment Share on other sites More sharing options...
NuRxG Posted September 28, 2020 Share Posted September 28, 2020 FWIW There are already tons of open source EUC motherboards, but if you want to roll your own, thats cool. If you have any questions for the coding or control systems side you're more than welcome to rip off my code, and I'm happy to answer any questions about it. Quote Link to comment Share on other sites More sharing options...
tudordewolf Posted September 29, 2020 Share Posted September 29, 2020 17 hours ago, NuRxG said: FWIW There are already tons of open source EUC motherboards, but if you want to roll your own, thats cool. If you have any questions for the coding or control systems side you're more than welcome to rip off my code, and I'm happy to answer any questions about it. Could you point me towards where to buy one? The only generic I know about was the now-unavailable Microworks 30B4, and that was little more than a generic airwheel board. Google mostly just brings me back to this thread. Quote Link to comment Share on other sites More sharing options...
NuRxG Posted September 29, 2020 Share Posted September 29, 2020 (edited) 6 hours ago, tudordewolf said: Could you point me towards where to buy one? Its open source, why you tryin to buy it There are a bunch of open source board designs, but if you wanna buy a prebuilt board, those are not necessarily open source hardware. I assume for EUC you want 84v, i have all of these.https://trampaboards.com/single-vesc-100v-250a-in-cnc-t6-silicone-sealed-aluminum-box--the-most-powerful-vedder-electronic-speed-controller-ever-p-28113.htmlhttps://lacroixboards.com/products/stormcorehttps://forum.esk8.news/t/some-new-focers-84v-vesc-6-based-controllers/1513/783 Here is some other high voltage ones i haven't tried.https://makerx-tech.com/collections/x-esc/products/100a-200a-based-on-vesc6-high-power-eschttp://powervelocity.com/home/60-18f-ebike-sinewavesilent-controller-android-ios-bluetooth-programmable-8kw.html If you're building a lower voltage system there are way more cheaper options. Here are some board designshttps://github.com/shamansystems/Cheap-FOCer-2https://github.com/galpavlin/BESC-G2https://github.com/TechAUmNu/A200Shttps://github.com/vedderb/bldc-hardware Edited September 29, 2020 by NuRxG 1 Quote Link to comment Share on other sites More sharing options...
Murdomeek Posted September 30, 2020 Share Posted September 30, 2020 (edited) Great thing about the VESC based ones is that its open source, so you can look into it and modify it yourself if you're inclined to do so. They also have the "balance" options built into the software. With boxes and sliders for many features such as: pid loop, sensor loop items, max speed, tiltback angle, side-side- cutoff angle, etc. Much much easier than writing your own firmware and code. Here is a tutorial on how to set it up: Edited September 30, 2020 by Murdomeek 1 Quote Link to comment Share on other sites More sharing options...
Mark Wilson Posted September 30, 2020 Share Posted September 30, 2020 On 9/29/2020 at 11:29 AM, NuRxG said: Its open source, why you tryin to buy it Forgive my ignorance, but how do you go from the open source design that you find online to actually having the physical product? 1 Quote Link to comment Share on other sites More sharing options...
NuRxG Posted September 30, 2020 Share Posted September 30, 2020 19 minutes ago, Murdomeek said: Here is a tutorial on how to set it up: That is the old video, watch the new one. It 👏 even 👏 says 👏 so 👏 in 👏 the 👏 title 👏 12 minutes ago, Mark Wilson said: Forgive my ignorance, but how do you go from the open source design that you find online to actually having the physical product? Well there is open source software and hardware, for buying open source software makes no sense, unless you're trying to donate. For this specific context, on the hardware side, there are both open and closed source hardwares, the closed source hardware you can only buy, for the open source hardware some you can buy or build, some you can only build. Open source hardware will include gerber files, which you can send to a PCB manufacturing service like JLCPCB, they'll also include a BOM which lists all the components you need. Once you have all the parts, you just gotta assemble it, like very nerdy lego's. The cfoc2 specifically was designed for JLCPCB's auto manufacturing robots, so you can order those almost fully assembled directly from the factory, the github repo even includes guides on how to order, and do the remaining assembly.https://github.com/shamansystems/Cheap-FOCer-2/tree/master/guides/orderinghttps://github.com/shamansystems/Cheap-FOCer-2/tree/master/guides/assembly 2 Quote Link to comment Share on other sites More sharing options...
Murdomeek Posted September 30, 2020 Share Posted September 30, 2020 23 minutes ago, Mark Wilson said: Forgive my ignorance, but how do you go from the open source design that you find online to actually having the physical product? Multiple factories/sellers can use the design and make the physical motherboards to sell for profit. You can buy one here (the original with the balance sensor integrated): https://trampaboards.com/vesc-6-mkiv-in-cnc-t6-silicone-sealed-aluminium-box-with-genuine-xt90-connectors--vedder-electronic-speed-controller-trampa-special-p-27536.html The other ones linked are based off the same open source schematic, but slightly different specs/max voltages/ single/dual/quality/price. As the user, you can decide yourself which to get based on your project requirements. (Max voltage, max power, etc) 1 Quote Link to comment Share on other sites More sharing options...
h3X Posted October 1, 2020 Share Posted October 1, 2020 I recently learned that the vesc has a balance app. It's written by Mitch Lustig, who also runs the Balance Builders group on Telegram: https://t.me/joinchat/JP0KNxbguWM5KhHrT5_CYA 3 Quote Link to comment Share on other sites More sharing options...
The Guy Posted June 12, 2021 Share Posted June 12, 2021 Is this thread still active?? 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.