Allegro acs756 current sensor for arducopter

allegro current sensor

allegro.jpg?height=297&width=400


allegro2.jpg?height=254&width=400


The sensor is galvanically isolated from the circuit, but in contrast to the classical current sensor shows not only the battery discharge and charge it (eg energy recovery in airplanes)
but because of this, at zero current output, exactly half the supply voltage (for classical sensors autopilot 0) ie 2.5 volts.

to correct this misunderstanding to change firmware code



defines.h  change

#define CURRENT_AMPS(x) ((x*(g.input_voltage/1024.0))-g.curr_amps_offset)*g.curr_amp_per_volt

 

parameters.pde add

    // @Param: AMP_OFFSET
    // @DisplayName: current sensor zero calibration
    // @Description: in volts
    GSCALAR(curr_amps_offset,      "AMP_OFFSET", CURR_AMPS_OFFSET),




parameters.h  add
 

      k_param_curr_amps_offset = 193,



      AP_Float        curr_amps_offset;




//#ifndef CURR_AMPS_OFFSET   
 # define CURR_AMPS_OFFSET               0.0
//#endif

allegro4.jpg?height=400&width=340

archive with source and HEX file for quaid "x"  APM2 here

E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones

Comments

  • my X8 can pull up to 531 amps so can I even use a current sensor?

  • @William: sorry, very late reply - just came across your question by accident.

    Short Answer: the unidirectional versions map currents from zero to max_current to output voltages between 0V and 5V, whereas the bidirectional ones match the range from negative max_current to positive max_current to 0V - 5V.

    Thus zero current equals an output value of 2.5V.

    As your copter does not have any brakes feeding current back into the battery (I suppose ;-) ) a unipolar version of the circuit will be better for your application.

    Greetings

    Harald

  • Thanks!!!!

  • checkout 3.1.1 rc2 from github(master branch) and you have it! I have testet!

  • somebody ask Randy include this in the official firmware

  • I have compiled 3.1.1 rc2 with AMP_OFFSET is out of the box. thumbs up!

  • Hi, I would be really grateful if someone could give me some advice regarding the allegro sensors. My octocopter has the potential to draw a high current (about 180amps) so looking at the Allegro ACS758 200 Amp Series Hall Current Sensor, is it appropriate? Also should I get the Bi-directional or uni-directional version, I don't understand the difference. Thanks.

  • I offered Randy enable this setting in the official firmware
    he either missed my post, or ignored.
    try someone  to write about it again to Randy

    ps

    and arduplane this parameter has made​​.

  • One thing to watch out for is that, in ArduCopter 2.9.1, parameters have been added and "k_param_curr_amps_offset = 193" will conflict with another parameter (resulting in the "AMP_OFFSET" value not saving to the non-volatile memory). A higher value needs to be used, like "k_param_curr_amps_offset = 199".
    --ET

  • There doesn't seem to be any sign of a new "AMP_OFFSET" parameter in the ArduCopter v2.9.1 release (contrary to Andrew's 11/20/2012 comment). Would be great if it's added soon so we don't have to keep "hacking" it in.
    --ET

This reply was deleted.