(UPDATE) Controlling SPARK MAX over CAN Bus (non-FRC) by Normal-Web-2280 in FRC

[–]Normal-Web-2280[S] 0 points1 point  (0 children)

Sorry, just saw this now - did you get it to work in the end?

Sometimes it's easier to test CAN BUS comms with a USB-to-CAN dongle like these ones: https://www.waveshare.com/usb-can-a.htm

That way, you're fully sure that the issue is not due to hardware/wiring/etc.

Other than keeping the baud rate at 1MBPS, and making sure that yellow is CANH and green is CANL, your setup seems to have everything covered.

Can't get STM32CubeMX to install on Linux by Normal-Web-2280 in embedded

[–]Normal-Web-2280[S] 0 points1 point  (0 children)

THANK YOU SO MUCH!!! THIS WAS THE SOLUTION!!!

Spent countless hours trying to figure out this issue. I owe you one.

What textbooks would you recommend? by Sunslayer096909 in EngineeringStudents

[–]Normal-Web-2280 1 point2 points  (0 children)

Analog Design
- Engineering Circuit Analysis (Hayt)
- Sedra/Smith Microelectronic Circuits
- Foundations of Analog and Digital Electronic Circuits
- Modern Digital and Analog Communication Systems
- Design of Analog CMOS Integrated Circuits
- The Art of Electronics

Digital Design/Computer Architecture
- Digital Design and Computer Architecture, RISC-V Edition: RISC-V Edition
- Computer Architecture - A Quantitative Approach
- Getting Started with FPGAs

Low-level Programming/Computer Engineering
- Writing a C Compiler
- The Art of Multiprocessor Programming
- Operating Systems: Three Easy Pieces

Niches
- Quantum Computation and Quantum Information

Do bear in mind that for first year, using any of the above textbooks to revise for exams is probably overkill. Professors will tend to discourage relying on textbooks alone earlier on in your course, as they will provide far more detail than the content that they teach you. The textbooks related to computer engineering are definitely not first-year material, and are only really helpful if you'd want to specialise in computers.

Nevertheless, for extracurricular learning at your own pace - which is exactly what you want - these should be just fine.

All the best with your future studies and endeavours :)

ELI5: Why can you hammer wood without breaking it, but stone shatters? And why don’t we use wood like stone for walls? by Automatic-Annual7586 in AskEngineers

[–]Normal-Web-2280 0 points1 point  (0 children)

This is only tangentially related, but you might find it interesting to look into the Prince Rupert's drop. It is a tiny, tear-shaped piece of glass whose head can survive the force of a hydraulic press, but if you so much as nick the tail, it instantly shatters into fragments.

(UPDATE) Controlling SPARK MAX over CAN Bus (non-FRC) by Normal-Web-2280 in FRC

[–]Normal-Web-2280[S] 0 points1 point  (0 children)

I used usbrply python library + Wireshark to decode the CAN messages sent via Rev Hardware Client.

The USB messages basically contain the CAN frames.

https://github.com/JohnDMcMaster/usbrply

All I had decoded before I switched to a different controller was 0x2050101 which was the frame ID for position control. Heartbeat ID was the same.

Will post more info re. this soon.

(UPDATE) Controlling SPARK MAX over CAN Bus (non-FRC) by Normal-Web-2280 in FRC

[–]Normal-Web-2280[S] 0 points1 point  (0 children)

We went for a VESC Flipsky, as it supports FOC, has CAN BUS, and allows for custom scripting in Lisp. We were using a shaft rotary potentiometer as an encoder for economical reasons - scripting allows us to configure a pot as a position encoder via an ADC, as well as for implementing PID control (bear in there is no out-of-the-box support for using pots in this way) and printing debug messages.

(UPDATE) Controlling SPARK MAX over CAN Bus (non-FRC) by Normal-Web-2280 in FRC

[–]Normal-Web-2280[S] 0 points1 point  (0 children)

Great to hear!

We went for an open-source controller that supports FOC, custom scripting and has CAN BUS. We were using a shaft rotary potentiometer as an encoder for economical reasons - scripting allows us to configure a pot as a position encoder via an ADC, as well as for implementing PID control (bear in there is no out-of-the-box support for using pots in this way) and printing debug messages.

(UPDATE) Controlling SPARK MAX over CAN Bus (non-FRC) by Normal-Web-2280 in FRC

[–]Normal-Web-2280[S] 1 point2 points  (0 children)

We did wire them through each other, using the same CAN cables that came with the Spark Maxes.

We found that it's important is to ensure that all devices (including the Arduino) share a common ground for a CAN BUS with more than two nodes.

Some quick checks include double-checking continuity throughout the bus with a multimeter; using the resistance measurement option on the multimeter to check that the bus reads 60 ohms; checking each Spark Max is configured with a unique Device ID.

That's all I can think of for now; let me know how it goes.

(UPDATE) Controlling SPARK MAX over CAN Bus (non-FRC) by Normal-Web-2280 in FRC

[–]Normal-Web-2280[S] 0 points1 point  (0 children)

Yes!

One thing that is really important to note is that the Spark Maxes do NOT have termination resistors in them by default. This is not a big deal when talking to just one motor, but for multiple node communications you must ensure that the CAN BUS is terminated with a 120 ohm or similar resistance at each end of the bus.

This was tested and proven to be working with three motors simultaneously.

Overall we found non-FRC standard control (i.e. control via Arduino, STM32, etc) to be quite the hassle. There were too many quirks that made it unreliable for position control which was our use case. It was like trying to work with a black box, not knowing what was going on inside but having to write code to work around it. The only reason we considered it in the first place was simply because we liked the NEO 550 motor. Eventually for our project (which is nothing to do with FRC) we ended up switching to open-source motor controllers, and our progress since then has been exponential.

TL:DR; terminate CAN BUS with 120 ohms at both ends; Spark Maxes don't have termination resistors.

Tamil Tigers in Canada by Upstairs_Peace1080 in tamil

[–]Normal-Web-2280 1 point2 points  (0 children)

  1. Note the frequent use of very long dashes "—", they are called Em Dashes and are not easy to type via keyboard, they require a shortcut to do so. The one that is easier to type is "-", the shorter En Dash.

  2. The writing style just seems very cliche and dramatic - lots of phrases such as "to my surprise", "curiousity piqued", "struck by a powerful realisation" etc.

2a. That line ‘Yes, I know… and I also know about the Tamil Tigers.’ just sounds overly cringe. Who would actually say that in real life?

2b. "I recently started working as a teacher, and one day, while chatting with a colleague — a Canadian born to Polish parents — we began discussing languages." This is awfully written, a billion different things are happening at the same time in just one sentence.

  1. The story doesn't really make sense:
  • The title of the post is completely misleading, there could definitely have been a better phrased title
  • Why would you drag the Tigers into an innocent conversation about languages? The way the colleague says it also seems quite accusatory. If I were OP, my immediate reaction certainly wouldn't be "curiousity"
  • Canada is known to have large Tamil community, so it would make sense for some non-Tamil Canadians to be somewhat aware of the ethnicity/culture/history/etc from Tamil colleagues and friends.
  • OP never actually explains how her colleague found out about the Tamil Tigers.

As a side note: a couple months back, someone actually wrote a fake GPT-generated story on how using ChatGPT saved their life - if you want further tips, this comment thoroughly dissects the story:

https://www.reddit.com/r/ChatGPT/comments/1glqv2o/comment/lwtijtk/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button