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
A little help please!!
#11
Does the motor ever move in both directions or only one?

Can you switch the ena and enb wires to move in the other direction?
Reply
#12
My engine always runs in the same direction
If I interchange the ena and enb, it turns in the other direction but always with the boat heading <compass heading. As if the pilot did not take into account a boat heading> compass heading!
With the Opencpn plugin, I have a reaction when I click on -10, but no reaction by doing +10: the same using openplot / pypilot / control.
Reply
#13
There is some problem of directional control.

I suggest you can make a simple code move the motor both ways using your schematic, and then determine why motor.ino does not output the same.
Reply
#14
Hello Sean,

Thank you for your response and your suggestion.
But before I embark on this process, I need to go back to school and find out a little more about the programming of the Arduino port registers (which I never had to do) to understand a little your code better. I'm used to programming with the Arduino language (analogRead, analogWrite etc ...) and it works correctly to drive a motor in a simple way. I am perfectly aware that your way of using the Port registers is much more subtle and surely faster, but remains for a neophyte like me a little mysterious.
So I'm going to move towards understanding your way of doing things, hoping to find what doesn't work.

Very cordially and with all my thanks for your help.

Thierry

PS: Just tell me if my diagram seems correct to you
Reply
#15
I believe your diagram is correct but it depends on any software changes you make.
Reply
#16
Hello Sean,

After checking the outputs of pins 2,3,9 and 10, I was able to verify that pins 2 and 3 work normally, but that pin 9 sends current only in one direction, pin 10 sends it in the other direction: it is therefore necessary to connect these last 2 pins to the same 'enable' input of the l298n. Not wanting to touch your code, I did this by using 2 diodes so as not to short-circuit the 2 pins, but to use it alternately, depending on whether the rotation is to the right or to the left.
The pilot seems to be walking now (on my desk for now, while waiting for the tests on board) !!


   Pin 9 - |> ---- | _______ Enable L298N
   Pin 10 - |> --- |
   


I still have to calibrate and adjust the gain !!!
thank you so much

Kinefou
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)