Learning to program PLCs?

Started by suryabeep, May 07, 2018, 03:59:10 PM

Previous topic - Next topic

suryabeep

Hi everyone,
I'm thinking of attending some summer courses at a local community college. They have two courses: Embedded Control Systems, and PLCs.
Would either one of these be useful for making digital pedals and/or chips like the Druid stompFlo? (I don't even know the basics of digital pedals)

https://mysite.socccd.edu/onlineschedule/ClassDetail.asp?sectionID=61015&termid=20182
https://mysite.socccd.edu/onlineschedule/ClassDetail.asp?sectionID=61020&termid=20182
Still in the process of learning, so bear with me if I ask dumb questions :P

Rixen

The embedded control systems probably would be- you should come out with a good understanding of what makes these things tick. Not necessarily the knowledge to do exactly what you want straight away though- but a good toolbox.


marcelomd

Hi,
IMHO go for the embedded systems course. The Druid Stompflo is a preprogrammed PIC microcontroller. Just what the course is about. It will also teach you basics that will lead you to DSP (digital signal processing).

PLCs are nice for industrial control, but the application is more limited and, frankly, not as much fun (you can do anything a PLC can with a microcontroller).

Disclaimer: Automation engineer with 10+ years of embedded systems experience =)

Rob Strand

I'm with marcelomd.   The microcontroller route is much more suited to pedals.   I'd never think of using a PCL for pedals (mind you as time goes on the gap between the two may decrease.)
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

digi2t

Must be around 20 years ago or so, I suscribed to this site, and bought the book. It was my intro to PLC control, and helped me immensely. To this day, I still receive the monthly tip. This is the best springboard for getting into PLC's.

http://www.plcs.net
  • SUPPORTER
Dead End FX
http://www.deadendfx.com/

Asian Icemen rise again...
http://www.soundclick.com/bands/default.cfm?bandID=903467

"My ears don't distinguish good from great.  It's a blessing, really." EBK

suryabeep

Thank you everyone! Looks like I'll be going to that microcontrollers course then.
In the meantime, I'd greatly appreciate any resources you might have on getting into digital pedals  :)
Thank you again!
Still in the process of learning, so bear with me if I ask dumb questions :P

vigilante397

#6
As a fellow stompbox builder I would agree that microcontrollers would be more fitting to stompboxes and general hobbyist stuff, and as mentioned it seems like the class is more about designing the system than getting deep into programming, but a good introduction either way.

But as an engineer working in industry I would highly recommend learning PLCs. They're on different days, can you do both? :P FPGA (field programmable gate array) is a type of PLC and at least from what I've seen there is a high demand for FPGA programmers. In fact I think that's just about the only skill I learned in school that I use on a consistent basis and was one of my strong selling points when looking for a job.

Quote from: marcelomd on May 07, 2018, 08:14:26 PM
you can do anything a PLC can with a microcontroller

Parallel processing. Not pseudo parallel processing like a microcontroller, I mean honest to goodness parallel processing. If I want something fairly simple or if I need a working prototype in a day or less I'll go with a microcontroller (usually an Atmel), but for something more complicated or especially if timing is a factor at all I go straight for the FPGA.

I've seen a few people do audio processing with FPGAs, but it definitely isn't as friendly as PIC or Atmel programming. Also C and C++ are a bit more common than Verilog or VHDL ::)
  • SUPPORTER
"Some people love music the way other people love chocolate. Some of us love music the way other people love oxygen."

www.sushiboxfx.com

Transmogrifox

Maybe it's because I have been away from the PLC world for too many years, but the PLC's I worked with were just a CPU with a fancy GUI development environment that allowed you to create industrial control processes by dragging and dropping function blocks.

If you really wanted to do something low-level you could program your own function blocks in C++.

What I am missing is if there are PLC's out there that include an FPGA and give the user enough access to the fabric to actually make the FPGA do the stuff it does well.

Where I picture a PLC useful in a music/show/stage/performance setting is in automating systems of pedals, coordinating sound with lighting effects, super matrix switcheroo stuff. 

I tend to see a microcontroller/DSP or FPGA to be best suited to the digital stompbox.

I agree with Nathan's sentiment about using an FPGA for audio DSP.  It's definitely not a good starting point for learning digital signal processing -- you would probably implement something on an FPGA when you are trying to implement something that otherwise would be CPU-intensive on a typical processor.  Some things, like an FFT, can be done very quickly on an FPGA.

Probably a more common use of an FPGA for audio DSP would be within a soft-core CPU (some even include hardware CPU's).  You write most of your application to run on the CPU (C, C++, ASM...), and then implement time-critical stuff and peripheral functions (like talking to the ADC and DAC) in hardware (VHDL or Verilog).
trans·mog·ri·fy
tr.v. trans·mog·ri·fied, trans·mog·ri·fy·ing, trans·mog·ri·fies To change into a different shape or form, especially one that is fantastic or bizarre.

marcelomd

FPGAs are awesome. I used to work with them when I began. The group I worked with, at my university, did research about fault tolerant systems using FPGAs. Got some scars debugging memory controllers. They are very, very, fun to program, but a pain to design the hardware, and not very hobbyist friendly to be honest.

Maybe you are confusing with PLDs or CPLDs (a simpler kind of FPGA)? =)

The course seems to be about controllers for machinery and industrial plants:
Quote
This course introduces the PLC, or programmable logic controller, a small, specialized computer used to control and monitor industrial processes. Students gain hands-on experience in both connecting the PLC to external equipment and programming it using ladder diagrams. Topics covered include relay ladder logic, latching, timing, counting, sequential control, sensors, and actuators.
Which is nice as well, but not something I would do at home =)

Last time I checked, there were some FPGAs with dedicated blocks for DSP functions, like MAC, so there might be something to be done there. But DSP for audio is not that CPU intensive if you have the right peripherals.

Case in point: Mod Devices. These guys made an extensible platform where you can program your own effects and effects chains (and share with the community) with a really nice interface. Check them if you haven't =)
Their platform is based on a high performance ARM processor that has a dedicated DSP core attached (Sitara, from TI, IIRC, good stuff).

Love this stuff. I only really migrated to the software side because working/managing a hardware-based business is hell. I scratch my hardware itch designing pedals that I don't have to program =)

ElectricDruid

I'd go for the Embedded course, but I would say that, wouldn't I?! The other looks too focussed on industrial control, whereas the microcontrollers course seems more open-ended.

The StompLFO is based on the 16F18313 PIC processor. You can do similar things with AVRs. There used to be religious wars fought between fans of PIC versus AVR, but since Microchip bought Atmel and hence now owns both brands, it's a bit of a moot point.

marcelomd

By the way. Just found this

Quote
...
With this in mind, [ElectroSmash] are back at it with another open source offering: the pedalSHIELD MEGA. Aimed at musicians and hackers who want to learn more about audio, DSP and programming, this is an open-hardware/open-software shield for the Arduino MEGA which transforms it into an effects pedal.
...

Transmogrifox

I know this is getting off-topic, but just couldn't resist appending to marcelomd recommendation:
Other options,
https://www.pjrc.com/teensy/td_libs_Audio.html  <--In my mind this is very hobbyist-accessible and does not require much experience with microcontrollers, DSP or programming to start playing and getting stuff to happen.  As you learn then you can tweak things and/or implement stuff yourself.

http://bela.io/  I have a Bela and can do a lot of creative things with it.

http://www.axoloti.com/  I have read up on this a bit and browsed the web site, but never got one so I don't have any real experience.

The pedalSHIELD looks like pretty low-fi stuff and not as much power as the Teensy microcontrollers.  I think Teensy is the better value for your money and time if you want to go the Arduino-style route.  Because Teensy is Arduino compatible you get the benefit of all the Arduino libraries for quickly implementing things like LCD's, I2C communication, pin functions, etc.  The Audio library runs in its own thread, so you can do lower-priority stuff in the main loop() function without robbing from the audio thread (beware the audio thread will rob from you).

Bela is very powerful but also very expensive compared to Arduino and Teensy.

The Digital and DSP forum is a good place to track with the DIY DSP stompbox theme.
trans·mog·ri·fy
tr.v. trans·mog·ri·fied, trans·mog·ri·fy·ing, trans·mog·ri·fies To change into a different shape or form, especially one that is fantastic or bizarre.

ElectricDruid

+1 for Teensy, and the Axoloti is very cool too.

Depends a bit what you want to do.

Basic micro controllers are great for control stuff (The clue's in the name!) like LFOs or other more interesting voltage sources, MIDI, switching, maybe programmability, etc etc. If you want to process actual audio samples and do DSP, you need something with a bit more power like Teensy or Axoloti or something. Sorry to the pedalShield MEGA, but personally I'd find the audio quality and computational ability of that extremely limiting within a short time.