2019-08-15, 03:38 PM
(2019-08-15, 01:37 PM)seandepagnier Wrote:(2019-08-15, 11:54 AM)jamos.tan@gmail.com Wrote:(2019-08-15, 09:35 AM)jamos.tan@gmail.com Wrote: Hi Sean,
I've found an article online which helped me understand more about the L289N board in combination with arduino, and an example sketch steering it.
https://www.teachmemicro.com/use-l298n-motor-driver/ and this is also a good one: https://howtomechatronics.com/tutorials/...-h-bridge/
I've also looked at motor.ino more closely, but don't know how to combine the information I've found in the example sketch from the article, and what to change in motor.ino
Hope I am not asking for too much, but I was wondering if you could help me.
Ok, update here. I've downloaded the newest motor.ino from your github.
My bad, I didn't uncomment the #define VNH2SP30 // defined if this board is used
Autopilot has no errors! When engaging the AP and changing direction of the magnetic compass, polarity reverses OK.
Also manual buttons work.
However, the electromotor is not realy spinning I think. It makes a high pitch sound (recognize it from your video from youtube, makes the same sound)
When measuring it, it is only using about 2 volts.
I'll need to tweak with the gains / and the maximum / minimum settings in the client for that probably right?
Only thing I modified for compensating the low power board I have is change this line:
uint16_t max_current = 200; // 2 Amps
Try just supplying vcc to the ena pin, and see if the motor spins both ways.
Maybe the frequency is too high. Look for where the pwm parameters are set and change it.
Its working! I've done it by adjusting the max skew settings. Tiller from the autohelm st4000 works like a charm now! You are the best.