Suggestions for OpenSource Electric Unicycle firmware

Support for creating custom user applications on the VESC.
yes_we_can_gogreen
Posts: 40
Joined: 13 Apr 2016, 10:27
Location: uk

Re: Suggestions for OpenSource Electric Unicycle firmware

Postby yes_we_can_gogreen » 05 Aug 2016, 13:45

I heard that Microchip have FOC and the full sources including the observer.

I will keep trying to make this board working and I will learn in the process. Right now I know it is very basic but have all the bits needed to FOC ( maybe for basic, but it is proves that works very well).

I will for sure find a simple way to measure and find the current constant I need to apply to calc the current. Anyway, next MicroWorks boards use another IC for more current and I guess don't use PCB resistance.

This board is very simple, which is good for repair and debug - I already did a few repairs of gen1 boards, I am not afraid. Also I have 5 of this boards.

lizardmech
Posts: 171
Joined: 19 Jan 2016, 10:54
Location: Australia

Re: Suggestions for OpenSource Electric Unicycle firmware

Postby lizardmech » 05 Aug 2016, 14:13

Microchip ones are a DSP and non-arm cpu, you will probably find the code makes use of specific hardware. Are you able to influence microworks hardware choices? If I could find a chinese company with experience in motor control PCB layout I could just tell them what components we need, I tried a few other shenzhen companies but they were hopeless and could only clone existing designs not layout new PCBs.

yes_we_can_gogreen
Posts: 40
Joined: 13 Apr 2016, 10:27
Location: uk

Re: Suggestions for OpenSource Electric Unicycle firmware

Postby yes_we_can_gogreen » 05 Aug 2016, 14:37

I am not able to influence. But if we get some OpenSource firmware working and tested, on a cheap board, like VESC and a specific board for EUC, I guess that could be a reference design that they could adopt.

If the reference for them are now the STM32F103 boards, I would like to take advantage of it since since then I can get cheap hardware. Also, on 30B4 board there is maybe 8 pins (ADCs and UART) available, that are unconnected this means it can grow in functionalities - just using an IC version with 128k flash or more. The UART Bluetooth is great also, for firmware update and log/debug and feature configuration.

Maybe there is a STM33F4 pin compatible with STM32F103C8T6 - would be great to resolder and solder a more powerful.

yes_we_can_gogreen
Posts: 40
Joined: 13 Apr 2016, 10:27
Location: uk

Re: Suggestions for OpenSource Electric Unicycle firmware

Postby yes_we_can_gogreen » 05 Aug 2016, 15:17

Why don't you redesign the 40A board that have 12 mosfets but instead use that same STM of VESC??

F3 maybe pin compatible:
Wikipedia

The STM32 F3-series is the second group of STM32 microcontrollers based on the ARM Cortex-M4F core, and the most recent series from ST. The F3 is almost pin-to-pin compatible with the STM32 F1-series.

yes_we_can_gogreen
Posts: 40
Joined: 13 Apr 2016, 10:27
Location: uk

Re: Suggestions for OpenSource Electric Unicycle firmware

Postby yes_we_can_gogreen » 05 Aug 2016, 15:44

Seems STM32F303C8T8 is pin compatible but this is cortex m4 with FPU. Maybe I can replace on the boards I have. I hope this way I can run almost directly the VESC firmware.

I will explore this option. But I will keep reading about the Sliding Mode Observer that VESC uses and other many other documents refer - 30B4 board have hardware to run the Sliding Mode Observer.

lizardmech
Posts: 171
Joined: 19 Jan 2016, 10:54
Location: Australia

Re: Suggestions for OpenSource Electric Unicycle firmware

Postby lizardmech » 05 Aug 2016, 16:04

It would probably be quicker to finish my existing design, I'm just stuck with the hardware, there's some sort of minor issue with MOSFET switching but I can't find anyone with BLDC hardware experience to help me fix it. I have been trying local makers and hobbyists but I can't find anyone with BLDC controller experience so far.

There's a couple of things holding it back on the software side, I need support for 3 high side current sense and find how the MCU pins are assigned in the software. A secondary thing I would like but it's not as important is to add support for isolated current sensors, they use differential outputs, I don't know how you write that code. I think you have to use a comparitor in the MCU then feed it to the ADC. If I can solve those issues it should be easy to get it into production. The quotes I got were pretty cheap, I think they microworks controller probably only costs them $20 to build most of what you pay for is their firmware.

If I can get that going I have a local place that can produce thick film hybrid circuits on thermally conductive ceramics, they usually use them in military and space related products. The local defense industry here died so this place is just selling them at PCB prices, the only limitation is a setup tooling cost as they have to build a bunch of screens. I actually went and saw the factory but unfortunately he had no experience in motor control so I have to do the design myself.

pf26
Posts: 278
Joined: 28 Mar 2016, 14:37
Location: FR Valence

Re: Suggestions for OpenSource Electric Unicycle firmware

Postby pf26 » 05 Aug 2016, 19:21

yes_we_can_gogreen wrote:I heard that Microchip have FOC and the full sources including the observer.

Yes, refer to http://www.microchip.com/wwwAppNotes/AppNotes.aspx?appnote=en536986
Highly instructive documentation indeed.
I use a self made board based on AN1299 (very similar FOC, but with single shunt). It does FOC, but not as good as VESC, especially for RC motors (low inductance, low resistance) and high battery voltage, meaning the time when current can be sampled is short, and results in noise and poor observer performance at low speed.

lizardmech wrote:some sort of minor issue with MOSFET switching

Did you start a thread somewhere on a forum about this ? Do you have a scope to acquire signals ? You could PWM each mosfet separately at first and use a resistive load (connected to battery + for low side FETs and - for high side) and see how it is going.

Differential outputs for a current sensor should be no problem: just connect one to a reference voltage (Vcc/2 = resistor divider + capacitor), and the other one to the ADC input (unless you have an MCU with differential ADC inputs). I assume Vcc is the max voltage of the ADC inputs.
As for isolated sensors, beware of the delays, slew rate..; whatever makes it difficult to synchronize and get samples fast enough..

lizardmech
Posts: 171
Joined: 19 Jan 2016, 10:54
Location: Australia

Re: Suggestions for OpenSource Electric Unicycle firmware

Postby lizardmech » 06 Aug 2016, 03:57

I don't have a scope or experience using them, that's my main problem. Is there a way to turn one of my STM32F4 devboards into a makeshift scope and PWM generator by using a pc to display the data?

yes_we_can_gogreen
Posts: 40
Joined: 13 Apr 2016, 10:27
Location: uk

Re: Suggestions for OpenSource Electric Unicycle firmware

Postby yes_we_can_gogreen » 06 Aug 2016, 07:41

So are you trying to develop an electronic board and you don't even know how to use a scope??

People are buying cheap Chinese scopes like Rigol. You can find on eBay.

lizardmech
Posts: 171
Joined: 19 Jan 2016, 10:54
Location: Australia

Re: Suggestions for OpenSource Electric Unicycle firmware

Postby lizardmech » 06 Aug 2016, 09:37

yes_we_can_gogreen wrote:So are you trying to develop an electronic board and you don't even know how to use a scope??

People are buying cheap Chinese scopes like Rigol. You can find on eBay.

Originally I planned to pay someone else to do this part, I tried a few freelancers and electronics companies, but I have had no success, freelancers take the project then do nothing for weeks and give up, others make designs that I can easily spot mistakes, other companies wont use kicad, don't want to hand over cad files, refuse to work on open source projects or refuse to only build the inverter stage, it ended up being quicker to just study everything myself online.

I think it's more effective just to pay someone with a highend scope and experience to check for signaling issues and workout what bootstrap capacitor values and what resistor arrangement I need to prevent ringing.


Return to “Custom Applications”

Who is online

Users browsing this forum: No registered users and 1 guest