.ino for PCB+MD13S+Danfoss valve

I ask on behalf of a colleague… Is there any .ino for PCB+MD13S+Danfoss setup. I couldn’t find such option in Brian’s or Coffeetrac’s .inos.

Well danfoss isn’t part of the setup, you just hook it to the driver

I think there must be some difference since Weder refer to 3 different choices, and the Danfoss PVEA/H/S electrohydraulic actuator, have only one signal input that needs 0,5 V to be neutral
Neutral U S (pin 2) = 0.5 U DC
Q: P → A, U S (pin 2) = (0.5 → 0.25) U DC gives oilflow to A
Q: P → B, U S (pin 2) = (0.5 → 0.75) U DC gives oilflow to B
Found page 10 to 11 here:https://assets.danfoss.com/documents/DOC152886483353/DOC152886483353.pdf

And in post 773 Weder says: my danfoss ino

(click on 775 to get there)

#775 Apr 5, 2018

Ok, have that “All In One Sketch” ready, works fine at my tests

Now supports all Outputs, Steering Wheel Encoder and a Autosteer Button

Simply select the right one

#define MOTOR_STEER //uncomment this line if you want to use Stering Wheel Motor
//#define PWM_STEER //uncomment this line if you want to use PWM 2-Coil Valve
//#define DANFOSS_STEER //uncomment this line if you want to use Danfoss Valve PVE A/H/M
CQuick: Yes I used conditional compilation, but only for the motordrive() function
Took your EEprom Storage method, works fine!

1 Like

Thanks for the info. Guess the only way is to go with the ibt2 then.

Maybe you don’t even need a motor controller, just take pwm from arduino to Us and stable 12v to Udc. It’s the ino that is the problem (offset straight ahead to be 0.5 v)
Edit: after learning below it is 0.5 * 12 v so 6v is straight ahead, so a motor controller is needed.

An interesting idea. But I think 0.5 UDC means that neutral is 50% of UDC voltage. So if the UDC is run at 12V, the valve neutral is then 6V U S.
0.25 is 25% of 12V = 3V and 0.75 is 75% of 12V = 9V.
If so, I guess motor controller is needed.
I could build a setup with ibt, but I don’t have one right now (delivery time about 1 month). Md13s would be more convenient choise.

My bad I didn’t realize it was written as a mathematical formula so I didn’t get the invisible “times” sign.
You have a typo after 12V :slightly_smiling_face:

Yes. Thank you. Corrected. :joy:

Looked at the coffeetrac ino (newest download with latest version from 22. aug 19) and think this:
It is possible to use a cytron but have to select the nr. 4 danfoss +ibt 2 option
The cytron will then always give pwm to same side when autosteer is on. Connect that to Us on Danfoss
Either constant 12 V to U dc on danfoss, or via relay powered from pin 7 (LED pin)
Edit : will only work correctly with the relay.

From the ino:

// Pin Configuaration
#if (PinMapping == 0 ) // Default Mapping
#define encAPin 2 //PD2 int0 Steering Wheel Encoder - turns Autosteer off
#define STEERSW_PIN 3 //PD3 button toggles Autosteer Mode (momentary switch)
#define WORKSW_PIN 4 //PD4 Turn On/Off mark Switch (toggle switch)
#define PWM1_PIN 5 //PD5 Motor=PWM //PWM Valve= Coil 1 right // Danfoss= Control PWM
#define DIR_PIN 6 //PD6 Motor=direction //PWM Valve= Coil 2 left // Danfoss= Valvepower
#define LED_PIN 7 //PD7 Autosteer LED
#define W_A_S A0 //Wheel Angle Sensor w.o.ADS
#define Dogs2_Roll A1 //EADOGS2
//ethercard 10,11,12,13
#define RELAY1_PIN 8 //PB0

Are you sure that danfoss+ibt-option works with cytron too? I’m a bit suspicious because theres different options to ibt and cytron when using regular valve? So they need different configuration then.
I’m using pcb.

No I am not sure, I don’t have a cytron to test. But if you /he already have cytron, I would do a test with the Danfoss setting, if you don’t connect to cytron dir pin, then you should have 6v out of cytron on same side always(and steering straight ahead ) , when autosteer is on. But you must have a relay directed by pin 7 to power Danfoss ONLY when autosteer is on (if Danfoss have continius 12v it will give full oil to one side when no pwm is given to cytron and therefore have 0v output)

Ok. I think I understand now. With PCB I need to use pin mapping 1, so LED_PIN is D5 then. Adding a relay doesn’t feel a good idea though.

Testing would be very difficult because the tractor with Danfoss valve is far away. And it still has a CAN control head at the moment.

Would it even be possible to change the Coffeetrac button.ino to work with md13s so that it would provide 12V to the valve only when auto steer is engaged?

Not with the md13s it would demand a Cytron like MMD10a, cytron 10A 5-30V Dual Channel DC Motor Driver, which have 2 pwm inputs.
And yes its D5 then.
So ends up with buying a IBT-2 I think :slight_smile:
If you think IBT-2 is too bulky, just remove heatsink or replace it with a piece of metal(which I have), that would be sufficient cooling for valve spool drive.My IBT-2 didn´t even have cooler paste under the heatsink! OH and the Danfoss would definitely not need cooling on IBT-2 (Danfoss says Signal current at rated voltage 0.25 mA to 0.70 mA)

If you put a 50% duty cycle across the solenoid you will have 6 v across it, All you need is half of the cytron. Super simple setup.

1 Like

Yes, but U DC needs 12V and md13s can’t supply that simultaneously with 6V to U S. Am I right?
So 12V needs to be supplied from other source, through relay for example.
Simple maybe, but not super simple? :grin:

I believe you are right, just tried to figure out where it is written in coffeetrac ino
it says to center danfoss valve, but I did not find how :frowning:

// Reset Output
digitalWrite(LED_PIN, 0); // Turn off Autosteer LED
digitalWrite(DIR_PIN, 0); // Set Motordir to left //turn off PWM Coil 2 // Turn off Danfoss Valve
pwmDrive = 0; // turn Motor off //turn off PWM Coil 1 // Center Danfoss Valve
motorDrive();

min duty cycle pwmDrive = -255 ,max duty cycle pwmDrive = 255; , pwmDrive = 0; motor left 50% duty cycle ( center Danffos valve).

So we must put that line in the ino.
But I find it strange that this line from grabik or something else does not already take care of that issue in an ino where one have the ability choose nr. 4: // 4 = Danfoss Valve PVE A/H/M + IBT_2 Driver.

How does it then work together with motordrive () or Flow or somewhere else where the calculation of pwm is done.
Or is the demand for steering a Duty cycle demand? perhaps from AOG?

Are you able to do those mods to the ino?

Probably not, as I don´t understand what is going on.
Hope Kaupoi can as he/his friend is the one in need.
Reason to post here was that I remembered seeing the danfoss line in the coffeetrac_button.ino I used on my first setup.
I forgot to post the link to coffeetrac ino 3 days ago!
The latest coffetrac ino (august 2019)can be downloaded here: Coffeetrac · GitHub
It still contains the ability to choose danfoss, I just cant get where the ofset of the pwm is done (not the full power to drive the danfoss valve, I can see where that is turned on and off)
And as mentioned earlier Weder must know how he did it.