cancel
Showing results for 
Search instead for 
Did you mean: 

How to configure for dual motor feedback

mikemike9141
Associate III
Posted on December 11, 2014 at 16:05

Hi,

I am trying to use the FOC4.0 library with dual rotor angle feedback, namely hall plus encoder. I can set this configuration via the GUI (I have to manually edit the generated header files because of a bug in the tool, creating a wrong #define), but when compiling this setting, I end up with compiler errors.

Digging deeper into the code, it seems that the library is not prepared for this configuration. For dual sensor mode, I understand that I will need an interrupt service handler for the encoder, and a second one for the hall sensor. Unfortunately the module containing these handlers just creates one handler that can be configured for the one, or the other, but does not handle both of them.

So I have the question, is this issue known, and perhaps already solved? If not, I would need some help suggesting the necessary additions and modifications.

Kind Regards

Frank
3 REPLIES 3
Gigi
Senior
Posted on December 12, 2014 at 14:14

Ciao Frank

The dual sensored configuration is not a configuration that we usually test.

The FW lib. it self shall be ready to support it. But the user project (interrupt, etc..) maybe not and also the WB. I can't investigate deeper in this moment but I can take note for later analisys.

As general suggestion, you are right, is necessary to define the two interrupt service routine one for each sensor in order to work with both sensor, you can do it manually overriding the generated one taking as guideline the one generated by the WB.

Ciao

Gigi

mikemike9141
Associate III
Posted on March 13, 2015 at 09:52

Hi Gigi,

sorry for the long delay, i was busy redesigning the entire power stage because of that crappy IRS2184 drivers destroying the power transistors. Now everything is smooth, and I can concentrate on software again.

Thanks for your feedback, I will copy your idea to use WB to create the interrupt code for both sensors and manually merge the results.

The idea behind having two sensors in parallel for our servo application is the following:

- both hall and encoder are digital, so easy to deploy, simple interfaces, without having to fear EMI issues

- hall is good for startup but gives unprecise angle. We need instantaneous (stall) torque at power-on, but can (shortly) accept increased current consumption. Second drawback is low bandwidth speed feedback at low or zero rpm, resulting in strong cogging and/or the need for reduced speed control loop gain. Furthermore, many motor hall systems have high to very high mechanical tolerances. We observed as much as 20% difference in current consumption when spinning a standard servo motor (H4 type, 1.5kW) in either direction under nominal load.

- encoder needs to be referenced first but provides exact angle and good speed feedback thereafter. So we switch over to this sensor as soon as we see the index channel pulse.

- all sensors that provide absolute and precise rotor angle information are more complex to integrate: Resolver involves low-amplitude analog signals, integrated digital solutions come at higher cost.

Regards

Frank

Laurent Ca...
Lead II

The question has been moved from the "Motor Control Hardware" section to the "STM32 Motor Control" section (the question is about the STM32 MC SDK). 

Best regards