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
Manual motor movements working - no action when engaged?
#1
Hi, and a big thanks, Sean, for making pypilot.

From the web interface, or from the pypilot_control app, in disengaged mode, I can push the buttons (web interface) or use the slider (control app) and the motor moves as expected. 

However, when I engage the autopilot, and either request a new course + 20 degrees, or turn the IMU, then no motor action happens. 

I've just completed a build, running tinypilot, and having flashed the Arduino, connected a motor controller (IBT-2 method, D2 D3 to INA INB, D9 to EN pins), connected a serial GPS, and all of that seems to be working. The heading values seem to make sense, when looking at them in the scope they seem consistent as well. At the moment I am testing things on my lab bench.

Am I missing an important step?

Thanks for any suggestions.
Reply
#2
This is normal. If you increase the feed forward gain FF enough, you should get some motor movement from heading command changes, but normally the pilot is driven off gyro feedback and gradually adjusts the boat to the commanded heading which is not immediate.
Reply
#3
Thanks, Sean. We found a temporary solution while on the go in the Baltic sea in the Turku archipelago.

When debugging this, we were running pypilot at git: 4a4dcdbec598c637ebda29e10b2483314d7d4664 (which is the python source version that I found in the image when cd'ing to 'cd pypilot', and then running git log there.

Upon debugging this further, we found that this part was triggered in servo.py:
def command(self, value, use_period=True):
if time.monotonic() - self.time < 1:
return # ignore pilot command if recent manual override

It looks like this was introduce in 05cbc628601999c0019b9318609d10144db2e48c:
https://github.com/pypilot/pypilot/commi...2e48c#diff-
ffcb05e12e03ad1e94ba342cb827bafb81a0b1af05eb944df287cc96e9aa2ed5R190

This code avoids running commands when there was recent SET that happened. But the SET calls were coming from within the application itself. I haven't understood the code completely, but it seems to have been a race condition between this ignore line and the other timeout logic below near line 320.

But in line 321 the file I was looking at, did not have self.command.command(0), but self.command.set(0)

Pilot speed commands were computed correctly but ignored by the servo. They were ignored because the line below in send_command() - "self.command.set(0)" was causing the sets, which conflicted with the manual override ignore thing above.

def send_command(self):
[...]
elif self.command.value and not self.fault():
timeout = 1 # command will expire after 1 second
if time.monotonic() - self.command.time > timeout:
self.command.set(0)

So this may no longer be an issue on latest tip of tree.

On this beautiful trip in the baltic see, I now commented out the ignore lines around line 188 in servo.py and pypilot is happily serving us. It works on a 33ft sail boat smoothly with the normal and fast profiles without any PID variable adjustments, on compass mode.

How do I best test tip of tree? Which image should I use to start with, and how do I update from git? Then I can try to reproduce with that and see if the issue persists.
Reply
#4
First... If you just wait a few seconds does it work? I am not fully understanding the problem.

Can you try both master and unstable branches?
https://github.com/pypilot/pypilot
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)