SIN COS Encoder on FBL Series

4 years 7 months ago #29531723 by methods
This is methods from EM.

Experience Level: 1 year experience in Brushed and BLDC RoboteQ tuning and operation.

Controller: FBL2360

Encoder: SIN/COS, 2Vp-p, riding on 2.5V DC. (We also have a 1Vp-p variety)

Motor: BLDC Hub Motor, 20 poles, 14KV

Test Setup: COS is running into pin 9. SIN is running into pin 10. 5.000V is supplied externally to the encoder. Ground is referenced to pin 1. Phase leads are connected. No other hall sensor is connected. Primary voltage is 50V with a 50A current limit.

Results: The encoder reads out in RoboRun as a count from ~0 to 512 upon rotation. Is this expected? 2.5V + 1V = 3.5V. Vref = 5V. 70% of full range on the ADC... 512 - that works out to 9 bits... so... the ADC is rated @ 1mV resolution over 5V... so its a 12bit ADC. @ 2V p-p I would expect to see a range of more like 0-2048 if we have 1mV resolution.

The motor does not perform as expected in either open or closed loop. After some basic tuning we can get it to "sit still" without drawing hold current. Upon application of throttle excitation (forward and backward) the motor will sometimes make large cog-steps (far in excess of the minimal electrical step) but it will not "run".

We have tried fiddling most of the basic settings (we are intimately familiar with both the brushed and bldc controllers under control through RoboRun.)

Swapping SIN/COS makes no difference.

NOTE: Interesting Observation... if we physically rotate the magnet that excites the hall sensor the motor will turn while the throttle is set to 10%. For a 90 degree rotation of the magnet the motor turns just a handful of degrees.

NOTE: We can not find any documentation on implementation of SIN/COS encoders in either the FBL specific manual or the overarching manual. Is there any documentation that we should reference?

NOTE: In our application the magnetic SIN/COS sensor is fixed to the axle which is fixed to the stator. The magnet ring (outrunner) rotates freely and the magnet is fixed to this rotating assembly such that it excites the sensor. On the scope the sensor puts out a perfect 2Vp-p signal around a 2.50V DC bias when excited with 5.00V DC with the magnet rotating. In freewheel the output is very clean with no clipping or bit-noise.


Please Log in or Create an account to join the conversation.

4 years 7 months ago #29531728 by niko
Replied by niko on topic SIN COS Encoder on FBL Series

We apologise for the lack of documentation. We are working on that. For the moment follow the instructions below. If you still face problems send e-mail to This email address is being protected from spambots. You need JavaScript enabled to view it. in order to have a look at it together.

Setup and Test the Sin/Cos Encoder Feedback Mode
Sin/Cos encoders are absolute devices. A one-time setup and calibration must be performed in order to calibrate the encoder’s voltage levels, and set the mechanical zero degree angle offset.

The first calibration step measures and stores the minimum and maximum voltages of the encoder’s signals at of each of the controller’s inputs:
After the controller is configured in Sinusoidal mode with Sin/Cos Feedback, from the console, type:
%CLMOD 2 for motor channel 1
%CLMOD 3 for motor channel 2
This will cause the controller to enter the calibration mode. Move the shaft of the motor slowly by hand in order to make a couple of full mechanical turns.
Then press %CLMO 0 (for either motor channels) in order to get out of the calibration mode.
Pressing the command ~ZSMC you can see the calibration values (3 first values for motor 1 and the other 3 for motor 2). Verify that the values are different than 0.
In order to save the calibration values permanently to flash type
%CLSAV 321654987.
You can verify that the sensor works, enable the Angle capture in the Roborun chart. Then move the shaft by hand and verify that the reported angle smoothly ramps from 0 to 512 (512 = 360 electrical degrees).
Once the sensor is verified to be working, a one-time calibration must be performed to captures the mechanical offset of the sensor. In most cases, a small difference exists between the 0 degrees from the sensor vs the actual 0 degrees of the motor. Verify that the motor shaft is rotating freely. Then perform a Zero Angle reference search (See XREF Sinusoidal Zero-Angle Reference Search and Adjustments).

Single Pole vs Multi Pole Sin/Cos sensors
Some sin/cos sensors will produce a full 360 degrees output for each full 360 mechanical turns. These are single pole sensors. Other sensors have multiple poles, meaning that the sine or cosine signal will perform two or more full 360 degrees cycles for every mechanical cycles. The number of sensor poles is a critical configuration parameter which must be set using the Sensor Poles menu. It can also be set from the console or serial port with

^SPOL ch poles

Sinusoidal Zero-Angle Reference Search Process
Most angle sensors will not give an accurate absolute position of the rotor. Incremental encoder give relative position by their nature and must be set with a reference angle at every power up.
Absolute sensors like SPI or Sin/Cos are not always mounted with a precise zero-degree reference and must be calibrated at least one time.

A reference search can be initiated manually by sending the serial command:

!BND 1 for channel 1
!BND 2 for channel 2
The controller will then respond by energizing the U, V and W coils with the voltages levels needed to force the rotor to move to predetermined positions. The sequence is +90, -90, +90, -90, +90 and back to -90 electrical degrees. The reference search is considered a success if the rotor correctly reached the last four end position. The motor will they then be allowed to operate

If the reference search failed, the Bind Error LED will appear in red in the Run screen of the PC utility. The motor will then not be energized if a command is sent.

For the reference search to work, the motor must be free to move at least a full electrical turn (mechanical turn divided by the number of pole pairs). If a brake is present, it must be disengaged during the search sequence.

The amount of current (ie torque) that the controller will apply to the motor for the search is set in the Reference Seek Power menu of the configuration utility, or the serial command:

^BZPW ch Amps*10

Verify then that in open loop, the motor spins at the same speed in the forward or reverse direction when the same command is given with different signs. If the motor rotates at different speeds and/or draws a significantly different amount of current in each direction, the zero degree reference was not captured correctly.

Please Log in or Create an account to join the conversation.

Moderators: tonysantoni
Time to create page: 0.091 seconds