STMBL servo driver - open source projekt z DE

Odpovědět
Mex
Příspěvky: 10288
Registrován: 6. 2. 2014, 10:29

29. 10. 2015, 11:14

crinq píše:could you please translate my post for the others? I don't think most of you can understand me. Would german be better?
Very good idea, I'll do it.
Stay in English, please.
crinq píše:STEP/DIR is shit, but we have to support it for the Mach guys. We prefer quadrature or real protocols.
Currently we are implementing Mesanet Smart Serial. In future we will use a custom rs485 link to our ethernet breakout board.
Yes, I understand and confirm.
But - we are on the hobby CNC forum, so we love LinuxCNC, Mach, GRBL and other lower level control systems. And so we love STEP/DIR.
STEP/DIR is simple, everybody knows it, every system supports it ...
So the "market" for servodriver with this simple and problem-free interface is huge.
crinq píše:The STM32F103R6 was cheap and available when we started this design and it is nearly pin compatible with our F4. The next version will use more F1 pins. We will see if 48pins will be enough.
Before modifying the firmware please talk to us (best in IRC). We have some plans for the F1. If we work together it will benefit all.
Yes, but there are only very few pin used, so there is big margin now.

Mex
Mex
Příspěvky: 10288
Registrován: 6. 2. 2014, 10:29

30. 10. 2015, 12:10

Napsal anglicky píšící člen "crinq", abych jeho post sem dal v češtině. To je asi dobrý nápad, tady je:

Ahoj,
jsem jedním z vývojářů STMBL. Zkusím odpovědět na některé otázky.
Mluvím německy a anglicky a tak sploléhám na Google Translate, abych si mohl přečíst toto vlákno. Opravte mě, jestli bude něco blbě.

Vezměte prosím na vědomí: STMBL je stále ve stavu beta a vyvíjí se.
Hardware verze 3.3 je hlavně pro testování a není určen pro rutinní plug and play použití. Funguje, dá se používat, ale za nic neručíme.

Dostupnost tišťáků:
Máme nějaké k dispozici (verze 3.3). Kontaktujte nás přes IRC

IRAMX z eBay:
To je jiná verze s nižším jmenovitým proudem.
Nedoporučuji používat tyhle moduly z eBay pro aplikace s vysokým napájecím napětím.

Cena F1 a SI8621:
Pokud si je koupíte od rozumných prodejců (ne z eBaye), kteří prodávají po cívkách, tak cena je kolem 2 € pro F1 a 1 € pro SI.
Komentář Mex: nojo, ale když člověk potřebuje 1-3 kusy, tak je to s nějakým velkým obchodníkem slabší. Buď chce prodat aspoň 100ks, nebo je tam likvidační poštovné.

Velikosti a rozmístění součástek:
Tišťák nebyl navržen pro ruční montáž. Osazovací automat zvládá 0603, a ty jsou mnohem levnější než 0805.

ESD:
Verze 3.3 je vývojářská. Verze 3.4 bude mít lepší ESD ochrany pro analogové signály. Chipy RS485 zvládají ESD docela dobře.

Měření a omezení proudu:
Modul IRAMX obsahuje měřicí bočník, který používáme k nadproudové ochraně. IRAMX má také integrovanou ochranu na asi 25A.
Verze 3.4 bude mít lepší zpětnou vazbu pro měření parametrů motoru a vyladění modelu motoru. V našich testech byla odchylka našeho modelu motoru pod 10%.

Řešení přepětí:
STMBL verze 3.3 je navržen pro práci s externím zdrojem napájení, který se o přepětí stará. Taky můžeme energii zlikvidovat v motoru stejnosměrným proudem nebo zkratováním motoru. Také je možné využít signál, spínající externí brzdný odpor.

Zamrznutí CPU:
F4 a F1 budou mít hardwarové watch-dogy. Softwarové watch-dogy jsou už částečně realizovány. Řízení motoru řeší čitač PWM, a ten běží i když procesor zamrzne. F4 může nouzově vypnout napájení. Ještě uvažujeme o třetím systému ochrany vypínačem na kladném napájení.

Galvanicky oddělené IO:
Nenašli jsme žádný levný a jednoduchý způsob, jak udělat flexibilní, diferenciální a izolované rozhraní. Verze 3.4 bude mít čtyři diferenciální rozhraní RS485 a bude moct provozovat téměř jakýkoliv protokol až do rychlosti 10Mbit/s. Myslíme si, že galvanické oddělení se líp dělá na oddělovací desce nebo nějakým malým adaptérem.

Rychlost komunikace F4 <-> F1:
Pro vzájemnou komunikaci mezi procesory používáme UART na rychlosti 2Mbit/s. V případě potřeby můžeme rychlost zvednout až na 5Mbit/s. Naše real-time běží na 5 kHz, takže není potřeba komunikovat rychleji. Přemýšlíme nad přesunem řízení proudu do F1, ale zatím to nebylo třeba.

Velké odpory:
Používají se pro rychlé vybití DC meziobvodu během měření a jsou součástí napěťového děliče. Verze 3.4 bude mít dělič ze SMD odporů, protože vybíjení DC meziobvodu bude děláno jinak.

Značka pro regálory napětí:
Neměli jsme odpovídající symbol v knihovně. No a později jsem to už nikdy neopravili...

Kvalita kódu:
Hlavní vývoj se zaměřuje na část F4, kód F1 je docela ošklivý. Vylepšíme ho, ale až později.

Pokud chcete pomoci, tak se klidně ptejte. Potřebujeme pomoc při implementaci a testování nových nápadů, vylepšování kódu, psaní dokumentace nebo pomoc ostatním při rozjezdu.

Pokud se rozhodnete vytvořit vlastní hardware nebo software, snažte se to dělat co nejvíc kompatibilní s STMBL. V současné rané fázi vývoje by příliš mnoho odchylek nebylo ku prospěchu projektu při směrování ke stabilnímu řešení.

Máte-li jakékoli dotazy nebo nápady, tak navštivte naš IRC kanál nebo odpovězte na tento post. Jestli se chcete něco dozvědět, pište raději anglicky nebo německy, protože tyhle jazyky umíme.

Nico
GMAN
Příspěvky: 156
Registrován: 31. 3. 2009, 10:46
Bydliště: Londýn

30. 10. 2015, 1:43

crinq píše: Please note: STMBL is still in beta status and under heavy development. Hardware version 3.3 is mainly for testing and not designed for plug and play use. It works and can be used but we guarantee for nothing.
Hi, I can see that it is under development, that's why I wrote my suggestions what could be improved(from my point of view). I designed something similar few years ago, see the picture bellow.
crinq píše: IRAMX from ebay:
This is a different part with lower current rating.
I don't recommend using parts from ebay for a high voltage application.
I agree, buying a second hand component to save few dollars and then spend many days trying to find out why it doesn't work.. This is not worth the risk.
crinq píše: ESD:
v3.3 is a development platform. v3.4 will have better ESD protection for the analog stuff. The RS485 chips can handle ESD quite well.
It is not only about lines going in or out of the inverter, but also power rails should be protected. Components nowadays are quite immune to ESD, if a pin gets an ES discharge there usually are protective diodes which conduct the current to the ground(negative discharge) or to VCC, but this power rail needs to be protected, otherwise the voltage will keep rising. I am not an expert in ESD problematics, but it costs me so many hours of investigating and trying to find a bug in code... What I do now is protecting every single line going out or in the PCB and also every power supply rail. You can buy transils in 0805 or smaller package, it is cheap, small and useful :)
crinq píše: Current sensing and limiting:
We have a single low side shunt inside the IRAMX that we use for overcurrent protection. Also the IRAMX has an integrated protection set to about 25A.
v3.4 will get better current feedback for measuring motor parameters and tuning the motor model. In our tests the deviation of our motor model was less than 10%.
Take a look at hall effect based current sensors from Allegro, they are really good, it has almost no resistance, no inductance and the response is very fast. It is in a compact package and you can connect the output directly to your processor. I am using these on a 6-channel DC motor controller and it works better than I expected. :)
crinq píše: CPU stall:
F4 and F1 will both get hardware watchdogs. Software watchdogs are partly implemented. The PWM timer is designed for motor control and will not freeze if the cpu stalls. The f4 can signal the power supply to shut down. We think about a implementing a third independent kill switch on the high side.
OK, the timer will keep running, but that will not help you :) . Now, imagine that you are controlling a servo motor at high speed and high load. Now your processors stalls and your PWM keeps running, but how? The processor can not change compare register values, the timer will keep running but will not generate rotary field. It will create a static EM field. The running servo definitely won't like it :D Your over-current protection will probably kill the power and save the motor and driver.
That's why I'd put there a signal connected to the Enable input, this signal could be controlled from both processors(the F4 will need an optocoupler, but you can use some slow cheap one) and also external enable input, which should be connected to some ESTOP or whatever, so you can make sure that the drive is disabled.
crinq píše: Isolated IO:
We found no cheap and small way to implement a flexible, differential and isolated command interface. v3.4 will have four differential IOs (RS485) and can do nearly any protocol up to 10Mbit/s. We think isolation is better handled on the breakout board or with a small adapter.
I didn't mean flexible high speed IOs, but simple slow optocouplers with classic transistor output. For such signals as Error out, enable in, driver ready etc is no need for high speed. You can find these in a package of four for price lower than 1€. I'd put there a header for expansion card where you can put some high speed IO if you need them. Signals for encoder don't need to be isolated when powered from the inverter.
crinq píše: Speed F4 <-> F1:
We have a 2Mbit/s UART for communication. We can push it up to 5Mbit/s if needed. As our realtime thread runs at 5kHz there is no need to send more often. We think of moving the current controller to the F1, but it was not yet necessary.
Current controller implemented in the F1 is a must! You need as responsive current regulators as possible. Try to simulate the behaviour of the inverter when a low inductance motor is connected. It will not work, it will oscillate no matter what you do :D I think that the current regulator should be triggered from PWM timer, ideally on the top and bottom(Up Down mode timer), so you can change your PWM duty very quickly.
crinq píše: STEP/DIR is shit, but we have to support it for the Mach guys. We prefer quadrature or real protocols.
Currently we are implementing Mesanet Smart Serial. In future we will use a custom rs485 link to our ethernet breakout board.
That sounds interesting! But isn't it easier to put an ethernet module directly to each inverter and eliminate the need for breakout board? If you have closed network, the timing is pretty good. And if you want something really precise, you can send the data to all nodes and then broadcast a trigger packet to all nodes at once to keep them in sync.
Přílohy
3Ph inverter, input AC 230V, max 2kW
3Ph inverter, input AC 230V, max 2kW
6-ch DC motor controller, 80V, 15A/Ch
6-ch DC motor controller, 80V, 15A/Ch
HonzaCh
Příspěvky: 289
Registrován: 21. 11. 2006, 8:57
Bydliště: Ostrava

31. 10. 2015, 12:24

Tady se to zatím ale rozjelo :)

Vycházeje z předpokladu, že angličtina by nemusela vadit v odborné části (nutnost pro elektroniku a programování, jinak snad pomůže překladač google) a tu sociální si zase může přegooglit pan kolega crinq z DE, dovolím si jazyky takto střídat.

Moje motivace je do značné míry podobná Mexově, rád bych se něco přiučil, ale bude fajn, pokud to bude funkční. A nejsem motorář, takže učit se je co… :)

Slíbil jsem, že se přes víkend podívám, ale koukám, že jsem pomalý. Na zdroják jsem jen zběžně podíval, opravdu je trochu "ugly" :) Jak už se tu uvedlo, STM32F103C8 má více paměti, trochu míň I/O. "16-bit, motor control PWM timer with dead-time generation and emergency stop" mají oba. IMHO by STM32F103C8 měla stačit i s mírnou rezervou. Timer je na stejných portech, co je na portu C (3 LEDky, 2 ADC) by se muselo přesunout. Výzkum dostupnosti a cen jsem neprováděl.
crinq píše:If you have any questions or ideas feel free to visit our IRC channel or reply to this post.
crinq píše:Before modifying the firmware please talk to us (best in IRC).
AFAIK, the IRC is not very popular here, or maybe better it has never gained a big market share in communities like this. Although I used to be involved in IT, I have never used it and I have only minimal info about it.
crinq píše:The next version will use more F1 pins. We will see if 48pins will be enough.
Before modifying the firmware please talk to us (best in IRC). We have some plans for the F1. If we work together it will benefit all.
It would be great if you share your plans on github more publicly. The current todo list consists of items different from what you shared with us here. :)

As Mex already stated, it seems there's some small margin regarding unused pins on STM32F103C8. OTOH, there're only 10 ADC channels (vs. 16 in R6).

And for the sake of reliability I'd stay with the "7" grade (up to 105°C).
crinq píše:
mex píše:I would have to modify the firmware of course, so I´d made a small clean-up of code and opened a watch-dog.
The STM32F103R6 was cheap and available when we started this design and it is nearly pin compatible with our F4. The next version will use more F1 pins. We will see if 48pins will be enough.
Before modifying the firmware please talk to us (best in IRC). We have some plans for the F1. If we work together it will benefit all.
You kindly offered using this forum to discuss your driver alternatively, and Mex did so :)

According to me, the driver (HV part) deserves an external watchdog forcing the EN/-FAULT pin of the IRAMX driver low on timeout. (Interface to the MCU would be a bonus.)

Unfortunately I'm not an ESD expert either but my heart says add as much of ESD protection as possible (read: a reasonable amount) for working in such a harsh environment (high-voltage high-power switching). Using 3.6V (datasheet max) instead of 3.3V to power the MCU should also provide slightly better noise immunity.

I was convinced Hall-effect-based current sensors are relatively slow (~10kHz) -- 120kHz bandwidth found in contemporary Allegro devices sounds really good. There're 3 ADC channels on SV2 which are currently exploited only if the driver is compiled in the TROLLER mode (whatever it means).
crinq
Příspěvky: 12
Registrován: 29. 10. 2015, 2:00

31. 10. 2015, 2:44

Hi,

@Mex
Thanks for translating.
Mex píše: Yes, I understand and confirm.
But - we are on the hobby CNC forum, so we love LinuxCNC, Mach, GRBL and other lower level control systems. And so we love STEP/DIR.
STEP/DIR is simple, everybody knows it, every system supports it ...
So the "market" for servodriver with this simple and problem-free interface is huge.
Thats why we support step/dir. But compared to quadrature it is not problem-free. A single peak on the step line will result in a wrong position.
But most LinuxCNC users i know try to find something better thats cheaper than EtherCAT hardware. And they often have Mesanet hardware laying around.
Other benefits are things like power usage feedback, runtime configuration, informative error messages, ...
As we use the drives our scara robot i want to try stuff like adaptive motion control with realtime force feedback.
GMAN píše: It is not only about lines going in or out of the inverter, but also power rails should be protected. ...
The 12V rail will be gone. 3.3V and 5V will be clamped.
GMAN píše: Take a look at hall effect based current sensors from Allegro, they are really good, it has almost no resistance, no inductance and the response is very fast. It is in a compact package and you can connect the output directly to your processor.
We use them on our discrete driver board (prototype, not on github, named troller). Phase current sensing does not really improve our current loop (more noise => lower gain ...). As they are not cheap in small quantities and you need three to cancel out the sensitivity for magnetic fields we will not include them in the "low price" irmax hardware. They will be on the high power discrete version.
GMAN píše: OK, the timer will keep running, but that will not help you :) . Now, imagine that you are controlling a servo motor at high speed and high load. Now your processors stalls and your PWM keeps running, but how? The processor can not change compare register values, the timer will keep running but will not generate rotary field. It will create a static EM field. The running servo definitely won't like it :D Your over-current protection will probably kill the power and save the motor and driver.
That's why I'd put there a signal connected to the Enable input, this signal could be controlled from both processors(the F4 will need an optocoupler, but you can use some slow cheap one) and also external enable input, which should be connected to some ESTOP or whatever, so you can make sure that the drive is disabled.
The F4 should kill the power supply within 0.2s. But we think of using a larger SI to get that third redundancy.
We might just kill the 15V rail to disable the drive and reset the F1.
GMAN píše: I didn't mean flexible high speed IOs, but simple slow optocouplers with classic transistor output. For such signals as Error out, enable in, driver ready etc is no need for high speed. You can find these in a package of four for price lower than 1€. I'd put there a header for expansion card where you can put some high speed IO if you need them. Signals for encoder don't need to be isolated when powered from the inverter.
Error and enable are on the cmd port (v3.3 has 2 I and 1 IO lines, v3.4 will have 4 IOs) and go to the breakout board. In the current v3.4 design i have 3 F4 pins left. I will see what is possible.
A first version of v3.4 should be on github in a few weeks.
GMAN píše: Current controller implemented in the F1 is a must! You need as responsive current regulators as possible. Try to simulate the behaviour of the inverter when a low inductance motor is connected. It will not work, it will oscillate no matter what you do :D I think that the current regulator should be triggered from PWM timer, ideally on the top and bottom(Up Down mode timer), so you can change your PWM duty very quickly.
I have done a lot of calculations and simulations of our control loops. As we have a big motor model we can do much more than you will find in an average motor control book. Our current loop is a PIFF0 with induction compensation. Stuff like deadtime correction and IGBT drop will be reimplemented in the near future.
The bandwdith is about 2kHz max (depends on motor, voltage and amplitude). We are aiming for 3-4kHz with the F1 doing parts of it.
GMAN píše: That sounds interesting! But isn't it easier to put an ethernet module directly to each inverter and eliminate the need for breakout board? If you have closed network, the timing is pretty good. And if you want something really precise, you can send the data to all nodes and then broadcast a trigger packet to all nodes at once to keep them in sync.
Ne pins free. And our breakout board can do much more than decoding ethernet frames. It is based on the stm32f7 (;

Nice inverter you build there GMAN.
HonzaCh píše: AFAIK, the IRC is not very popular here, or maybe better it has never gained a big market share in communities like this. Although I used to be involved in IT, I have never used it and I have only minimal info about it.
It is quite popular with the LinuxCNC guys and english retrofitting community. And we use it to stay in contact with most of our users and devs.
Thats why we try to focus discussions and development on IRC and github.
HonzaCh píše: It would be great if you share your plans on github more publicly. The current todo list consists of items different from what you shared with us here.
I will upload it into our wiki as soon as i find some time to merge all of them and make them readable. I will notify you when it is done.
HonzaCh píše: According to me, the driver (HV part) deserves an external watchdog forcing the EN/-FAULT pin of the IRAMX driver low on timeout. (Interface to the MCU would be a bonus.)
My idea was to kill the 15V rail. It disables the driver and resets the F1. On v3.4 an st viper06 will generate the 15V from the DC link.
HonzaCh píše: Unfortunately I'm not an ESD expert either but my heart says add as much of ESD protection as possible (read: a reasonable amount) for working in such a harsh environment (high-voltage high-power switching). Using 3.6V (datasheet max) instead of 3.3V to power the MCU should also provide slightly better noise immunity.
There will be a bunch of st usblc6-4 for the analog stuff and 3.3V rail.
In our tests noise was never a problem.
HonzaCh píše: I was convinced Hall-effect-based current sensors are relatively slow (~10kHz) -- 120kHz bandwidth found in contemporary Allegro devices sounds really good. There're 3 ADC channels on SV2 which are currently exploited only if the driver is compiled in the TROLLER mode (whatever it means).
We use a 4 channel allegro based PCB for testing. They are quite good sensors but expensive.
Troller is a prototype of a discrete driver with three allegros.

Nico
Monteg
Příspěvky: 1480
Registrován: 30. 10. 2006, 5:37
Bydliště: LOUNY

4. 11. 2015, 7:13

Tak jsem celý netrpělivý co se bude dít :twisted:
lubos
Sponzor fora
Příspěvky: 5088
Registrován: 2. 5. 2007, 3:47
Bydliště: Praha

4. 11. 2015, 8:11

Možná by stálo za to počkat až na tu další verzi pokud se tu teda někdo nepustí sám do úpravy stávající verze desky.
XpertMill, Gravos, Ninos, Galaad
IQ156
-1500Kč, -520Kč, -1čokoláda, - 28000Kč
www.freeair.cz www.rotexelectric.eu www.retrofitcnc.cz
Monteg
Příspěvky: 1480
Registrován: 30. 10. 2006, 5:37
Bydliště: LOUNY

22. 11. 2015, 9:30

Monteg píše:Tak jsem celý netrpělivý co se bude dít :twisted:
Monteg
Příspěvky: 1480
Registrován: 30. 10. 2006, 5:37
Bydliště: LOUNY

9. 12. 2015, 11:20

Tak koukám skoro 2 měsíce jsou pryč a nic asi to vyšumělo :roll:
crinq
Příspěvky: 12
Registrován: 29. 10. 2015, 2:00

10. 12. 2015, 3:52

Hi,
a schematic preview is on GitHub: https://github.com/rene-dev/stmbl/tree/ ... kicad/v3.4 (KiCad 4.0.0)
pdf Version: https://github.com/rene-dev/stmbl/blob/ ... bl_3.4.pdf

TODO:
- final GPIO/AIN mapping for F4, F1 and IO header
- more leds
- check F4 function block mapping
- more ESD protection
- testpoints
- redesign viper06 circuit
- adjust some component values
- place (70% done) and route
- check all my notes and todo lists (;

NOTES:
- stm32f103c8 can be used, but for SW compatibility to stmbl 3.3 the c6 is in the schematic
- pcm1803a needs some testing, therefor the jumpers and osc
- the pcm1803a + osc is optional
- fb1 is optional
- f4 needs a crystal for some protocols, the f1 crystal should be optional (not tested)
- the better available irams/x series can be used with small changes (combined itrip / vth, ...)

new Features:
- dual feedback
- new FB protocols: BiSS, EnDat, SSI, ...
- FB voltage and current sensing
- higher analog resolution on FB0
- voltage monitoring (24V, 15V, 12V, 5V, 3.3V)
- backemf (+-420V) and motor current (+-35A) sensing for sensorless foc, hfi and motor autotuning
- 2 analog inputs (+-35V)
- 3 oc outputs (24V)
- 3 analog inputs for motor temperature (on FB0, FB1 and HV)
- 4.5MBit/s F4<->F1
- F4 can disable the F1 motor timer (needs testing)

There are two GPIOs/AINs left on the F4. Any suggestions?
I'm thinking about PCB temperature sensing, 24V current sensing, putting them on the IO header, ...

Nico
Grad
Příspěvky: 2073
Registrován: 13. 7. 2014, 9:32

30. 12. 2015, 12:12

Vypadá to že svátky kluci využili k práci na projektu, protože došlo k jeho aktualizacím viz.:
https://github.com/rene-dev/stmbl" onclick="window.open(this.href);return false;
Koukal někdo na posledně popsané změny HW V3.4 viz. výše?
lubos
Sponzor fora
Příspěvky: 5088
Registrován: 2. 5. 2007, 3:47
Bydliště: Praha

30. 12. 2015, 12:25

Když jsem tam koukal tak to tam asi neměl. Budu muset pustit kicad a podívat se co je tam vše jiné. Docela rád bych to už zkusil dát dohromady.
XpertMill, Gravos, Ninos, Galaad
IQ156
-1500Kč, -520Kč, -1čokoláda, - 28000Kč
www.freeair.cz www.rotexelectric.eu www.retrofitcnc.cz
lubos
Sponzor fora
Příspěvky: 5088
Registrován: 2. 5. 2007, 3:47
Bydliště: Praha

30. 12. 2015, 5:28

Jsem slepej nebo tam tišták na HW verzi 3.4 neni?
XpertMill, Gravos, Ninos, Galaad
IQ156
-1500Kč, -520Kč, -1čokoláda, - 28000Kč
www.freeair.cz www.rotexelectric.eu www.retrofitcnc.cz
bronek999
Příspěvky: 521
Registrován: 6. 3. 2014, 6:50

21. 2. 2016, 5:35

Tak ako? Nejaky progress? Pred par mesiacmi to tu zilo a zda sa ze to nejak zdochlo. Postavil to realne niekto?
Monteg
Příspěvky: 1480
Registrován: 30. 10. 2006, 5:37
Bydliště: LOUNY

21. 2. 2016, 8:17

Myslím že tohle umřelo někdy tak v řijnu :cry:
Odpovědět

Zpět na „Ostatní elektronika“