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.

  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
strange behaivour
#1
Hello!

I am trying to set up openplotter with pypilot and ST4000 wheel helm motor for my boat on my table.
Everything working fine and i am really encouraged by this project, but i don't understand strange reaction of pypilot to heading change

i recorded the video to explain my thought.
https://www.youtube.com/watch?v=ZOmwjq59...e=youtu.be

I am using OPENCPN plugin. IMU calibrated and pointed to heading correctly.

When autopilot not in engaged mode i am pushing the buttons (left and right) and the motor move wheel respecfully (left button -> CCW, right button ->CW)
but if i engaging  autopilot and move IMU to simulate the boat change course CCW, autopilot move motor CCW also (i suppose it is should move motor to CW to compenate offset and return to course, right?) and vise versa.

Could you please tell me , what i am doing wrong or i have missed something?
I am trying to setup autopilot on home table as much as possible, before i will able to set in and try on my boat.

sorry for bad english.
  Reply
#2
there is a post of someone having a similar problem but it was the plugin buttons reversed.but i could not find it.
if you switch "reverse" the wires on the motor it should then be correct on the imu .
mare liberum
  Reply
#3
Sorry i thought i had lastest plugin, but i was wrong

It is look like buttons are reversed in preinstalled plugin indeed, which confused me to change motor polarity accordingly.
I've just compiled and installed latest opencpn plugin (0.9.0), reversed motor polarity and everything works like charm!

Thanks you!
  Reply
#4
Looks interesting, which motor controller are you using?
  Reply
#5
(06-13-2019, 09:37 AM)PaddyB Wrote: Looks interesting, which motor controller are you using?

I've ordered two vnh2sp30 on sepparate stores in aliexpress first, but both not worked (it is moved forward, but no reverse. Current sensing works ok)
Then i bought IBT_2 board with BTS7960 chips in local store
[Image: IBT-2Module.jpg]
It is huge with radiator but works fine in both directions (after slight modification of motor.ino). Current sensing working as well.

My initial setup is Raspberry PI 3B+ with mpu9255 based imu and Arduino Nano for motor controller and rudder sensor (potentiometer already linked to quadrant by PO). 
For the first time i am using one big enclosure for everything (except IMU) and going to place it in cockpit near wheel. But in future i hope to place Raspberry to somewhere in nav vstation.

Month ago i have sailed from eastern side of Japan to South Korea. It is only 600nm but it was like nightmare doing it without autopilot. 
Next month i am going to do next passage -  from Korea to Vladivostok
so, i really crossed my fingers for new autopilot will work and i hope to debug it underway
Also i am going to try AIS reception with SDR USB stick
  Reply
#6
(06-13-2019, 11:18 PM)beholder77 Wrote: Month ago i have sailed from eastern side of Japan to South Korea. It is only 600nm but it was like nightmare doing it without autopilot. 
Next month i am going to do next passage -  from Korea to Vladivostok
so, i really crossed my fingers for new autopilot will work and i hope to debug it underway
Also i am going to try AIS reception with SDR USB stick

Wow!! That's hardcore  Cool 

AIS is great, good luck with the autopilot.
  Reply
#7
   
(06-13-2019, 11:18 PM)beholder77 Wrote:
(06-13-2019, 09:37 AM)PaddyB Wrote: Looks interesting, which motor controller are you using?

I've ordered two vnh2sp30 on sepparate stores in aliexpress first, but both not worked (it is moved forward, but no reverse. Current sensing works ok)
Then i bought IBT_2 board with BTS7960 chips in local store
[Image: IBT-2Module.jpg]
It is huge with radiator but works fine in both directions (after slight modification of motor.ino). Current sensing working as well.

My initial setup is Raspberry PI 3B+ with mpu9255 based imu and Arduino Nano for motor controller and rudder sensor (potentiometer already linked to quadrant by PO). 
For the first time i am using one big enclosure for everything (except IMU) and going to place it in cockpit near wheel. But in future i hope to place Raspberry to somewhere in nav vstation.

Month ago i have sailed from eastern side of Japan to South Korea. It is only 600nm but it was like nightmare doing it without autopilot. 
Next month i am going to do next passage -  from Korea to Vladivostok
so, i really crossed my fingers for new autopilot will work and i hope to debug it underway
Also i am going to try AIS reception with SDR USB stick

Hello!
I'm really glad to read your notes, as I'm at the point where I need to find a motor-controller.  The IBT_2 looks very promising! I just ordered one from Amazon for $12. I'd really like to know what modifications you made to motor.ino to make it work. And it would be great if you take notes and share them as you go through the debugging work.

My IMU is mounted on an AIS receiver hat, which in turn is on an RPi3B+. I'm thinking of  positioning the motor controller mounted dry in the binnacle, and commanding it remotely via wifi.  The RPi will be very dry, mounted at the pilot's station below decks.

I don't have a plan yet for how to command the motorcontroller, except that it will entail some kind of serial network tunnel via a discrete port with no other traffic on it. Also, some kind of handheld remote at the binnacle to bump it left or right: maybe a 315mHz type 4-button generic.

My motor is from an old Autohelm 3000, which this system will replace.

You are indeed a very salty sailor, and your English is fine. Thank you for sharing!
  Reply
#8
(06-17-2019, 08:41 AM)skyeyedoc Wrote: Hello!
I'm really glad to read your notes, as I'm at the point where I need to find a motor-controller.  The IBT_2 looks very promising! I just ordered one from Amazon for $12. I'd really like to know what modifications you made to motor.ino to make it work. And it would be great if you take notes and share them as you go through the debugging work.

My IMU is mounted on an AIS receiver hat, which in turn is on an RPi3B+. I'm thinking of  positioning the motor controller mounted dry in the binnacle, and commanding it remotely via wifi.  The RPi will be very dry, mounted at the pilot's station below decks.

I don't have a plan yet for how to command the motorcontroller, except that it will entail some kind of serial network tunnel via a discrete port with no other traffic on it. Also, some kind of handheld remote at the binnacle to bump it left or right: maybe a 315mHz type 4-button generic.

My motor is from an old Autohelm 3000, which this system will replace.

You are indeed a very salty sailor, and your English is fine. Thank you for sharing!

Thank you for kind words!

I've attached my motor.ino
https://drive.google.com/file/d/1DTk2Tne...sp=sharing
Most of changes was made in "position" function and was some kind of intuitive...

Here it is picture from IBT_2 description:
[Image: IBT-2-Input-Ports.jpg]
which means that IBT_2 needs R_EN and L_EN both HIGH level to make motor working.
and has sepparate PWM channels for each direction.

So, my wiring in accordance with changed motor.ino sketch:
IBT_2         ARDUINO
+5V              5v
GND              GND
R_EN+L_EN      D2
R_IS+L_IS          A1 (with voltage divider)
L_PWM              D9
R_PWM              D10


One important note - according to BTS7960 datasheet CS (current sense) voltage in case of maximum values of current could be up to 7 volts, which is can be deadly for arduino, so i used voltage divider with 50k and 10k resitors

I am a not any kind of electronics pro, so please double check my solutions... They could be incorrect or not optimal at least.

Sorry, not able to attach motor.ino here, so i uploaded to google drive
https://drive.google.com/file/d/1DTk2Tne...sp=sharing
  Reply
#9
Thank you! This should be very helpful!
  Reply
#10
Hi, beholder!

Ok. I've got my IBT_2 in. I've decided to build this starting from the motor working back to the pypilot. I'm going to work with a serial connection to the controller at first, and try to make wifi work later. 

I'd like to know if the Arduino Nano you are working with is Ver.3, or some other? (This may not matter, but I'd like to clone your model as closely as I can). 

Could you post a few images of your breadboard wiring so far? That would be a terrific help!  Also a diagram of your voltage divider would be very helpful.  I know you aren't yet confident of the correctness of your set-up, so I will go slowly, and cross-check the work with an engineer friend here before I power things up. I'll post back whatever I learn. 

Thanks again for your help!
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)