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
Motorcontroller and arduino
#1
Hi,

I am testing to control a motor controller which i got from the pypilot site. I think I am quite a noob on this one. Currently, I am using a USB connection to connect to arduino and I want to move using serial pins for the connection. I still dont know how to do this..  so that is my first question. I am aware that i probably should connect the Arduino to the raspberry in the following way:

Arduino Nano   <->   Rasberry
Pin                            Pin
D1 (TXD)                  10 RXD GPIO15
D0 (RXD)                  8   TXD GPIO14
GND                          GND (doesn't really matter where)
Vin                             (2 or 4) 5v


So now the question is it correct... can someone confirm? I will try in the future but for now the USB connection is good for testing as I am still trying to get other components to work. Which brings me to the second and main question.

How do I connect the arduino nano to the motor controller provided by sean. I see there are some nice TX RX VCC and GND port. I tried connecting the to the TXD, RXD, GND, 5v on the nano (with no success of course). Reading through the motor.ino it is clear that the analog ports should be grounded as long as they are not used (i get that) and some descriptions on how to connect to H-bridged etc. I see the digital ports are described, but for me, it is still unclear how there should be connected to the TX and RX on the motor controller.

I know the solution is probably basic but for me it is learning as I go. Thanks for the effort.

Kind regards to all
Reply
#2
You should not use 5v, you must use 3v3 or can damage the pi

Hopefully the serial wiring explains well enough:
https://pypilot.org/schematics/hbridge_datasheet.htm
Reply
#3
(2021-06-26, 12:19 AM)seandepagnier Wrote: You should not use 5v, you must use 3v3 or can damage the pi

Hopefully the serial wiring explains well enough:
https://pypilot.org/schematics/hbridge_datasheet.htm

Hi thanks for you reply but i already viewed that. My question is how do I connect the arduino nano to the motor controller you provided or should I directly link the motorcontroller to the pi? And is i can directly link the motorcontroller to the pi how should i do that? 

I have tried connecting the controller using the pin you give in the diagram enabling uart connecting and assigning uart using pypilot directly and also using serial, but it doesn't recognize anything in pypilot. 

I read almost all forms and i thought you wrote once that connecting to the motor controller using the arduino would be better. I dont know i am kind of at a loss i have been working on this project for a long time now....
Reply
#4
my motor controller essentially functions as an arduino

you would only need an arduino if you are making your own controller.

The most likely problem is that hardware serial is not enabled. This is easy to verify by typing:
ls -l /dev/serial0

The result should be /dev/ttyAMA0 if you get /dev/ttyS0 it is not enabled.

the next thing is to make sure the serial console is not active, you may need to edit /boot/cmdline.txt Also ensure bluetooth service isn't running "service bluetooth status"

These steps are supposed to be handled by the openplotter-pypilot scripts automatically, but it's possible they are somehow failing in your case.
Reply
#5
(2021-06-26, 07:59 AM)seandepagnier Wrote: my motor controller essentially functions as an arduino

you would only need an arduino if you are making your own controller.

The most likely problem is that hardware serial is not enabled.   This is easy to verify by typing:
ls -l /dev/serial0

The result should be /dev/ttyAMA0   if you get /dev/ttyS0 it is not enabled.

the next thing is to make sure the serial console is not active, you may need to edit /boot/cmdline.txt   Also ensure bluetooth service isn't running "service bluetooth status"

These steps are supposed to be handled by the openplotter-pypilot scripts automatically, but it's possible they are somehow failing in your case.

Once again Sean to the rescue. My issue was that I used the other ground pin. You should really use the gnd on the 3rd pin.

(2021-06-26, 07:59 AM)seandepagnier Wrote: my motor controller essentially functions as an arduino

you would only need an arduino if you are making your own controller.

The most likely problem is that hardware serial is not enabled.   This is easy to verify by typing:
ls -l /dev/serial0

The result should be /dev/ttyAMA0   if you get /dev/ttyS0 it is not enabled.

the next thing is to make sure the serial console is not active, you may need to edit /boot/cmdline.txt   Also ensure bluetooth service isn't running "service bluetooth status"

These steps are supposed to be handled by the openplotter-pypilot scripts automatically, but it's possible they are somehow failing in your case.

One more question as soon as autopilot is started does the controller send voltage to the clutch port? I will check it myself but if you can confirm I Wil just use it without checking.
Reply
#6
What do you mean "other ground pin" ? All the ground pins on the 40 pin header are connected

The controller only powers the clutch port when engaged or during manual movements. In standby if not manually controlled the clutch should not receive power.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)