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
Reduce steering when AP not active
#7
(2018-07-10, 03:35 PM)seandepagnier Wrote:
(2018-07-09, 07:02 PM)It Paradyske Wrote: I know it doesn't work without IMU, I hope it will be delivered soon... :-)
In the mean time I am trying to get it up and running as far as possible.
I connected a Nokia 5110 LCD on the spi interface, the LCD is hardly readable due to a bad connection by the way, so I ordered an other one.
The actuator is an old Raymarine ST2000+, the compass of the thing is defect so I was able to purchase it for little money.
It is driven by an H-bridge, with IRF540/9540, and a couple of transistors (bc547 and bc557), I designed myself.
I use an arduino red board (equal to uno, still waiting for the nano to come in) with your code to drive the H-bridge, the only modification I made was the polarity of the driving pins to the H-bridge. To activate a MOSFET in the bridge, a positive signal is needed.

Could you please post your source code changes or make a pull request?

The irf540 and 9540 has high on resistance.  These may work for a few amps but are still less efficient.

The mosfets I am using are 1-2 milliohm, all n channel giving less than 1% losses in the mosfets at 12 volts 10 amps.

RDS on is indeed a bit high, 117 mOhm and 44mOhm (I must admit I only saw the 44mOhm when I selected them)
150 mOhm on 10A gives 15W dissipation ...
I use a ST1000+ currently I have limited the current to 5 A.

I didn't know you were pulsing the MOSFETs, I expected a static steering voltage, so the H bridge would be activated continuously when the motor has to turn.
What driver are you using for the MOSFETs? One that shifts the power up, to be able to use N-channels for high and low?


My code for the Arduino:


// run at 4mhz instead of 16mhz to save power,
// and to be able to measure lower current from the shunt
#define DIV_CLOCK

//#define HIGH_CURRENT   // high current uses 300uohm resistor and 50x amplifier
//#define HIGH_CURRENT_OLD   // high current uses 500uohm resistor and 50x amplifier
// otherwise using shunt without amplification

#define rc_pwm_pin 6 // todo: use this pin to detect rc pwm
#define RC_PWM  // remote control style servo

#ifndef RC_PWM
// for direct mosfet mode, define how to turn on/off mosfets
// do not use digitalWrite!
#define a_top_on  PORTB |= _BV(PB1)
#define a_top_off PORTB &= ~_BV(PB1)
#define a_bottom_on PORTD |= _BV(PD2)
#define a_bottom_off PORTD &= ~_BV(PD2)
#define b_top_on  PORTB |= _BV(PB2)
#define b_top_off PORTB &= ~_BV(PB2)
#define b_bottom_on PORTD |= _BV(PD3)
#define b_bottom_off PORTD &= ~_BV(PD3)

Yes I mixed up the outputs a little bit, and changed the levels.

And I use a lower PWM frequency:
#ifdef DIV_CLOCK
    ICR1=4000;  //fPWM=1khz
#else
    ICR1=16000;  //fPWM=1khz
#endif

I'm not so familiar with creating pull requests, so I have to study on that.


Could you please explain how I make my changes persistent?

regards
Hans
Reply


Messages In This Thread
RE: Reduce steering when AP not active and bugs - by It Paradyske - 2018-07-10, 05:55 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)