Quote:
Originally Posted by Joohoo
ok, so first of all spike relays cannot be plugged into pwm outputs. What they do need to be plugged into are the relay outputs.
ok now that you have all the pneumatics plugged into relays and not pwms, ill go over how they work. The relays are basically 2 digital outputs slapped into a single cable, so there are two bits that you can set. relay#_fwd and relay#_rev. What this gets translated into is either +12V, -12V, 0V to the festo Valves. So in order to set them to one direction you would use this line of code
relay#_fwd = 1;
relay#_rev = 0;
this will set your festo valve to actuate your pneumatic one way and if you switch which bit is set to 1 then you actuate the pneumatic the other way. Now is for some reason you dont want any pressure in the cylinders then you set each bit to 0.
Now if you want to change these based on a button on a joystick then you can change the relay#_fwd and relay#_rev bits inside an if statment such as
if(p1_sw_top ==1)
{
relay#_fwd = 1;
relay#_rev = 0;
}
If you need any help any further feel free to pm me and I'll try to help you.
|
You're close, but you're not quite right.
First off, you're right about the connections to RC. Spikes
MUST be plugged into the
RELAY outputs on the RC. I don't know that there is a rule saying this, but its implied by the fact that they won't work if you don't.
The
FESTO valves are single solenoid. I don't know what these will do with reverse polarity, but I imagine its along the lines of either a) just not do anything, or b) cease to function ever again.
Thusly, I wouldn't touch relay#_rev on those units, except to ensure its set to 0.
The FESTO valves can be simply switched using relay#_fwd = 1;, and relay#_fwd = 0;
The SMC single solenoid is the same.
The SMC Double solenoid is used in the way you describe, using relay#_fwd for one direction, and relay#_rev for the other direction, assuming you've wired the two positives to M+ and M- on your spike, and the grounds to ground.
Setting _fwd and _rev to zero on a SMC double will leave the gate in whichever direction it was last set to. We are not given "center-off" valves that would give the behavior you describe.