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
No communication between RPi and Nano using pypilot service
#4
(2022-07-22, 11:32 PM)Jonas.EH Wrote: 1) Going into pypilot Calibration -> Settings, I see that both servo.speed.max and servo.speed.min are set to 100 %, so I guess this is based on clutch pwm in motor.ino and that everything is as I want it Smile

No this is actual motor speed.  The clutch pwm is a different setting that reduces the duty cycle on the clutch output (often a solenoid) to save power since it doesn't need much to hold it on.   For example, without this there could be a 1-2 amp current through the clutch and this can reduce it to a few hundred milliamps.
Quote:2) To check the user running pypilot service:
user@lysmarine:~ $ systemctl show -pUser,UID pypilot
UID=[not set]
User=pi

So it looks like the service is run by the user "pi", although the user I'm logged in as is named "user". Based on https://forum.arduino.cc/t/permission-de.../475568/11 I tried "sudo adduser pi dialout" and "sudo usermod -a -G dialout pi", but both reported that the user pi does not exist. Is there any way to change the service to be run by "user" instead of "pi"? c
Generally you can edit the scripts in /etc/systemd   Try to find the pypilot one, eg: find /etc/systemd | grep pypilot and change the user in the script.
Quote:3) The Arduino Nano is connected via USB, so it is indeed running at 5V (there's only 4.5V on the 5V pin, though, but I guess that's ok).
Yes, 4.5v is quite normal but at the low end of acceptable.  
Quote:I am using the 3.3V pin from the Arduino to power the potmeter (48.8kOhm). I've just now inserted a 100kOhm resistor before the pot, which reduces the center pin to 0-1.1V, and pypilot registers rudder sense perfectly now (and can calibrate as intended), and OpenCPN dashboard updates as intended - I am very happy now Smile
Great!   If you used the 5v pin you would need a slightly higher resistor, that is all.
Quote:I'm considering connecting the RPi and Nano via wires instead of USB, but that will be in the next iteration. USB is fine for now.
My designs all use this for reliability reasons ( and to free up the usb port)
Quote:4) I've changed pwm_style to 0 (h-bridge) and uploaded motor.ino to the nano again. Then I tested the different D-pins using a 1kOhm resistor and a LED. I tested using the center rudder function to obtain either idle, forward or reverse. Below are the pins that made the LED light up:
Idle: D4, 5, 6, 7, 8, 12, 13 (flashing very bright)
Forward: D4, 5, 6, 7, 8, 9, 11 (very bright), 12, 13 (very bright)
Reverse: D4, 5, 6, 7, 8, 9, 11 (very bright), 12, 13 (very bright)

I then repeated the same test with pwm_style = 1 and 2, and got the same results. I don't see any activity on D2 or D3.

I will test more in the coming few days.
check the schematic:
https://pypilot.org/schematics/hbridge_controller.pdf

Generally, D4, D5, D6 are all inputs.  These have weak pullup so could make sense they always light up.   This is true of D7, D8, D12 too.

D11 and D13 are clutch and led outputs and so they are actively driven.   None of the others are since you are in rc pwm mode.

You should tide D6 to ground to get hbridge mode and probably D4 as well (check the comments in motor.ino), otherwise it will use rc pwm mode.   So it makes sense you got the same behavior since the pwm_style set in code is overridden by the pin setting.

It is D2, and D3 that should output steady signal for each direction once this is set and D9/D10 will output pwm.
Reply


Messages In This Thread
RE: No communication between RPi and Nano using pypilot service - by seandepagnier - 2022-07-24, 02:31 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)