Page 1 of 2

questions about the sine cosine chip as5116

Posted: Wed Feb 01, 2023 2:20 pm
by Romale
hello everyone.
I want to use this chip, but there are questions about what kind of board to make for it, under what variant of the supply voltage and how to connect it correctly to the board v3 of johu.
Screenshot_20230201-153042.png
Screenshot_20230201-165524.png
thanks for the tips.

Re: questions about the sine cosine chip as5116

Posted: Wed Feb 01, 2023 3:31 pm
by Romale
IMG_20230201_182506_687_1.jpg
IMG_20230201_182506_315_1.jpg
the setting allows you to select a 3.3 or 5 volt power supply, also allows you to select the average voltage point, and the slider of the amplifier changes the maximum and minimum voltage.

Re: questions about the sine cosine chip as5116

Posted: Wed Feb 01, 2023 3:41 pm
by Pete9008
You may be able to feed the output from that directly into the two resolver sin and cos inputs (but without using the resolver excitation output lines). Not sure about this but it does look like it may then be compatible with the standard firmware.

Find it difficult to believe that a single magnet would give you any where near enough angle resolution/accuracy for good motor control though.

Re: questions about the sine cosine chip as5116

Posted: Wed Feb 01, 2023 3:58 pm
by Romale
Pete9008 wrote: Wed Feb 01, 2023 3:41 pm
Find it difficult to believe that a single magnet would give you any where near enough angle resolution/accuracy for good motor control though.

I used other chips from this manufacturer for the a/b encoder and for hall sensors.
tVUCe0-SmTU.jpg
it works perfectly. this chip that I want to use now can handle up to 30,000 rpm from one magnet. this indicates a very high accuracy.

Re: questions about the sine cosine chip as5116

Posted: Wed Feb 01, 2023 4:04 pm
by Pete9008
Fair enough, it will be a nice simple solution if it works :)

Re: questions about the sine cosine chip as5116

Posted: Wed Feb 01, 2023 6:51 pm
by johu
Yes those chips have been around for a while. Experimented with the Melexis one and it gave good resolution. This is what the encmode=sincos is meant for in conjunction with sincosofs for the midpoint.

Re: questions about the sine cosine chip as5116

Posted: Wed Feb 01, 2023 8:30 pm
by Romale
johu wrote: Wed Feb 01, 2023 6:51 pm Yes those chips have been around for a while. Experimented with the Melexis one and it gave good resolution. This is what the encmode=sincos is meant for in conjunction with sincosofs for the midpoint.
does this mean that the VCM level should be used 2.125, and the gain should be adjusted so that the amplitude does not exceed 3.3 volts?

Re: questions about the sine cosine chip as5116

Posted: Thu Feb 02, 2023 10:47 am
by johu
Ideally the midpoint is at 3.3/2=1.65V and the swing uses as much of the 0-3.3V range as possible.
But even midpoint 2.125 allows for 1.2V swing until it hits 3.3V so will be fine as well.

Re: questions about the sine cosine chip as5116

Posted: Fri Feb 03, 2023 10:43 am
by Romale
The settings support 1.375 or 2.125, so you can choose 1.375 and adjust the amplitude amplifier to a maximum of 3.3 volts.

however, if the middle point is 1.375, then with an amplitude reaching almost 3.3 volts, the lower point goes into a negative value. is this normal or is it better to reduce the gain so that all the sinusoids are in positive values?

also, I do not yet understand the option for the sine/cosine function (choose where there are only two lines of the graph or where there are dotted lines as well)?
IMG_20230203_133925_427.jpg
IMG_20230203_133921_555.jpg

Re: questions about the sine cosine chip as5116

Posted: Fri Feb 03, 2023 5:10 pm
by johu
You want just two lines and the signal mustn't go negative. 1.375V offset gives you 2.7V usable amplitude, that's certainly good enough and better than 2.3V when using 2.125V mid point.

Re: questions about the sine cosine chip as5116

Posted: Tue Mar 21, 2023 3:04 pm
by Romale
IMG_20230302_223917.jpg
IMG-20230310-WA0056.jpg


and so!
I received ready-made boards for sensors, I also received my purchase of microchips + kit programmer.
the first connection to the V3 OI board showed excellent work after the sincosofs settings and the firmware of the chip itself.

Re: questions about the sine cosine chip as5116

Posted: Tue Mar 21, 2023 3:06 pm
by Romale
only one thing confused me. I monitored the change in the angle of the "motor" in the settings console and there was a change from 0° to 320°, not 360°!! Is that right?

Re: questions about the sine cosine chip as5116

Posted: Tue Mar 21, 2023 3:30 pm
by Romale
I also have a question, do I need to configure the RESPOLEPAIRS field in the SynCos encoder mode? Judging by my setup program, it generates one full sine wave per revolution. Is it equal to 2 pairs of encoder poles?

Re: questions about the sine cosine chip as5116

Posted: Wed Apr 12, 2023 12:07 pm
by Romale
in general, it's time to install this on the motor and test it.
I will use the rear motor from Toyota Alphard, it is easy to modify the magnet in the center of the rotor.
however, I have doubts about the angle search algorithm with the new firmware! I first tried to adjust the angle on my Nissan motor, and it turned out that the motor does not rotate between 64000 and 1000. therefore, taking 65000 as the middle, I subtracted 32768 and entered the resulting value. at the same time, the engine was standing still. but after pressing the pedal, it began to rotate by itself at full speed!
when I returned the value 64000, the motor is working adequately!

Does this mean that the new algorithm for finding the sensor angle does not require subtracting or adding 32768 and you need to enter exactly the value at which the motor does not rotate?

Re: questions about the sine cosine chip as5116

Posted: Wed Apr 12, 2023 12:12 pm
by Romale
I also noticed a sad situation. When I bought the chips, I bought 10 pieces marked hall effect and 5 pieces ordinary. So these 10 do not want to be programmed in any way and always have all 4 signals with a voltage from 0 to 5 volts at the output ... I probably won't be able to use them. And 5 other chips I flash the setting so that the upper voltage is a maximum of 3.2 volts, and in reality then I get 3.7 volts at the output. Probably this will not work either, although the controller with such a chip connected in the angle sensor mode shows the rotation of the magnet adequately and gives 4 electrical turns for one physical one (although the magnet has one pair of poles, and I also prescribed this in the settings of the v3 OI board)

Re: questions about the sine cosine chip as5116

Posted: Wed Apr 12, 2023 5:34 pm
by Romale

Re: questions about the sine cosine chip as5116

Posted: Wed Apr 12, 2023 5:41 pm
by Romale
here you can see some settings for this sensor, as well as the gain settings of current sensors for the Honda ima inverter.
Screenshot_20230412-203850_1.png

Re: questions about the sine cosine chip as5116

Posted: Thu Apr 13, 2023 7:57 am
by Pete9008
Romale wrote: Wed Apr 12, 2023 12:12 pm I also noticed a sad situation. When I bought the chips, I bought 10 pieces marked hall effect and 5 pieces ordinary. So these 10 do not want to be programmed in any way and always have all 4 signals with a voltage from 0 to 5 volts at the output ... I probably won't be able to use them. And 5 other chips I flash the setting so that the upper voltage is a maximum of 3.2 volts, and in reality then I get 3.7 volts at the output. Probably this will not work either, although the controller with such a chip connected in the angle sensor mode shows the rotation of the magnet adequately and gives 4 electrical turns for one physical one (although the magnet has one pair of poles, and I also prescribed this in the settings of the v3 OI board)
Is it just the voltage that is wrong or are there other setting that are not right too? If it is just the voltage could you change the resistors on the input dividers to scale it down to the right value?

Re: questions about the sine cosine chip as5116

Posted: Thu Apr 13, 2023 8:19 am
by Romale
Pete9008 wrote: Thu Apr 13, 2023 7:57 am Is it just the voltage that is wrong or are there other setting that are not right too? If it is just the voltage could you change the resistors on the input dividers to scale it down to the right value?
high voltage and 4 sine waves without the ability to make two. I think it will be necessary to connect as a transformer sensor connecting s1 and s4 together.

Re: questions about the sine cosine chip as5116

Posted: Thu Apr 13, 2023 8:22 am
by Romale
Screenshot_20230413-112009_1.png

this is the form of the singal. how to connect it correctly so as not to burn the controller?

Re: questions about the sine cosine chip as5116

Posted: Thu Apr 13, 2023 3:37 pm
by Pete9008
Romale wrote: Thu Apr 13, 2023 8:19 am high voltage and 4 sine waves without the ability to make two. I think it will be necessary to connect as a transformer sensor connecting s1 and s4 together.
Can't you just use the two that give the positive sin and cos signals (but with a resistive divider to reduce the levels) and leave the other two unconnected? Or is there something different about the signals in the two modes?

Re: questions about the sine cosine chip as5116

Posted: Thu Apr 13, 2023 5:08 pm
by Romale
I don't know at the moment. later I will try to make a resistive divider and check. But in the version of the chip that is programmed, it matters and two wires are used for each signal. relative to the minus, the signal will be completely different already.
I will definitely check later, I ordered new boards for them with correctly calculated voltage dividers)

Re: questions about the sine cosine chip as5116

Posted: Thu Apr 13, 2023 7:33 pm
by Pete9008
Just had a quick look at the data sheet and am fairly sure that the positive output signals are the same regardless of 2 or 4 wire mode. The common mode voltage does change if in 5V mode though. Scaling the output by 0.66 should get you back the the right common mode voltage and full scale voltage for the OI inputs though.

Also looks like the output voltage is dependant on magnet strength and the distance to the magnet so the gains really needs to be set up once everything is in its final positions.

Hadn't realised that these things were one time programmable - once you save the configuration the setting is permanent!

Re: questions about the sine cosine chip as5116

Posted: Fri Apr 14, 2023 10:43 pm
by Romale
Pete9008 wrote: Thu Apr 13, 2023 7:33 pm Just had a quick look at the data sheet and am fairly sure that the positive output signals are the same regardless of 2 or 4 wire mode. The common mode voltage does change if in 5V mode though. Scaling the output by 0.66 should get you back the the right common mode voltage and full scale voltage for the OI inputs though.

I tried a non-programmable hall effect chip with a voltage divider. does not work. the controller sees the position of the rotor, the maximum voltage between the minus power supply and the sine was 2.85 volts and the minimum 0.2 volts. I calculated the midpoint as indicated in the settings description and tried to calibrate the angle. the motor never spun, only squeaked slightly. Then I just started the controller in normal mode and changing the angle by two thousand units I tried to press the accelerator pedal, only in a narrow range the motor cracked slightly and slowly rotated, and in the rest the battery current simply increased without rotating the motor. I also tried to measure the voltage between the sine and the sine minus output, it varied from +3 to -3 volts. Conclusion, the as5116A chip on the hall effect does not suit us! It is not clear why it is not programmed, while the same chip without letters (as5116) is perfectly configured and works with our controllers.

Re: questions about the sine cosine chip as5116

Posted: Sat Apr 15, 2023 10:19 am
by Pete9008
Romale wrote: Fri Apr 14, 2023 10:43 pm I tried a non-programmable hall effect chip with a voltage divider. does not work. the controller sees the position of the rotor, the maximum voltage between the minus power supply and the sine was 2.85 volts and the minimum 0.2 volts. I calculated the midpoint as indicated in the settings description and tried to calibrate the angle. the motor never spun, only squeaked slightly. Then I just started the controller in normal mode and changing the angle by two thousand units I tried to press the accelerator pedal, only in a narrow range the motor cracked slightly and slowly rotated, and in the rest the battery current simply increased without rotating the motor. I also tried to measure the voltage between the sine and the sine minus output, it varied from +3 to -3 volts. Conclusion, the as5116A chip on the hall effect does not suit us! It is not clear why it is not programmed, while the same chip without letters (as5116) is perfectly configured and works with our controllers.
Surprised by that, it looks like it should work. Had another look at the data sheet and found this description of the AS5116A configuration:
as5116a.png
It looks like it should be fine apart from the 5V operation which the resistive divider should fix.

I can only think of two explanations. Either the phasing/polarity of the outputs does not match your OI setup or the 31.5mV/mT gain set on the A version is too high for your magnet configuration and the outputs are saturating in some rotor positions. Would it be worth plotting sin, cos and angle while rotating the motor manually to see? What gain setting did you find worked on the programmable version of the chip?