Other voltage scaling.

Discussions regarding the Field Oriented Control (FOC) implementation on the VESC.
rew
Posts: 943
Joined: 25 Mar 2016, 12:29
Location: Delft, Netherlands.
[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

Other voltage scaling.

Postby rew » 09 Aug 2017, 15:31

I'm working towards a higher-voltage version of the VESC.

So towards that goal I've mounted 100k top-side resistors instead of the normal 39k ones. I have changed "hwconf/<myhardware>.h" and the "battery voltage" readback is correct.

However, when I try "FOC->measure R & L", I get values that are WAY off compared to what other VESC-hardware versions (incl VESC6) (with the normal 39k) measured.

I just measured the resistance of between the terminals of the motor, and I get 33.2 mOhm. My VESC now measures 35.7. You'd say that's reasonably close, but that would be of single coil in Y configuration. So, when I measure 33.2 terminal to terminal I should get 16.6 ohm as the value in VESC. I can't completely explain this with the 39k/100k factor.

The inductance is measured at 18.7 micro henries. This is about a factor of ten below the real value.


With a DT750 connected I could spin the motor, even in FOC mode, after simply hitting measure R&L measure lambda, apply.

Does anybody know where there are other places in the source that I need to adjust when changing the voltage divider?

pf26
Posts: 310
Joined: 28 Mar 2016, 14:37
Location: FR Valence
[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: Other voltage scaling.

Postby pf26 » 10 Aug 2017, 08:18

I vaguely remember a thread where the voltage divider was said to be hard coded in bldc-tools and possibly used for R and L calculations. I could not find this thread again, but it might be wise to also have a look at the bldctools implementation. Just a guess..

ragonamuffin
Posts: 37
Joined: 04 Apr 2017, 02:08
Location: CT, USA
[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: Other voltage scaling.

Postby ragonamuffin » 11 Aug 2017, 12:33

From what I have seen lizardmech is the only person to successfully make a high voltage VESC. I have not clicked on every thread in this forum so its very possible someone else has developed one too. Thor is working on a high voltage controller too as you know (saw you post in the thread) but I'm not sure he has gotten it to work at higher voltages.

rew
Posts: 943
Joined: 25 Mar 2016, 12:29
Location: Delft, Netherlands.
[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: Other voltage scaling.

Postby rew » 11 Aug 2017, 14:57

My memory is not what it used to be. I appreciate your pointers. :-)

One-step-at-a-time... My ACS758-200B current sensors have a sensitivity of 6.6mV/A. (the datasheet says 10mV/A, but the output is ratiometric to the supply voltage. The idea is that you can base your ADC conversion factor calculations on 5.0000V and still get precise results if your powersupply happens to be 5.2V.

Anyway, I'm telling the firmware that I have a 1mOhm shunt. 1mV/A. Then I'm telling it that I have a 6.6 times amplifier... for 6.6mV/A sensitivity. I'm "back to basics" and I have connected my lab powersupply across the sensor. Injecting "2A" gives me a "current plot" that indicates 1.3A.... :-(

ragonamuffin
Posts: 37
Joined: 04 Apr 2017, 02:08
Location: CT, USA
[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: Other voltage scaling.

Postby ragonamuffin » 12 Aug 2017, 13:16

Oh no! I should put an LDO on my ACS770..... I didn't even think about that! Just as I had that thought a fortune cookie fortune blew off my table that read "nothing's perfect." I put fortunes around my house to let the universe give me little signs. I guess I'll take that as a sign to go ahead with my project. :lol:

Are you supplying it with 3.3v?

How does the microcontroller know how much the supply has dropped/raised? Does it sample it through a voltage divider into an ADC pin while also reading the ACS? That might be how I will do it.

So I went ahead and ran a calculation for you:

(1.3A/2A) = (X/10mV)
X = 6.5mV

My suggestion: have you tried inputting 10 times for the amplifier?

rew
Posts: 943
Joined: 25 Mar 2016, 12:29
Location: Delft, Netherlands.
[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: Other voltage scaling.

Postby rew » 12 Aug 2017, 16:39

As far as I read the datasheet, the '770 cannot be fed 3.3V: min 4.5, max 5.5V.
The '758 has min: 3.0V.

I had "lots of noise" on the current measurements. This was caused by the CPU drawing 20-40mA (just a guess) in bursts spaced 50microseconds apart. (20kHz). Putting an LDO from the 5V to power JUST the current sensors helped.... absolutely nothing. The sudden current draw would also cause the 5V to show a 20mV dip, and that would propagate through the 3.3V regulator for the current sensors without any problem. I put some extra 100uF MLCC caps on the 5V and 3.3V and now things are about 10x quieter. (2mV RMS noise).

The ACS sensors are meant for you to calcuate based on say 5.000V powersupply. Then the sensitivity is supposed to be 10mV/A and the zero current, mid-voltage is going to be 2.5V. Now you put this into an ADC with that 5V reference voltage, with say 10 bits of precision, you're going to get the mid-code: 512 from your ADC.

Now we put 20A through the sensor, 200mV of voltage rise on the sensor output, 2.7V, now your ADC will read 2.7/5.0*1024=553, which you'll interpret as 20A.

Now let us suppose the power supply is not 5.0V but 5.400V. The mid voltage, zero current will be 2.7V. Feed your ADC with the same 5.4V and you'll get the same 512 ADC code. Pass 20A through the sensor, and you might expect the voltage to rise the same 200mV to 2.9V. so now you might expect to see ADC code 2.9/5.4*1024=550, leading you to think that the current is less than 20A. However the sensor is ratiometric. With an 8% higher power supply, the sensitivity is also 8% higher. So not 10mV/A but 10.8mV/A. So the voltage rise will not be 200mV, but 216mV. You will see ADC code 2.916/5.4*1024 = 553. So you can pretend your powersupply is exactly 5V and the sensitivity is 10mV/A and everything will work out just fine.

Anyway....
bldc_tool.png
bldc_tool.png (126.32 KiB) Viewed 2103 times


I'll have to hack BLDC_tool, because it won't allow me to increase the battery_max above 60.... :-(

Update: That was easy to do. Something blew up when I tried to run the motor. :-(

ragonamuffin
Posts: 37
Joined: 04 Apr 2017, 02:08
Location: CT, USA
[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: Other voltage scaling.

Postby ragonamuffin » 12 Aug 2017, 22:22

Oh man... Sorry to hear. Any idea what released all its magic smoke?

I heard you say 758 which is why I asked if it was 3.3v. Good to hear you cleaned up that part of the circuit! Looks like I will put in a big capacitor to make sure I don't have that problem as well.

Were you inputting 5V into the LDO? It needs more than 5V to make a stable 5V signal. I had to ask. I make mistakes like this so just making sure.

rew
Posts: 943
Joined: 25 Mar 2016, 12:29
Location: Delft, Netherlands.
[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: Other voltage scaling.

Postby rew » 13 Aug 2017, 08:13


ragonamuffin
Posts: 37
Joined: 04 Apr 2017, 02:08
Location: CT, USA
[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: Other voltage scaling.

Postby ragonamuffin » 14 Aug 2017, 09:47

I'm so sorry to hear.... :(

I decided to take a step back from making my motor controller and get back to the battery management system I have been designing along with a control system I have been perfecting for 6 years. I hope to release my product a little before black friday so wealthy people can start purchasing them.

rew
Posts: 943
Joined: 25 Mar 2016, 12:29
Location: Delft, Netherlands.
[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: Other voltage scaling.

Postby rew » 15 Aug 2017, 05:52

After I blew up everything I decided to work on my BMS as well. But I didn't get further than getting the hardware out. :-(


[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 “FOC”

Who is online

Users browsing this forum: No registered users and 3 guests