OpenMarine
PyPilot works for me! - Printable Version

+- OpenMarine (https://forum.openmarine.net)
+-- Forum: Pypilot (https://forum.openmarine.net/forumdisplay.php?fid=17)
+--- Forum: General discussion (https://forum.openmarine.net/forumdisplay.php?fid=18)
+--- Thread: PyPilot works for me! (/showthread.php?tid=2228)

Pages: 1 2 3


RE: PyPilot works for me! - marinopi - 2020-02-14

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!


RE: PyPilot works for me! - Opie91 - 2020-02-18

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.


RE: PyPilot works for me! - seandepagnier - 2020-02-18

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.


RE: PyPilot works for me! - Opie91 - 2020-02-18

(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


RE: PyPilot works for me! - seandepagnier - 2020-02-18

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.


RE: PyPilot works for me! - Opie91 - 2020-02-18

Thanks for the help!


RE: PyPilot works for me! - CapnKernel - 2020-02-21

(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!


RE: PyPilot works for me! - Opie91 - 2020-02-21

(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.


RE: PyPilot works for me! - CapnKernel - 2020-02-22

(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


RE: PyPilot works for me! - HugoG - 2020-04-03

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