This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PyPilot works for me!
#11
I received an VNH5019 the other day and trying to wire it up. 
It has ENA and ENB but no EN, or is another pin for that? 

At the moment pypilot gives voltage error and a few more.

Thanks!
Reply
#12
CapnKernel,

If you haven't already figured this out, you can get current sense out of the VNC5019 into the nano with a small code change.

Change this line (around line 790):
return v * 9 / 34 / 16;
to:
return v * .149;
Connect cs on VHH5019 to pin A1 on nano.

The data sheet says it is more accurate at higher currents and I have found that to be true.
Reply
#13
you might want to be careful using floating point math, it's very slow and can affect timing of other operations but in this case possibly does not matter.
Reply
#14
(2020-02-18, 02:14 AM)seandepagnier Wrote: you might want to be careful using floating point math, it's very slow and can affect timing of other operations but in this case possibly does not matter.

Any suggestions? If you haven't figured out yet coding isn't my thing.

Would something more like "return v * 149 / 1000;" be better?

The VNH5019 data sheet says it produces 149 mv per amp.

Thanks
Reply
#15
There are also results shifted by 4 bits so need to divide 16 also.

So yes, *149 / 1000 / 16, or * 15/1000/16 for no floating point.
Reply
#16
Thanks for the help!
Reply
#17
(2020-02-18, 02:12 AM)Opie91 Wrote: If you haven't already figured this out, you can get current sense out of the VNC5019 into the nano with a small code change.

Thanks.  I'm currently working on a PCB for my next version, and it'll have a voltage divider for current sense, ie, fix it in hardware. I'm just going to play with resistor values when I bring up the board.  

  https://imgur.com/a/mUiD2ew
  https://www.youtube.com/watch?v=g4VxC4J-EMI

I hope to be able to run stock motor controller code with no changes except for the VNH #define.

The red "dumbbell" shaped components are cuttable/solderable links to help me debug and alter the board.  Fitting everything onto a 10x10cm PCB is a bit of a challenge!
Reply
#18
(2020-02-21, 01:43 AM)CapnKernel Wrote:
(2020-02-18, 02:12 AM)Opie91 Wrote: If you haven't already figured this out, you can get current sense out of the VNC5019 into the nano with a small code change.

Thanks.  I'm currently working on a PCB for my next version, and it'll have a voltage divider for current sense, ie, fix it in hardware. I'm just going to play with resistor values when I bring up the board.  

  https://imgur.com/a/mUiD2ew
  https://www.youtube.com/watch?v=g4VxC4J-EMI

I hope to be able to run stock motor controller code with no changes except for the VNH #define.

The red "dumbbell" shaped components are cuttable/solderable links to help me debug and alter the board.  Fitting everything onto a 10x10cm PCB is a bit of a challenge!

Those look great, I've been working on a much simpler design (more in my skill set), one for the pypilot and one for the motor controller using a VNH5019


   


Planning on having the pi zero w mounted on the underside of the board and the display/everything else on top in one of these cases: Case
Not cheap, but has a nice door to get inside.


   


Same case for this one too.

Ill be real interested to see yours when it works out.
Reply
#19
(2020-02-21, 02:49 AM)Opie91 Wrote: Those look great, I've been working on a much simpler design (more in my skill set), one for the pypilot and one for the motor controller using a VNH5019

That looks nice.  What is the BAS4002A for?  (I could never work it out, or get an answer here)

(2020-02-21, 02:49 AM)Opie91 Wrote: in one of these cases:
Not cheap, but has a nice door to get inside.

That looks nice.  I want something a bit thinner.

(2020-02-21, 02:49 AM)Opie91 Wrote: Ill be real interested to see yours when it works out.

I'll post pics!  Smile
Reply
#20
Hi All,

I'm currently building a prototype with the setup in this topic as example. I got tinypilot installed on an RPI zero with the MPU 9250 and that is working fine, I can connect to the wifi and can use the web client to control this.

I setup the motorcontroller with a nano and the VNH5019. loaded it with the motor.ino software and made sure these four command line where out of comment.
#define VNH2SP30 // defined if this board is used
#define DISABLE_TEMP_SENSE // if no temp sensors avoid errors
#define DISABLE_VOLTAGE_SENSE // if no voltage sense
#define DISABLE_RUDDER_SENSE // if no rudder sense

connection betweet RPi and arduino is currently via USB cable but the tinypilot shows: "no motor controller" under autopilot errors. Switched out the Arduino allready but same issue.

What am i missing? Side note, I'm not a programmer but do understand the principles zo with a bit off guidance should be able to figure this out?

thanks in advance
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)