Positional control with halls

Are there any features that you would like to add to the VESC?
dpetrillo
Posts: 25
Joined: 24 Dec 2015, 01:47
[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

Positional control with halls

Postby dpetrillo » 29 Jan 2016, 22:33

I'm just going to go ahead and take the liberty of filling up this feature request section with everything that I'm looking for... 8-) Seriously though I'm quite enjoying helping out with the testing of the VESC and I'm very impressed and grateful for all of your hard work Benjamin.

Would it be very difficult to enable positional control using the data from halls only? For many robotics applications, a sensored motor's electrical resolution translates into fine physical resolution. For instance, the motor I'm testing with has 30 magnets which would resolve to 6 degrees of rotation. This is as good as the backlash of some transmissions. With a smaller motor and a reduction gear train, coarse motor positioning of up to half a revolution is often adequate for many applications.

Dave

dpetrillo
Posts: 25
Joined: 24 Dec 2015, 01:47
[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: Positional control with halls

Postby dpetrillo » 08 Feb 2016, 20:13

Is anyone who is familiar with the firmware able to point me in the direction of what I would change in order to make the observer act as the encoder position, so that I might be able to do positional control using the observer, which is based on the halls?

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

Re: Positional control with halls

Postby benjamin » 09 Feb 2016, 08:33

The observer is not based on hall sensors, it is sensorless. However, there is an option to use hall sensors for aid at low speeds, but it also works without halls.

It should be easy to use the hall or observer position for position control as an option, I will have a look at implementing that. I don't know how well it will work though. I think it will be quite unstable at low speed, even if the gain is low.

wdaehn
Posts: 24
Joined: 10 Feb 2016, 10:21
[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: Positional control with halls

Postby wdaehn » 10 Feb 2016, 12:52

I second the request. And actually, it works quite well with my cable cam controller. As Dave is saying, the resultion is the same between Hall sensors and encoders.
With encoders you have a resolution of 1°. With Hall sensors you usually have a gear of some sort and hence the output has a resolution of 1° as well, although the Hall sensor themselves have a resolution of 15° or so.

wdaehn
Posts: 24
Joined: 10 Feb 2016, 10:21
[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: Positional control with halls

Postby wdaehn » 19 Feb 2016, 11:05

Hi Benjamin, would you care to comment? This feature would be super important for the cablecam project but also for all other industrial applications (servo motor instead of stepper motor).

The requirement is a positional control feature based on the Hall inputs of the motor. The resultion of 1-2 motor poles is more than sufficient as there is a high ratio gear attached to the motor always.

The goal would be, with the RC input you move the target point to e.g. 100'000 revolutions forward and the control loop tries to reach this point as quickly as possible and hold that position, regardless of the external force. The control loop accelerates via a defined max accel and keeps calculating the braking distance for the current speed based on this max accel value. If the current position + brakedistance exceeds the target point, then the motor starts the decelerate with that max accel. (It is assumed that the max accel value is by far less than what the controller can apply as brake force.)

Visualize a skateboard on a downhill street. Initially the target pos is zero, so the skateboard remains at the start point instead of rolling downhill. Then you tell it to move 100m downhill, it will accelerate slowly up to a top speed and then start braking to stop at position 100m. Then you tell it to drive -100m, it will accelerate with the same amount back to where you started.



Please see this file for my implementation in an external controller. PID loop generates an RC PPM signal and uses two Hall sensors connected to the 16bit hardware quadruple counter of the STM32F1.
https://github.com/wernerdaehn/CC3D-Cab ... ntroller.c

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

Re: Positional control with halls

Postby benjamin » 22 Feb 2016, 11:08

This is on my to-do list. I haven't had time to do any development the past days, but the next time I work on the VESC I will try using the hall/observer position for position control.

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

Re: Positional control with halls

Postby benjamin » 23 Feb 2016, 07:33

I gave this a try yesterday, and with some tweaks I got it working fairly well. I still need to do some improvements, but I will push the code in a few days.

dpetrillo
Posts: 25
Joined: 24 Dec 2015, 01:47
[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: Positional control with halls

Postby dpetrillo » 24 Feb 2016, 18:28

Thank you very much for adding that feature. It is very much appreciated and I think it will be a core function for many users. Can't wait to test it out.

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

Re: Positional control with halls

Postby benjamin » 24 Feb 2016, 20:45

I just pushed the code to github, so you can give it a try now. In the advanced tab of BLDC Tool, set the angle division parameter to 14 or so at first.

dpetrillo
Posts: 25
Joined: 24 Dec 2015, 01:47
[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: Positional control with halls

Postby dpetrillo » 26 Feb 2016, 19:41

Tried it out and tuned my motor. It works about as well as you could hope for with 6 degree resolution from the halls on my motor.

Can you explain a little bit more about what the angle division parameter does exactly?

So far I have observed that when I change it, it changes how many physical degrees of my motor map on to the positional degrees of the position controller. It also changes the control loop accordingly, so if I map 2 physical rotations of the motor to 360 degrees of position, I have to double everything in my pid loop to maintain the same performance.

Is there some reason you limit the positional control of the motor to 0-360 from the panel in the tool? Can I send larger moves from the terminal window? I guess when I have more time to play with this I will be playing with applications for position control with the can bus.


[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 “Feature Requests”

Who is online

Users browsing this forum: Bing [Bot] and 1 guest