Just to be sure…
When using coffeetrac button.ino with defined output driver = 4 Danfoss Valve PVE A/H/M + IBT_2 Driver, IBT2 wiring scheme would look like this?
Why not use D9 instead of D5 since its already there on the same connector?
I don’t know. I’ll wire it as it is defined in coffeetrac button.ino. Just want to be sure that the wiring is correctly made once and for all since I’m not able to test it with Danfoss myself.
So I’d really appreciate it if someone more knowledgeable would tell me if that wiring is correct in that picture.
You’re probably finding this all a bit frustrating… I wish there weren’t so many ways to do autosteer
From coffeetrac file.
@grabik That’s for nonPCB setup, pin configuration 0. I’m building setups only with PCB, so using pin configuration 1.
@BrianTee_Admin Bull’s eye!
Would it be enough to flip 5 and 9 in these two lines under pinmapping 1 ?
#define PWM2_PIN 9 //PB1
#define LED_PIN 5 //PD5 Autosteer LED
Kaupoi, you can test in sim and measure the output on the motorcontroller when doing a U-turn
Thanks for the tip. Can you confirm that the wiring in my photo is correct when using coffeetrac button.ino as it is?
I can t confirm. Would have to check real life, which pwm goes to m- and m+
I use my ibt_2 with 2 spool valve, so I don’t know.
But wiring between PCB and IBT2 is correct?
Yes your schematic/diagram is working.
You have pwm1 to left.(which means you get danfoss Us out of M+)
BUT: Ino says(in the Pinmapping = = 0 part): #define PWM1_PIN 5 //PD5 Motor=PWM //PWM Valve= Coil 1 right // Danfoss= Control, and that is how my IBT_2 is connected to pcb. And that is why I have D3 to Right PWM when using Pinmapping = = 1.
I did a new test where i changed/swapped 5 and 9 in the define lines.(then still use my flat ribbon connection to IBT_2)
I have D3 to RPWM.
D4 to LPWM
D9 to L and R_EN
In the picture you see black wire (i used same colours as you did in your schematic) goes from M+ to right multimeter as Udc
And red goes from M- to left multi as Us
Max change i Us is from 4,77v at max right in the AOG drive bar, to 7,32 at max left.
I would also recommend as Grabik shows above, the DC DC voltage converter (for easy straight ahead adjustment together with the IBT_2
Or skip the IBT_2 and go the PWM to DC converter way, but perhaps Grabik has a wiring diagram for that?
Oh forgot to mention it is a reduced size version of PCBv1 which made it possible for me to edit pcb in free Eagle. But still same schematic.
Same ino as PCBv2, or Coffeetrac can be used,(but remember different pinmapping in those two)
Thanks for the thorough testing. I’m pretty confused, but I trust what you said at that first sentence.
I finally got to test the hardware and the results look promising. The Volt range in US is 25-75% of UDC.
Great, and wow that is a nice build you have in that box. Is back plate acting as cooler for ibt_2?
Edit dec 2020: in post 66 Kaupoi also got it working with 4.3.10
Thanks. Had similar box and parts in use last summer with hydraforce valve. Never had any issues with it. Valve solenoid works with low amps so no extra heat sink needed.
I have my pcb v2 and Danfoss system working with cytron md13s. Brian was right, put the pwm signal from pwm1 and the ground. If the dir is not connected it puts the signal to MA output. With 5v to dir, it switches to MB. I want to put 5v to pwm2 to energize an ssr relay to send 12v to Udc on valve. I just connected direct for testing. I haven’t been able to get code to work with v4.1, 4.1.12, or 4.3.10, so I’m still using coffeetrac button. Its works fine but I can’t adjust anything from AOG. I tried using an ino that was on github, cant remember who’s, but I cant seem to get a pwm signal or 5v from dir and pwm2 out of any of them.
Also when I use v4.1 or v4.1.12, the screen spins when I turn roll from mma 1d. I sat the rate to 8 from GPS but I haven’t been able to figure out how to set it for gga and vgt only from the co99 f9p. I’m hoping that is what my problem is.
Short astory long, one ibt2 quit working. Another didn’t work out of the box, and the cytron works well and the steering was a lot more stable, it seems with v4.1 and v4.1.12.
If anyone has any help, for any of these problems, I would appreciate it.
Got .ino working in v4.4.12 with danfoss valve. Also got rtk base up and running.
Proportional is at 100, output is at 180 or so, min pwm is at 26. Angle per degree is 24.
Steering is pretty decent but seems to be busy all the time.
The gains are a lot higher than they were with coffeetrac and ibt.
Should I change pwm frequency, or is there something else I’m missing ?
Have been trying to modify 4.3.10 ino to work with danfoss valve. I cant seem to get pwm1 to give voltage. Dir works on switch, but nothing out of pwm1. Could sure use some help
Did you use this part of ino made by JhnP?
I am using an IBT2 to control the steering on an 8330 with Danfoss. I have 12v on the Udc pin, and the pwm signals from the arduino sets the Us. 6V steers straight ahead, 9V to the left and 3V to the right. I have some pics JD 8230 hydraulic steering . Its not a clean setup but it has been working nice on my one field test cultivating. @theGtknerd i noticed while i was originally setting up that with 1 hz on gps it was all over the place, but now at 10hz its smooth. Any chance that could be an issue for you? I have been using v3.9 with the coffeetrac button ino. I think that with the code written like i have it below that it seems to be working fine on my bench test setup but no actual field experience yet. I am a total arduino beginner so if anything in this coding seems wrong please let me know.
Autosteer PID
void motorDrive(void)
{
// Used with Cytron MD30C Driver
// Steering Motor
// Dir + PWM Signal
if (aogSettings.CytronDriver)
{
pwmDisplay = pwmDrive;
//fast set the direction accordingly (this is pin DIR1_RL_ENABLE, port D, 4)
if (pwmDrive >= 0) bitSet(PORTD, 4); //set the correct direction
else
{
bitClear(PORTD, 4);
pwmDrive = -1 * pwmDrive;
}
//write out the 0 to 255 value
analogWrite(PWM1_LPWM, pwmDrive);
}
else
{ // Danfoss: PWM 25% On = Left Position max (below Valve=Center)
// Danfoss: PWM 50% On = Center Position
// Danfoss: PWM 75% On = Right Position max (above Valve=Center)
// Used with IBT 2 Driver for Danfoss
// Dir1 connected to BOTH enables
// PWM Left + PWM Right Signal
pwmDrive = pwmDrive / 4;
pwmDrive = pwmDrive + 128; // add Center Pos.
pwmDisplay = pwmDrive;
analogWrite(PWM1_LPWM, pwmDrive), // apply varying voltage to the Usignal valve pin
digitalWrite(PWM2_RPWM, HIGH); // apply 100% DC current to Udc
}
}
I also experimented with one (but stolen from @grabik ) , where I would let AOG setting be for Cytron, and want PWM out on PWM1
12V Power for Danfoss valve should be regulated and not through motordriver
I tried to edit autosteer_USB_4.3.10 PID.ino and it does compile but I don´t know if it works.
I put al new stuff between Start Danfoss and End Danfoss
And commented out what I don´t think is needed by //lvdfoss
Edit dec 2020: in post 66 Kaupoi made it work with 4.3.10
void calcSteeringPID(void)
{
//Proportional only
pValue = steerSettings.Kp * steerAngleError;
//pwmDrive = (constrain(pValue, -255, 255));
pwmDrive = (int)pValue;
//steerSettings.lowPWM
errorAbs = abs(steerAngleError);
int newMax = 0;
if (errorAbs < LOW_HIGH_DEGREES)
{
newMax = (errorAbs * highLowPerDeg) + steerSettings.lowPWM;
}
else newMax = steerSettings.highPWM;
//add min throttle factor so no delay from motor resistance.
if (pwmDrive < 0 ) pwmDrive -= steerSettings.minPWM;
else if (pwmDrive > 0 ) pwmDrive += steerSettings.minPWM;
//limit the pwm drive
if (pwmDrive > newMax) pwmDrive = newMax;
if (pwmDrive < -newMax) pwmDrive = -newMax;
if (aogSettings.MotorDriveDirection) pwmDrive *= -1;
}
//#########################################################################################
void motorDrive(void)
{
// Used with Cytron MD30C Driver
// Steering Motor
// Dir + PWM Signal
if (aogSettings.CytronDriver)
{
pwmDisplay = pwmDrive;
//Start Danfoss=========================================
//#if (Output_Driver == 4) //PWM 50% if pwmDrive ~ 0 , PWM 0% if pwmDrive -255 …
//void motorDrive(void)
// Used with Danfoss valve 50% pwm off valve
pwmDanfoss = (pwmDrive/2)+128;
if(pwmDanfoss > 195) pwmDanfoss = 195; // max 0,75 U , PWM 75%
if (pwmDanfoss < 1 ) pwmDanfoss = 48; // min 0,25 U ,PWM 25%
analogWrite(PWM1_LPWM, pwmDanfoss);
}
//#endif
//End Danfoss==========================================
//lvdfoss //fast set the direction accordingly (this is pin DIR1_RL_ENABLE, port D, 4)
//lvdfoss if (pwmDrive >= 0) bitSet(PORTD, 4); //set the correct direction
//lvdfoss else
//lvdfoss {
//lvdfoss bitClear(PORTD, 4);
//lvdfoss pwmDrive = -1 * pwmDrive;
//lvdfoss }
//lvdfoss //write out the 0 to 255 value
//lvdfoss analogWrite(PWM1_LPWM, pwmDrive);
//lvdfoss }
The PID.ino continues normal from here.