Hello!
I am currently using the TMC6300 BLDC Motor Driver and on that board there is a pin “SEN” where current sensing can be seen when connected to an analog pin on a microcontroller (I am using an Arduino UNO).
I need this sense pin to read the current when the motor is moving to control the torque of the motor when it spins. To do this I am using the SimpleFOC library. But the constructor for the function requires two analog pins instead of just the one (I was planning to just hook up the sense pin to one of the analog ones on the Arduino).
I tried to test the sense pin by placing an oscilloscope to the sense pin and it’s ground with the VIN being 8V with the other ground connected to the power supply ground. The oscilloscope picked up no signals from the motor when spun.
I have several questions…
1. What is the actual output of the sense pin? Will is be the current flowing through the motor or will there be other signals that are coming through that pin as well that I need to filter out.
2. What will the other analog channel be hooked up to if there is only one sense pin? Below I provided what the SimpleFOC library says about the in-line current sense through the Arduino.
SimpleFOC website for In-line Current sensing:
// InlineCurrentSensor constructor
// - shunt_resistor - shunt resistor value
// - gain - current-sense op-amp gain
// - phA - A phase adc pin
// - phB - B phase adc pin
// - phC - C phase adc pin (optional)
InlineCurrentSense current_sense = InlineCurrentSense(0.01, 20, A0, A1, A2);
Field Oriented Control algorithm can run with both 2 or 3 phase current measurements. If measuring 2 out of 3 currents, when defining your InlineCurrentSense class put the flag _NC (not connected) to the phase value you are not using.
For example if measuring the current on phases A (analog pin A0) and C (analog pin A1) and not measuring the current on the phase B, then you’ll define your current sense class as:
// InlineCurrentSensor constructor
InlineCurrentSense current_sense = InlineCurrentSense(shunt_resistor, gain, A0, _NC, A1);
Some more examples:
// InlineCurrentSensor constructor
InlineCurrentSense current_sense = InlineCurrentSense(shunt_resistor, gain, _NC, A0, A1); // when measuring B and C phase currents and not measuring A
// InlineCurrentSensor constructor
InlineCurrentSense current_sense = InlineCurrentSense(shunt_resistor, gain, A0, A1, _NC); // when measuring A and B phase currents and not measuring C
// or
InlineCurrentSense current_sense = InlineCurrentSense(shunt_resistor, gain, A0, A1); // when measuring A and B phase currents and not measuring C
I hope I am understanding this correctly and any pointers would be greatly appreciated!