[OCCRA]: Spikes on Cortex

I noticed that someone asked (in the Q&A) how to connect a Spike to the Cortex. Since I cannot reply there, I will help them here (in the general forum):

What I did:
I took a standard PWM cable and cut the red wire. The SPIKE wants a gnd(black), sig(red), sig(white), where the first sig is REVERSE and the second is FORWARD. A Digital channel on the Cortex provides gnd(black), +5v(red), and sig(white). If you don’t cut the red wire, then REVERSE will always be on and FORWARD will be determined by the digital output. If you connected a pneumatic valve to that, it would see 0v on the output and +12 on what should be it’s ground, and would not work.

If you need two: You can connect the red wire of each valve to the M+ and M- terminals on the SPIKE (the one on m+ will be “forward”, the one on m- will be “reverse”), and the blacks to the ground block. Connect the black on the spike to a black on the digital bus, and the red and white on the spike to two digital channels (you would probably have to cut at least 2 PWM cables and solder them together to achieve this, or make your own PWM cable.)

If you want to use the second joystick to control, you have 12 buttons to map to.
(you don’t have to do this,this is what I did)
I used an enumerated type to determine mechanism state, and set that based on buttons.
(I had a stack of IF statements, each one set the state as appropriate)
I then had an array of motor speeds and another of piston positions for each state
Since the enum. maps names to integers, you can index the array with the state directly

I found a slight problem with this solution:

The digital IO pins are controlled by the user processor, not the master. Thus, when in disabled, the user still has control of the outputs. Why is this bad? You can fire your pneumatics when disabled.

It’s still the only way to do it (BTW, it MUST be on the digital section, since those are the only ones that can be used as outputs), so just check if you’re enabled before setting the pin high.

I believe your answer is incomplete. As well as the required hardware modifications (you need 2 signals from a PWM wire, whereas normally we only get one), software modifications are necessary.
Forward must be implemented with one control signal being high and the other control signal being low. Vice-verse for reverse. Forward and reverse are relative terms, it depends on how you one hooks up the plus/minus motor leads and it’s relationship to movement for your robot.
To summarize, both hardware and software modifications to the Cortex wiring and base program are required to make the spikes work as in the past with the IFI control systems.

BTW I will have “New” version of the Spike available for Saturday.

Wiring the same but higher reliability.

What makes these new spikes more reliable?

They are “New” and Improved. They were specifically designed to work with the new Cortex. I have a small supply for teams having issues with the older spikes only.

What kind of changes did they make? How did they make it work using only one PWM cable, or did they use 2 PWM cables? Doesn’t the Cortex software also have to be programmed?

My GUESS is that is has a different optoisolator that runs at 3.3v minimum, instead of the current one that runs at 5v (But could work at 3.3v, just not perfectly). They might have also changed the pinout so it directly accepts two PWM cables, for two digital ports, or created a cable to map two digital outputs to a single Spike.

The new spikes are wired and programmed the same, they are just more reliable.