Stories
Slash Boxes
Comments

SoylentNews is people

Log In

Log In

Create Account  |  Retrieve Password


Budget Quadcopter (Or Octocopter?), Part 2

Posted by cafebabe on Thursday August 03 2017, @07:37PM (#2541)
0 Comments
Code

Motor control using audio amplifiers tenuously overlaps with speaker arrays. It uses some of the same amplifier chips and some of the same code to process WAV files. In particular:-

begin 644 audio-for-motor.c.gz
M'XL(`*-T@UD"`[57;4_;2!#^SJ]84D%MXR1KQZ1<P4B4HRU26ZI`#U5<%)ED
MDUC:[%KV&D(/_OO-OMBQ0Q*H3H>0UYZ9W7EF=M[2=M`/$=-8/*`KCCX11M)(
M$'22CV*.KJ,[\I&GLPS!$WWE`IZGG(F44^2TM]H.LDYM'WOOT-642$[&4Q'G
MLY;D2K;DX7<=#V4B2H79HX@'N+,@;KV)V9#F(X*.,I'&;-*:'M=H`.89B<:W
M2[2'K"T>$I(])X,F4:>.ATS0.BEG,1PK:4`<LQ$9HV\?/OS<>@-O,2/J`QUL
MO2%L%(^W2O+)U^]?SJ]^_'F&_*Z/<4F_!,:@=W)UAH(#7*%_.+D\&WR[`'JG
M0OU\_NFSIOH!D*6?HB1)^3R>12+F#/$QRJ1@Q$9HR-4KOR,I2B,V(>@723D2
M'(UYGFKOCWA^2XG:8XTICP2:V^B?+83FX;QI63$3MC5O!RULVPX\#X$3CZWY
M4>@#20EJ44_S$$J)R%-FP7=S[LQM27PRQW6TC)$`KMP%$D\E#(WX]X!T%D`T
MP5L05L+1@/3!_A+L!:@%[*`&>W$2P+[C\0C=I[$@@]L'03)K.(U2!\&%3`8L
MFA$78*-I%+B:?FN`95G\BPP$HNI@BD/+4&R(:TJ8=:L1@#WJ<$L><8M=BNWM
MD);6C1-(`C&V(!Q)FKJ-G>P]@A>>O@='YG2$&!<:'>*Y2'+1^ILUW!*<<0:9
MQ\+"\X.@-%I;NFP@J/+6VB?7V`#+619/&('X`V$T5#8.P4;Y:<?XF6&[0^QZ
M8)CW_]CUQ\MV^:^RJ^*&A:`2PL?'EDQ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4DO-B/CT##QYKDF15D:$>^E8$H4]=5&774M>WZN1`?YIYUOMB[
M3!:?G;A9_+=@J&BXE6@Q'BS^(/)"GL`O"+GQ8G#:.SNY>KP87/<NOGWYZ5X.
MSGL_+GN/L%Z;M?>I]UU]F[5W<?59?<.Z=#98#<<?X67,F\9UJ-C0;24B,ZJC
MMSO96S6OFXMT*Z8N*2QG^.ZRF4_+P&2.*9MW(='LYQ@WHAQQ&"PD3E"7B?\$
MU-L(M$AB,R+*[%5:6DK/^O.+$;A`HMK-(@;<73G9UK<,*<_4SZL:?0&G>'LJ
1$_"I*)_F)_F_*DC%@/,1````
`
end

(Usual instructions for uudecode process.)

To obtain pre-computed 60 second audio samples, type:-

shell> gunzip audio-for-motor.c.gz
shell> cc audio-for-motor.c -o audio-for-motor
shell> audio-for-motor -t 60

This will generate 113 audio files - a useful subset of 9^4 (6561) possible permutations. The format for the audio files is four digits where:-

  • 8 means full forward.
  • 7 means fast forward.
  • 6 means moderate forward.
  • 5 means slow forward.
  • 4 means neutral.
  • 3 means slow reverse.
  • 2 means moderate reverse.
  • 1 means fast reverse.
  • 0 means full reverse.

and:-

  • First digit is low frequency on left channel.
  • Second digit is low frequency on right channel.
  • Third digit is high frequency on left channel.
  • Fourth digit is high frequency on right channel.

So, 8-8-4-4.wav means full speed forward. 8-0-4-4.wav means left forward, right backward. (Turn clockwise on spot?) 8-8-3-3.wav means full speed with slight negative trim.

This works with a PAM8403 amplifier board and a compact cassette tape pinch motor powered at 3.3 Volts. It is quite fun to click on the icon of an audio file and then see a motor change speed and/or direction. However, the speeds are not monotonic and I suspect the effect may be influenced by vibration in the motor induced by the low frequency signal. Also, the efficiency is worse than expected - even after several modifications to the wave generation algorithm. As a fallback case, diodes may be used. This may improve efficiency. It also doubles the number of motors which can be controlled (at the expense of bi-directional motion).

Rectangular Tuit, Part 4

Posted by cafebabe on Thursday August 03 2017, @06:40PM (#2540)
0 Comments
Code

(This is the 36th of many promised articles which explain an idea in isolation. It is hoped that ideas may be adapted, linked together and implemented.)

I've been off-line doing various tasks. During this period, I've researched Arduino library code. One particularly dumbed-down snippet has appalled several members of my local makerspace. From /usr/share/arduino/libraries/Robot_Control/examples/learn/LineFollowWithPause/LineFollowWithPause.ino:-

Robot.setMode(MODE_LINE_FOLLOW);

Yep. The Arduino library has functionality to abstract away the feedback algorithm required to make a line-following robot. It also has:-

Robot.pauseMode(true);

presumably so a robot can dance, stab someone over the Internet and then continue following a line.

Something I find quite bizarre about the Arduino libraries is the mix of software licences. Are they even compatible? The bootloader is LGPL. Most of the libraries are GPL or MIT licence. Documentation is Creative Commons. I have no idea why documentation would be under a different licence to all of the code.

Most of my time has been spent writing software to process or generate audio signals. I started with a utility to upscale monophonic or stereophonic audio to Ambisonic WXYZ format. It occurs to me that I have to extend the functionality of the sound processor for the speaker array to handle A-Format and B-Format. This optionally requires a 4×4 matrix multiplication prior to the main signal processing. However, the contents of the matrix depends upon the orientation of the original recording. A-Format is typically four directional microphones in a tetrahedral arrangement. Most obviously, one would be "up" while three others would have 120° spacing and a downward incline. This can be converted into the directionally neutral B-Format which is more suitable for mixing and soundstage rotation. Or A-Format could be played directly. However, any use of A-Format assumes one orientation or that some meta-data is present which specifies a known orientation and/or arbitrary inclines.

Anyhow, converting monophonic or stereophonic audio incurs a pivot and one bit loss of audio quality described in Meridian Audio's documentation for Meridian Lossless Packing. Specifically, W=(L+R)/2 and X=(L-R)/2. It was this expected pivot operation which led me to consider A-Format to B-Format processing. Presumably, W=(P+Q+R+S)/4 and the remainder depend upon microphone orientation.

After writing a program to read a one or two channel WAV and write a four channel WAV, it was trivial to re-purpose this into a program which only writes a two channel WAV. This outputs variants of sine waves for line-following robots, quadcopters and suchlike. Code to follow.

Has CNN finally got a clue?

Posted by Gaaark on Monday July 31 2017, @11:54PM (#2538)
9 Comments
Topics

POLITICS:
Has CNN finally got it (almost) right about why Trump won: and better yet, why Sanders would have won?

http://www.cnn.com/2017/07/31/opinions/why-trump-won-zakaria/index.html

Reasons:
1. The first is capitalism. There was a time when the American economy moved in tandem with its middle class. As the economy grew, so did middle class employment and wages. But over the last few decades that link has been broken. The economy has been humming along, but it now enriches mostly those with education, training, and capital. The other Americans have been left behind.

2. The second divide is about culture. In recent decades, we've seen large scale immigration; African-Americans and Hispanics rising to a more central place in society; and gays being accorded equal rights. All of this has meant new cultures and narratives have received national attention. And it's worried a segment of the older, white population, which fears that the national culture they grew up with is fading.

3. The third divide in America today is about class. The Trump vote is in large part an act of class rebellion, a working class revolt against know-it-all elites who run the country.

4. The final C in this story is communication. We have gone from an America where people watched three networks that provided a uniform view of the world to one where everyone can pick their own channel, message, and now even their own facts.

The first one is spot on: the divide is greater and there is a feeling (a Truth!) about the rich enriching themselves at the poors' expense: the Trickle down effect that is a failure (except if you are rich: it is a success).

The second: yes, people are scared if they are intolerant and susceptible to prejudice. (But i think this is much more about job loss than anything else).

The third is why HILLARY lost: the entrenched elite looking out for themselves and their friends is why the first one (Capitalism) came about. People are tired of elites looking out for elites, rich enriching rich. THIS IS WHY THEY SHOULD HAVE RUN SANDERS. Hillary was elite looking out for elite: Trump portrayed himself as the outsider who would shake things up and look out for the 'little guy' (true or not STILL has to be seen).
If they had run Sanders, i believe the Dems would have won.

Four: this is just a truism. Will CNN look at this and start reinvigorating itself and re-imaging itself as a bastion of real news?
.......ummmmm..... well i won't hold my breath.

CNN has it at least half right, but they are still skirting around the issue: Trump won because people distrusted Hillary to do anything but look after herself and her friends. In other words,

Hillary represented status quo: same old, same old.
Trump represented change (not Obama change, but change).

In my view/belief, Sanders represented the change people looked to Trump for: i believe Sanders would have done MUCH better than Hillary and would have won.

Rant on, Snidely. Rant on.

U.S. detects what it wants to find: popcorn at 11:00

Posted by Gaaark on Monday July 31 2017, @11:35PM (#2537)
3 Comments
Topics

U.S. military detects WMD HIGHLY unusual submarine activity from North Korea:

What is the U.S. up to? Will there be a 'final solution to the North Korean problem'? Is there going to be some 'unusual military activity' from the US military in the N.K area?

Popcorn at 11, bring butter for your news: you may need it for easier insertion.

http://www.cnn.com/2017/07/31/politics/north-korea-ejection-test-submarine-activity/index.html

Can we believe ANYTHING we are told by the U.S. military/Government after sooooooo many lies?
Will America finally start realizing that EVENTUALLY lies stop being believed after so many cries about wolf?

Will Roger stop fooling around on Mary with Paul? Will Hammond Industries keep itself from bankruptcy by killing George the CEO? Will Mary's psychiatrist tell his priest about Mary really being Paul?
STAY TUNED..... SAME. BAT. TIME....... SAME. BAT. CHANNEL!

Stupid @Scaramucci!

Posted by realDonaldTrump on Monday July 31 2017, @08:25PM (#2536)
3 Comments
Topics

Wow, @Scaramucci is the worst kind of loser -- a total fool. Threw the White House into complete chaos. Screw him, he's FIRED!

Free movement between UK - EU will end in March 2019

Posted by kaszz on Monday July 31 2017, @01:12PM (#2535)
6 Comments
Career & Education

Prime Minister Theresa May's spokesman said on Monday that the free movement between United Kingdom and EU will end in March 2019.

Get those consulting gigs complete by then.. :p

Free Speech in the UK (Part II)

Posted by turgid on Sunday July 30 2017, @01:18PM (#2534)
11 Comments
Digital Liberty

A few weeks ago I received a mysterious letter in the snail mail purporting to be from a certain PC Plod of Her Majesty's Constabulary informing me in somewhat stilted and ungrammatical English (Mrs Turgid teaches English at a secondary school and was highly amused) that he would like to speak to me regarding a inappropriate comment made on a UK web forum from an IP address apparently registered in my name. The method of communication requested was quite strange. PC Plod wanted to know my phone number so that he could speak to me in person. PC Plod managed to find my snail mail address, so this was a bit fishy, to say the least.

Smelling a rat, I decided to proceed with caution and to entertain the possibility that this may have been some kind of hoax.

Being a bit of a commie I'm a member of a trade union and have access to free lawyers, so I contacted them. I was granted a telephone conversation with a lawyer who was both very helpful and knowledgeable. I am not a lawyer, and what follows in not legal advice. I am paraphrasing from a conversation that happened many weeks ago.

The lawyer agreed that the wording of the letter was very strange. I made the point that I was quite distressed by it since I am not in the habit of intentionally stirring up trouble, certainly not of a violent kind and certainly nothing that would attract the attention of the police. She conjectured that if it wasn't a hoax, perhaps the police had imagined that someone using my network may have said something contravening the Malicious Communications Act. We both discussed that fact that a lot of subjectivity is involved when trying to argue that something is in breach of the Act and that this has implications for Free Speech. To put it a bit more bluntly, just because PC Plod takes issue with something that doesn't mean that a Court of Law would. It would be expensive and time-consuming for them to prove so. And we are still innocent until proven guilty in England and Wales.

She discussed the circumstances under which a police officer may speak to a member of the public. If a police officer has reason to speak to you regarding a suspected crime or such, you should be interviewed under caution and have the right to legal representation. What you discuss will be written down and signed. If the police officer wishes to speak to you in connection with a civil matter, they have no business doing so. They should not be investigating. Lawyers deal directly with that sort of thing. Finally, apparently, a police officer may wish to speak to you unofficially to offer "a few friendly words of advice." Communicating with the police by phone is a bad idea since you have no idea who you are really speaking to at the other end. You also have no idea whether the call is being recorded, whether there are other people listening in, or whether it is being transcribed.

So a letter was written back to this mysterious PC Plod expressing surprise, concern and asking for more information.

Eventually came the reply. PC Plod glibly and arrogantly stated that a message posted from somewhere behind my router broke Section 1 of the Malicious Communications Act but that he had no idea who posted it. Upon looking at the pseudonym under which the message was posted, I suspected satire. The name suggested a certain amount of reactionary bad temper and perhaps a degree of non-conformity perhaps relating to ethnicity, the sort of thing that your typical alt-wrong snowflake would have difficulty with. Looking at the actual message and the discussion under which it was posted, it was patently obvious that it was satire, highly condensed, but in the spirit of Jonathan Swift's A Modest Proposal. The problem is, apart from the fact that PC Plod is poorly educated, not particularly familiar with the political culture of his own country, has no concept of context, but this particular forum has a major design flaw in that moderators may remove comments, thereby removing any context in which other comments may have been made.

PC Plod did indeed offer some friendly advice on Internet security and signed of with a thinly-veiled threat.

Let me just finish by pointing out that this "grossly offensive" comment was pretty tame compared with the stuff EthanolFueled and TheMightyBuzzard and even Runaway1956 post sometimes around here.

Ride safety, on the Ohio case

Posted by kaszz on Sunday July 30 2017, @04:27AM (#2533)
1 Comment
Security

The ride failure at the Ohio State Fair, USA on 2017-07-26 that killed one 18-year old:
WKYC Channel 3: Verify: How safe are the rides here in Ohio?

This investigation by the news outlet notes at 2:20 something interesting. Namely that the swing arm shows signs of metal fatigue. Maybe someone will take a metal grain microscopy of the surfaces. It ought to tell a lot.

I decided to ban the transgenders!

Posted by realDonaldTrump on Thursday July 27 2017, @01:35AM (#2530)
4 Comments
Topics

I've been following with great interest and great concern the news about the murder of Dee Whigham, a known transgender. She was stabbed 119 times, and her throat was slashed. It's become clear to me that transgenders cannot defend themselves. How, then, can they defend our great country? After consultation with my Generals and military experts, please be advised that the United States Government will not accept or allow Transgender individuals to serve in any capacity in the U.S. Military. Our military must be focused on decisive and overwhelming victory and cannot be burdened with the tremendous medical costs and disruption that transgender in the military would entail. God bless!

Grid Computing and Cracking Encryption

Posted by turgid on Tuesday July 25 2017, @06:21PM (#2528)
12 Comments
Digital Liberty

Here's one. Suppose you were a Three Letter Agency and you needed to break some strong encryption. Now say that the cost of the hardware to do that was prohibitive (it's not likely to be invented for several decades, for example) but you remembered that millions of people were running "grid computing" (remember that term) applications on their home computers with juicy GPUs (e.g. Folding@Home). Do you reckon you could get some secret code deployed by those projects to help you break that encryption in parallel right under the noses of J. Random Citizen?