Fast Current control with reverse

General topics and discussions about the VESC and its development.
blezalex
Posts: 10
Joined: 05 Apr 2017, 04:51
Location: US
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1236: count(): Parameter must be an array or an object that implements Countable

Fast Current control with reverse

Postby blezalex » 05 Apr 2017, 05:58

I'm working on my self balancing one wheeled board. It works well now, but I had to create my own firmware for VESC as i could not get VESC stock firmware to do theses things:
- Bi-Directional current control with break. Say I set 5amp current for 20 seconds, then -5 amp for 50 seconds. I expect controller to apply breaking force equivalent of 5amp, then accelerate in reverse direction with 5amp power.
- Very fast reaction to current control input. My balancing controller runs at 100hz, ESC needs to be fast enough to control current with that speed
- Control current on all 3 phases. Board needs to maintain balance when motor is halted.


Is there a way to configure VESC to support those? Will VESC 6 support it?

Here is a short video of me riding my board

benjamin
Site Admin
Posts: 280
Joined: 15 Dec 2015, 08:38
Location: Sweden
Contact:

Re: Fast Current control with reverse

Postby benjamin » 05 Apr 2017, 10:08

FOC should support this without problems. The firmware that I'm working on will do a bit better job than the one on github now, but even the current one should work.

Do you have a sensored motor? Are you using FOC? It is essential to use sensors if you want to alternate between full torque in both directions at 0 speed.

lizardmech
Posts: 171
Joined: 19 Jan 2016, 10:54
Location: Australia
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1236: count(): Parameter must be an array or an object that implements Countable

Re: Fast Current control with reverse

Postby lizardmech » 06 Apr 2017, 04:56

Can you put your custom firmware fork on github? I have been working on custom hardware for VESC based balancing vehicles but I haven't been able to find anyone familiar with balancing vehicles to work on the software so far. Many other people on another forum have been trying to create controllers for balancing vehicles we were able to collect quite a lot of info regarding how existing designs operate so we might be able to help you.

blezalex
Posts: 10
Joined: 05 Apr 2017, 04:51
Location: US
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1236: count(): Parameter must be an array or an object that implements Countable

Re: Fast Current control with reverse

Postby blezalex » 06 Apr 2017, 05:58

I just tried FOC - i'm very impressed by how smooth and quiet motor gets - huge difference from my version of controller.

I have sensored motor with HAL sensors. Here is the link to motor https://www.aliexpress.com/store/produc ... 43206.html.

Looks like the controller is almost solving my problem, but not quite yet.. (possibly some tuning needed)

BLDC mode: I get very strong kick in each direction, almost impossible to balance it no matter how low my PID controller goes. It seems like VESC is attempting to get motor to spin up from halt and so applies more PWM than my balancer is asking for.

FOC mode: works almost perfectly, but seems to loose sync when I'm slowing down on my board. It does not happen always but very often. I feel rapid clicks and pushes. Sometimes it re-syncs quickly enough to maintain the balance but quite often it completely loses torque (or maybe applies it in a wrong direction).
It first i though it may be due to missing 3rd shunt, but seems like same thing happens in PWM mode too, not just in current mode.


BTW: what does current controller do when motor halted and low side with no shunt is active?
BTW2: I did not notice motor advance configuration, how do it set it? in FOC mode in particular..
Last edited by blezalex on 06 Apr 2017, 06:13, edited 1 time in total.

blezalex
Posts: 10
Joined: 05 Apr 2017, 04:51
Location: US
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1236: count(): Parameter must be an array or an object that implements Countable

Re: Fast Current control with reverse

Postby blezalex » 06 Apr 2017, 06:11


lizardmech
Posts: 171
Joined: 19 Jan 2016, 10:54
Location: Australia
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1236: count(): Parameter must be an array or an object that implements Countable

Re: Fast Current control with reverse

Postby lizardmech » 06 Apr 2017, 07:12

I'm making my own hardware, it's basically a larger VESC with an IMU and components with 80V maximum voltage as many of the electric unicycles run 60V or 67V. It got delayed a little, it makes more sense to have it set up for VESC 6 firmware, it has 3x in-phase current sense but it isn't taking advantage with them on the old firmware.

I did actually pay someone to write IMU drivers and a kalman filter for VESC 4 but I couldn't find anyone to help write the code to take the filtered IMU data and send it to one of the VESC apps. The person who did the drivers didn't have any motor control or balancing vehicle experience.

You can have a look here https://github.com/votuananhs/bldc/tree ... lectronics the code is self contained in the application folder. I had him release as GPL code so it's all open. I have had it built and running, but I don't understand how to integrate it or write the PID loop for balancing. In theory you should be able to connect a mpu 6050 IMU breakout board via I2C and get it working on a normal VESC 4.1x if you know how to finish the code.

benjamin
Site Admin
Posts: 280
Joined: 15 Dec 2015, 08:38
Location: Sweden
Contact:

Re: Fast Current control with reverse

Postby benjamin » 06 Apr 2017, 09:04


lizardmech
Posts: 171
Joined: 19 Jan 2016, 10:54
Location: Australia
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1236: count(): Parameter must be an array or an object that implements Countable

Re: Fast Current control with reverse

Postby lizardmech » 06 Apr 2017, 09:40

Attachments
mosfet.png
mosfet.png (9.58 KiB) Viewed 2684 times

benjamin
Site Admin
Posts: 280
Joined: 15 Dec 2015, 08:38
Location: Sweden
Contact:

Re: Fast Current control with reverse

Postby benjamin » 06 Apr 2017, 09:48


blezalex
Posts: 10
Joined: 05 Apr 2017, 04:51
Location: US
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1236: count(): Parameter must be an array or an object that implements Countable

Re: Fast Current control with reverse

Postby blezalex » 07 Apr 2017, 04:00



[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1236: count(): Parameter must be an array or an object that implements Countable

Return to “General”

Who is online

Users browsing this forum: No registered users and 4 guests